{"id":"GHSA-q69g-f4f5-v8m7","summary":"ONNX: Denial of service via unchecked expansion of packed sub-byte tensors in ONNX Python APIs","details":"## Summary\n\nONNX's Python tensor-materialization helpers could allocate memory according to attacker-controlled tensor dimensions without verifying that a packed sub-byte payload contained the declared number of elements.\n\nA very small model could therefore cause a disproportionately large allocation when an application called `onnx.numpy_helper.to_array()` or constructed `onnx.reference.ReferenceEvaluator` with the model. The issue affected `UINT2`, `INT2`, `UINT4`, `INT4`, and `FLOAT4E2M1` tensors stored in either `raw_data` or packed `int32_data`.\n\n## Technical details\n\nThe vulnerable `_unpack_2bit()` and `_unpack_4bit()` paths first allocated a small array based on the available packed bytes, then resized it to the shape declared in `TensorProto.dims`. They did not first confirm that the payload encoded enough logical elements for that shape.\n\nFor example, the reporter demonstrated a 66-byte model containing one packed byte and a declared dimension of 700,000,000. The model passed `onnx.checker.check_model()` and allocated approximately 700 MB while materializing the initializer, followed by another large allocation when executing the reference evaluator.\n\nLoading, checking, or running shape inference on the serialized model alone did not trigger the allocation. The vulnerable tensor had to be materialized.\n\n## Impact\n\nAn application that materializes packed tensors from an untrusted model can exhaust available memory, causing denial of service. Memory corruption and code execution were not demonstrated.\n\n## Affected versions\n\n- Affected: ONNX through 1.21.0\n- Patched: ONNX 1.22.0\n\n## Remediation\n\nUpgrade to ONNX 1.22.0 or later.\n\nThe primary fix validates the logical element count before resizing the unpacked NumPy array. A complementary checker change rejects an undersized packed payload before materialization.\n\n- Materialization fix: [onnx/onnx#8033](https://github.com/onnx/onnx/pull/8033)\n- Checker defense-in-depth: [onnx/onnx#8038](https://github.com/onnx/onnx/pull/8038)\n\nThe five affected tensor types and both storage formats were re-tested against the published ONNX 1.23.2 wheel and are rejected before the oversized allocation.\n\nTo verify the behavior using a released vulnerable package in an isolated environment, install `onnx==1.21.0` with `python -m pip install \"onnx==1.21.0\"`. Run memory-exhaustion demonstrations only with an appropriate process memory limit.\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.","aliases":["CVE-2026-115922"],"modified":"2026-10-28T21:30:03.921764375Z","published":"2026-10-28T21:16:37Z","database_specific":{"cwe_ids":["CWE-789"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-10-28T21:16:37Z","nvd_published_at":"2026-10-26T18:17:40Z"},"references":[{"type":"WEB","url":"https://github.com/onnx/onnx/security/advisories/GHSA-q69g-f4f5-v8m7"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-115922"},{"type":"WEB","url":"https://github.com/onnx/onnx/pull/8033"},{"type":"WEB","url":"https://github.com/onnx/onnx/pull/8038"},{"type":"WEB","url":"https://github.com/onnx/onnx/pull/8066"},{"type":"WEB","url":"https://github.com/onnx/onnx/commit/05c1bc3bceceb8d3cf11e9e7fc7f19f971c44988"},{"type":"WEB","url":"https://github.com/onnx/onnx/commit/8de2cf6aa47928e6515ac6d9e1a8b4758886a7df"},{"type":"WEB","url":"https://github.com/onnx/onnx/commit/dce5876d6cc6cc30157af7d26a752ef44976da8e"},{"type":"PACKAGE","url":"https://github.com/onnx/onnx"},{"type":"WEB","url":"https://github.com/onnx/onnx/releases/tag/v1.22.0"}],"affected":[{"package":{"name":"onnx","ecosystem":"PyPI","purl":"pkg:pypi/onnx"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.22.0"}]}],"versions":["0.1","0.2","0.2.1","1.0.0","1.0.1","1.1.0","1.1.1","1.1.2","1.10.0","1.10.1","1.10.2","1.11.0","1.12.0","1.13.0","1.13.1","1.14.0","1.14.1","1.15.0","1.16.0","1.16.1","1.16.2","1.17.0","1.18.0","1.19.0","1.19.1","1.19.1rc1","1.2.1","1.2.2","1.2.3","1.20.0","1.20.0rc1","1.20.0rc2","1.20.1","1.20.1rc1","1.21.0","1.21.0rc1","1.21.0rc2","1.21.0rc3","1.21.0rc4","1.22.0rc1","1.22.0rc2","1.3.0","1.4.0","1.4.1","1.5.0","1.6.0","1.7.0","1.8.0","1.8.1","1.9.0"],"database_specific":{"last_known_affected_version_range":"\u003c= 1.21.0","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-q69g-f4f5-v8m7/GHSA-q69g-f4f5-v8m7.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}