Weakness (CWE)
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.
How to prevent it (3 mitigations)
-
Implementation
Refactor the code to avoid dynamic variable evaluation whenever possible.
-
Implementation
Use only allowlists of acceptable variable or function names.
-
Implementation
For function names, ensure that you are only calling functions that accept the proper number of arguments, to avoid unexpected null arguments.
Source: MITRE CWE-627
1 result · Clear filters · Feed
-
Low 2.8
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…