IBM Qiskit SDK 0.43.0 through 2.5.0 could allow an attacker to trigger a segmentation fault leading to a denial of service due to uncontrolled recursion in the parser.
Workarounds/Mitigation guidance:
None
Remediation/Fixes guidance:
The issue is addressed in Qiskit versions v1.4.6 and v2.4.2. These are patched to error with a Python-space RecursionError exception once the expression depth exceeds the Python recursion limit which can be queried with sys.getrecursionlimit(). This limit can be adjusted by calling sys.setrecursionlimit(). Future versions of Qiskit may remove this limit entirely with a non-recursive version of the OpenQASM 2 parser.
Product(s)Version(s) number and/or range Remediation/Fix/Instructions<Qiskit SDK - qiskit.qasm2.loads() function>v1.4.6 and v2.4.2
Upgrade to the patched versions: qiskit v1.4.6 or qiskit v2.4.2.
<Qiskit SDK - QuantumCircuit.from_qasm_str function>v1.4.6 and v2.4.2
Upgrade to the patched versions: qiskit v1.4.6 or qiskit v2.4.2.
<Qiskit SDK - QuantumCircuit.from_qasm_str function>v1.4.6 and v2.4.2
Upgrade to the patched versions: qiskit v1.4.6 or qiskit v2.4.2.