MONAI through 1.6.0 contains an eval injection vulnerability in _get_fake_spatial_shape() in monai/bundle/scripts.py. (CVE-2026-100842)
MONAI through 1.6.0 contains an eval injection vulnerability in _get_fake_spatial_shape() in monai/bundle/scripts.py. The function validates shape expressions with a helper that walks the AST and only collects ast.Name nodes, rejecting any name other than 'p' or 'n', before passing the string to eval(). Expressions built solely from constants and attribute, subscript, or call nodes (for example "(1).__class__.__bases__[0].__subclasses__()" or "int.__class__.__init__.__globals__") contain no ast.Name nodes and therefore bypass the allowlist. Because the shape value originates from bundle metadata consumed by _get_real_input_data and verify_net_in_out (reachable through the bundle 'verify_net_in_out' CLI flow), an attacker who can influence a bundle's metadata can escape the eval sandbox via object introspection chains and achieve code execution in this non-default flow.
AI Analysis
Technical Summary
The vulnerability in MONAI through version 1.6.0 is an eval injection in the _get_fake_spatial_shape() function. This function attempts to validate shape expressions by walking the AST and only allowing ast.Name nodes named 'p' or 'n'. However, expressions composed solely of constants and attribute, subscript, or call nodes bypass this check because they contain no ast.Name nodes. Since the shape value is derived from bundle metadata used in the 'verify_net_in_out' CLI flow, an attacker able to control this metadata can escape the eval sandbox via object introspection chains, leading to arbitrary code execution.
Potential Impact
Successful exploitation allows an attacker with the ability to influence bundle metadata to execute arbitrary code on the system running the vulnerable MONAI version. This impacts confidentiality, integrity, and availability as indicated by the CVSS vector (C:H/I:H/A:H). The attack vector requires local access with low privileges and high attack complexity, and no user interaction is needed. The vulnerable code path is reachable through a non-default CLI flow.
Mitigation Recommendations
No patch or official fix information is provided. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid running the 'verify_net_in_out' CLI flow on untrusted bundles or restrict bundle metadata sources to trusted inputs only.
MONAI through 1.6.0 contains an eval injection vulnerability in _get_fake_spatial_shape() in monai/bundle/scripts.py. (CVE-2026-100842)
Description
MONAI through 1.6.0 contains an eval injection vulnerability in _get_fake_spatial_shape() in monai/bundle/scripts.py. The function validates shape expressions with a helper that walks the AST and only collects ast.Name nodes, rejecting any name other than 'p' or 'n', before passing the string to eval(). Expressions built solely from constants and attribute, subscript, or call nodes (for example "(1).__class__.__bases__[0].__subclasses__()" or "int.__class__.__init__.__globals__") contain no ast.Name nodes and therefore bypass the allowlist. Because the shape value originates from bundle metadata consumed by _get_real_input_data and verify_net_in_out (reachable through the bundle 'verify_net_in_out' CLI flow), an attacker who can influence a bundle's metadata can escape the eval sandbox via object introspection chains and achieve code execution in this non-default flow.
CVSS v3.1
Score 7.0high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in MONAI through version 1.6.0 is an eval injection in the _get_fake_spatial_shape() function. This function attempts to validate shape expressions by walking the AST and only allowing ast.Name nodes named 'p' or 'n'. However, expressions composed solely of constants and attribute, subscript, or call nodes bypass this check because they contain no ast.Name nodes. Since the shape value is derived from bundle metadata used in the 'verify_net_in_out' CLI flow, an attacker able to control this metadata can escape the eval sandbox via object introspection chains, leading to arbitrary code execution.
Potential Impact
Successful exploitation allows an attacker with the ability to influence bundle metadata to execute arbitrary code on the system running the vulnerable MONAI version. This impacts confidentiality, integrity, and availability as indicated by the CVSS vector (C:H/I:H/A:H). The attack vector requires local access with low privileges and high attack complexity, and no user interaction is needed. The vulnerable code path is reachable through a non-default CLI flow.
Mitigation Recommendations
No patch or official fix information is provided. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid running the 'verify_net_in_out' CLI flow on untrusted bundles or restrict bundle metadata sources to trusted inputs only.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-j335-cfj5-2fw8
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-100842"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6ab89bbdf7a7c54106941eb2
Added to database: 09/27/2026, 04:29:49 UTC
Last enriched: 09/27/2026, 04:35:57 UTC
Last updated: 09/28/2026, 01:59:00 UTC
Views: 9
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.