Skip to content
Heist/ feed
Back to feed
High

MONAI through 1.6.0 _get_fake_spatial_shape eval() Sandbox Bypass via Attribute Chains

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-100842
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 22:15 UTC · Revision 1

Source evidence

MONAI through 1.6.0 _get_fake_spatial_shape eval() Sandbox Bypass via Attribute Chains

core-osv · Original source

Published 27 Sept 2026, 01:28 UTC

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.

osv:CVE-2026-100842
Complete source record
{
  "id": "5a9b59bfe1e3cbeb73a6ebe403eea426ab092f9eb2a375257ae79b02c771c3d1",
  "url": "https://osv.dev/vulnerability/CVE-2026-100842",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "MONAI through 1.6.0 _get_fake_spatial_shape eval() Sandbox Bypass via Attribute Chains",
    "summary": "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.",
    "evidence": "osv:CVE-2026-100842",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-100842",
      "aliases": [
        "CVE-2026-100842",
        "GHSA-h89g-r5pc-wxfm",
        "PYSEC-2026-4017"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/project-monai/monai",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "last_affected": "eccefc57550b111ed781d82249dfe77872a0e918"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "1.6.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "cpe": "cpe:2.3:a:project-monai:monai:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "1.6.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.6.0rc1",
            "1.6.0",
            "1.5.1",
            "1.5.0",
            "1.5.0rc1",
            "1.4.1rc1",
            "1.4.0",
            "1.4.0rc12",
            "1.4.0rc11",
            "1.4.0rc10",
            "1.4.0rc9",
            "1.4.0rc8",
            "1.4.0rc7",
            "1.4.0rc6",
            "1.4.0rc5",
            "1.4.0rc4",
            "1.4.0rc3",
            "1.4.0rc2",
            "1.4.0rc1",
            "1.3.3rc1",
            "1.3.1",
            "1.3.1rc8",
            "1.3.1rc7",
            "1.3.1rc6",
            "1.3.1rc5",
            "1.3.1rc4",
            "1.3.1rc3",
            "1.3.1rc2",
            "1.3.1rc1",
            "1.3.0",
            "1.3.0rc5",
            "1.3.0rc4",
            "1.3.0rc3",
            "1.3.0rc2",
            "1.3.0rc1",
            "1.2.0",
            "1.2.0rc7",
            "1.2.0rc6",
            "1.2.0rc5",
            "1.2.0rc4",
            "1.2.0rc2",
            "1.2.0rc1",
            "1.1.0",
            "1.1.0rc2",
            "1.1.0rc1",
            "1.0.0rc3",
            "1.0.0rc2",
            "1.0.0rc1",
            "0.9.1",
            "0.9.1rc5",
            "0.9.1rc4",
            "0.9.1rc3",
            "0.9.1rc2",
            "0.9.1rc1",
            "0.9.0",
            "0.9.0rc3",
            "0.9.0rc2",
            "0.9.0rc1",
            "0.8.1",
            "0.8.1rc5",
            "0.8.1rc4",
            "0.8.1rc3",
            "0.8.1rc2",
            "0.8.1rc1",
            "0.8.0",
            "0.8.0rc3",
            "0.8.0rc2",
            "0.8.0rc1",
            "0.7.0",
            "0.7.0rc5",
            "0.7.0rc4",
            "0.7.0rc3",
            "0.7.0rc2",
            "0.7.0rc1",
            "0.6.0",
            "0.6.0rc2",
            "0.6.0rc1",
            "0.5.2",
            "0.5.1",
            "0.5.0",
            "0.5.0rc5",
            "0.5.0rc4",
            "0.5.0rc3",
            "0.5.0rc2",
            "0.5.0rc1",
            "0.4.0",
            "0.4.0rc2",
            "0.4.0rc1",
            "0.3.0",
            "0.3.0rc4",
            "0.3.0rc3",
            "0.3.0rc2",
            "0.3.0rc1",
            "0.2.0",
            "0.2.0rc3",
            "0.2.0rc2",
            "0.2.0rc1",
            "0.1.0",
            "0.1.0rc2",
            "0.1.0rc1",
            "0.1a1.dev9",
            "0.1a1.dev8",
            "0.1a1.dev7"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-100842.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:23.847014327Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/100xxx/CVE-2026-100842.json",
        "https://github.com/Project-MONAI/MONAI/security/advisories/GHSA-h89g-r5pc-wxfm",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-100842",
        "https://www.vulncheck.com/advisories/monai-through-1.6.0-get-fake-spatial-shape-eval-sandbox-bypass-via-attribute-chains"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-95"
        ],
        "cna_assigner": "VulnCheck",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/100xxx/CVE-2026-100842.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-100842",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 490496,
  "published_at": "2026-09-27T01:28:38.149+00:00"
}