{"id":"CVE-2026-115921","aliases":["GHSA-m4pr-6v3c-6fgr"],"url":"https://o3.security/vulnerability/CVE-2026-115921","summary":"ONNX: Null Pointer Dereference in ScanInferenceFunction Due to Missing Required Attribute","details":"## Summary\n\nONNX shape inference did not safely validate the required Scan `num_scan_inputs` attribute. Two malformed values could terminate or disrupt the process:\n\n1. If the attribute was missing, `ctx.getAttribute(\"num_scan_inputs\")` returned null and was dereferenced.\n2. If the attribute was negative, conversion to `size_t` produced a very large value that reached a vector allocation and raised `std::length_error`.\n\nThe negative-value variant passed `onnx.checker.check_model()` before reaching shape inference.\n\n## Technical details\n\nThe vulnerable Scan inference implementations used the following pattern:\n\n```cpp\nauto num_scan_inputs =\n    narrow_cast<size_t>(ctx.getAttribute(\"num_scan_inputs\")->i());\n```\n\nThis code neither checked the returned pointer nor rejected a negative signed value before converting it to an unsigned size. The pattern was present in the current Scan inference function and the older opset 8 and 9 paths.\n\nThe fix uses the required-attribute helper and checked narrowing:\n\n```cpp\nauto num_scan_inputs =\n    narrow<size_t>(getRequiredAttributeInt(ctx, \"num_scan_inputs\"));\n```\n\n## Impact\n\nAn application that performs shape inference on an untrusted model can be terminated or forced into an exceptional allocation path, causing denial of service. No confidentiality or integrity impact was demonstrated.\n\n## Affected versions\n\n- Affected: ONNX 1.4.0 through 1.21.0\n- Patched: ONNX 1.22.0\n\nONNX 1.4.0 is the first release containing the vulnerable Scan shape-inference implementation.\n\n## Remediation\n\nUpgrade to ONNX 1.22.0 or later.\n\n- Fix: [onnx/onnx#7916](https://github.com/onnx/onnx/pull/7916)\n- Commit: [`dd6bc92ea`](https://github.com/onnx/onnx/commit/dd6bc92ea39fd2274fd671f0734b0b8b558356f5)\n\nBoth reported models were re-tested against the published ONNX 1.23.2 wheel and correctly raise `InferenceError`.\n\n## Severity\n\nThe vulnerable ONNX component processes the malicious model through a local library API or file boundary and is not itself bound to a network stack. Applications that expose ONNX model processing over a network should calculate an Environmental score with Modified Attack Vector set to Network.\n\nThe two triggers remain in one advisory because they affect the same required attribute, share the same unsafe conversion path and remediation, and were fixed in the same release.","published":"2026-10-26T17:28:41.420Z","modified":"2026-10-28T11:02:23.844535408Z","cvss":{"score":6.2,"severity":"MEDIUM","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"PyPI","name":"onnx","fixedVersion":"1.22.0"}],"fix":{"url":"https://github.com/onnx/onnx/commit/dd6bc92ea39fd2274fd671f0734b0b8b558356f5","label":"onnx/onnx@dd6bc92"},"references":[{"type":"WEB","url":"https://github.com/onnx/onnx/releases/tag/v1.22.0"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/115xxx/CVE-2026-115921.json"},{"type":"ADVISORY","url":"https://github.com/onnx/onnx/security/advisories/GHSA-m4pr-6v3c-6fgr"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-115921"},{"type":"FIX","url":"https://github.com/onnx/onnx/commit/dd6bc92ea39fd2274fd671f0734b0b8b558356f5"},{"type":"FIX","url":"https://github.com/onnx/onnx/pull/7916"},{"type":"PACKAGE","url":"https://github.com/onnx/onnx"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T11:02:23.844535408Z"}}