Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious ONNX model with bad num_scan_inputs
-
ExploitSubmit model to application's shape inference
-
ExecutionTrigger null deref or oversized allocation
-
ImpactProcess crash denies service
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Signed/unsigned conversion safety
|
| Exploitation Conditions | The consuming application must perform ONNX shape inference (e.g., onnx.shape_inference.infer_shapes, especially strict_mode) on an untrusted, attacker-supplied model while running ONNX 1.4.0 through 1.21.0, and that model must contain a Scan node whose required num_scan_inputs attribute is either absent (null-pointer dereference) or negative (narrowed to an oversized size_t reaching a vector allocation that raises std::length_error); the vulnerable code paths are ScanInferenceFunction, ScanInferenceFunction_opset8, and ScanInferenceFunction_opset9. Limiting factors: the vector is local (AV:L) - the attacker must get the crafted model to the library's API or file boundary, as ONNX itself is not network-bound - and the impact is confined to denial of service with no confidentiality or integrity effect. The notable exposure amplifier is that the negative-value model passes onnx.checker.check_model(), so applications using check_model() as a safety gate before inference remain vulnerable. Applications that do not run shape inference on untrusted input are not exposed. |
| Impact | This is a genuine but bounded issue best treated as a routine patch priority rather than an emergency, consistent with the input Decision label of 'this_month'. The CVSS 3.1 vector (AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, 6.2 Medium) is availability-only: no confidentiality or integrity impact was demonstrated, and the impact is a denial of service (process termination via null-pointer dereference, or std::length_error from an oversized allocation). The attack vector is Local (AV:L) because the vulnerable ONNX component processes a malicious model through a library API or file boundary and is not itself bound to a network stack - the vendor explicitly notes that applications exposing ONNX model processing over a network should compute an Environmental score with Modified Attack Vector set to Network, which would raise the real-world score for model-hosting/conversion services. AC:L and PR:N/UI:N are reasonable: no privileges or user interaction are needed to supply a model, and the trigger (a Scan node with a missing or negative num_scan_inputs attribute) is simple and attacker-controlled. No CISA KEV listing is present and no EPSS score was provided in the input, so exploitation-probability signals are absent rather than low; do not treat missing EPSS/KEV as evidence of safety. A particularly important nuance: the negative-value variant passes onnx.checker.check_model() and only fails later during shape inference, so pipelines that rely on check_model() as a validation gate get no protection. Net: a real but medium-severity DoS whose practical urgency depends on whether the consuming application performs shape inference on untrusted models. |
| Exploit ScenarioDerived | A service that accepts user-uploaded ONNX models (for conversion, optimization, or hosting) runs onnx.shape_inference.infer_shapes on each model. An attacker submits a crafted model containing a Scan node whose required num_scan_inputs attribute is missing (null-pointer dereference) or set to a negative value (converted to a huge size_t, triggering an exceptional oversized allocation); the negative-value model even passes onnx.checker.check_model() first, so a checker-based gate does not block it. The result is termination or disruption of the shape-inference process, denying service; public proof-of-concept trigger models exist in the fix PR's regression tests, though they are reproducers rather than a packaged weaponized exploit. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 26, 2026
Shape inference in the ONNX library (versions 1.4.0 through 1.21.0) mishandles the required Scan attribute num_scan_inputs: an absent attribute is dereferenced as a null pointer, and a negative value is narrowed to an oversized size_t that reaches a vector allocation and raises std::length_error, letting a crafted model crash or disrupt any process that runs onnx.shape_inference.infer_shapes on untrusted input. Only denial of service is demonstrated (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, 6.2); the attack is unauthenticated but local in vector terms, since the attacker must deliver the model across the library's API or file boundary rather than over a network stack that ONNX itself exposes. No public exploit code or CISA KEV entry was identified at time of analysis, and the priority decision is 'this_month' - a routine patch rather than an emergency; note that the negative-value model passes onnx.checker.check_model(), so using check_model() as a pre-inference gate does not protect against this issue.
RemediationAI
Vendor-released patch: upgrade to ONNX 1.22.0 or later - this is the only complete fix, and the advisory notes that both reported models were re-tested against the published 1.23.2 wheel and now correctly raise InferenceError. The fix is upstream in PR https://github.com/onnx/onnx/pull/7916 (commit dd6bc92ea39fd2274fd671f0734b0b8b558356f5), which introduces checked narrowing and required-attribute helpers that throw InferenceError instead of dereferencing a null pointer or allocating on a wrapped negative size. Until an upgrade can be shipped, the effective compensating controls are to avoid running shape inference on untrusted models (parse and validate models only from trusted or signed sources, or perform inference in a one-way-isolated subprocess/container with strict CPU and memory limits so a std::length_error or segfault cannot take down the parent service); the trade-off is that skipping shape inference leaves output shapes unresolved for downstream consumers that rely on them, and process isolation limits blast radius but does not remove the crash. Do not rely on onnx.checker.check_model() as a safety gate before inference, because the advisory confirms the negative-value model passes that check. Adopting the upstream helpers getRequiredAttribute/getRequiredAttributeInt and narrow<T>() in any downstream fork or vendored copy of the shape-inference sources is the correct backport path. Advisory: https://github.com/onnx/onnx/security/advisories/GHSA-m4pr-6v3c-6fgr.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
ONNX is an open standard and C++ library for machine learning model interchange; models are protobuf graphs whose operators declare attributes, and shape inference walks the graph in InferenceContext, resolving attribute values through ctx.getAttribute(). The vulnerable code in ScanInferenceFunction, ScanInferenceFunction_opset8 and ScanInferenceFunction_opset9 used the pattern narrow_cast<size_t>(ctx.getAttribute("num_scan_inputs")->i()), which neither checks the returned pointer for null (CWE-476) nor rejects a negative signed int64 before converting it to an unsigned size (CWE-195, signed-to-unsigned conversion error). A missing attribute therefore dereferences a null AttributeProto pointer, while a value such as -1 wraps to a very large size_t that is used to size a std::vector, throwing std::length_error from an exceptional allocation path. The fix replaces narrow_cast with a checked narrow<T>() and adds getRequiredAttribute/getRequiredAttributeInt helpers in onnx/defs/shape_inference.h that throw InferenceError on a missing or non-integer attribute and on lossy narrowing; the same upstream PR (#7916) also added a ConvTranspose weight-rank check and a function output-count check that prevent other inference-time crashes. The advisory assigns both triggers to one CVE because they affect the same required attribute, share the same conversion path and fix, and were released together. ONNX is not network-bound, which is why the vector is AV:L; applications that expose model processing over a network are expected to re-score with Modified Attack Vector Network.
Know when Onnx gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Untrusted model reaches the library via a local API/file boundary (AV:L), trigger is a simple malformed attribute needing no privileges or interaction (AC:L/PR:N/UI:N), and impact is DoS only (A:H, C:N/I:N).
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
Open Neural Network Exchange (ONNX) is an open standard for machine learning interoperability. From 1.4.0 until 1.22.0, ScanInferenceFunction, ScanInferenceFunction_opset8, and ScanInferenceFunction_opset9 do not safely validate the required num_scan_inputs attribute. A missing attribute is dereferenced as a null pointer, while a negative value is converted to size_t and can reach an exceptional oversized allocation path. An untrusted model can therefore terminate or disrupt shape inference, including a negative-value model that can pass onnx.checker.check_model(). This issue is fixed in version 1.22.0.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
A vulnerability in the `download_model_with_test_data` function of the onnx/onnx framework, version 1.16.0, allows for a
Symlink-following arbitrary file write in ONNX's save_external_data function (onnx/external_data_helper.py) allows a loc
Versions of the package onnx before and including 1.15.0 are vulnerable to Out-of-bounds Read as the ONNX_ASSERT and ONN
Arbitrary attribute injection in ONNX Python library (versions prior to 1.21.0) allows unauthenticated remote attackers
Versions of the package onnx before and including 1.15.0 are vulnerable to Directory Traversal as the external_data fiel
Memory exhaustion denial of service in ONNX prior to 1.22.0: the Python tensor-materialization helpers _unpack_2bit() an
Out-of-bounds read in ONNX ConvTranspose shape inference (convTransposeShapeInference and convTransposeShapeInference_op
Out-of-bounds read in ONNX's legacy shape-inference path allows an attacker-supplied model to crash a process that calls
Out-of-bounds read in ONNX versions up to 1.21.x exposes limited memory contents to low-privileged remote attackers via
ONNX versions prior to 1.21.0 allow local attackers to read arbitrary files outside the model directory through symlink
ONNX versions prior to 1.21.0 allow local attackers to read arbitrary files by exploiting a hardlink-based path traversa
Weak cache key construction in onnx-mlir's torch backend (versions up to 0.5.0.0) omits tensor data type (dtype) from pl
EUVD-2026-110046
GHSA-m4pr-6v3c-6fgr
NVD
CVE.org
EPSS
Exploit-DB