---
id: "CVE-2026-115922"
kind: "vulnerability"
aliases: ["CVE-2026-115922"]
title: "ONNX: crafted tensor shape exhausts memory during to_array conversion"
severity: "medium"
cvss: 6.2
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["machine-learning", "onnx", "package", "python"]
not_affected_if: ["no-untrusted-model-input", "trusted-models-only"]
published_at: "2026-10-26T18:17:40+00:00"
first_seen_at: "2026-10-26T18:31:43+00:00"
updated_at: "2026-10-26T18:34:04+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-115922", "first_seen_at": "2026-10-26T18:31:43+00:00"}]
---

# ONNX: crafted tensor shape exhausts memory during to_array conversion

ONNX's 2-bit and 4-bit tensor unpacking trusts attacker-controlled tensor dimensions and allocates memory to match them without checking the packed payload size. Loading an untrusted model with these tensor types through onnx.numpy_helper.to_array() or ReferenceEvaluator can exhaust the memory of the process, causing a denial of service.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `pip show onnx` and check whether the installed version is below `1.22.0`
- Check whether the application loads untrusted ONNX models with `onnx.numpy_helper.to_array()` or `onnx.reference.ReferenceEvaluator`

## Fix

- Upgrade the onnx package to `1.22.0` or later
- Until upgraded, only load ONNX models from trusted sources

## Timeline

- 2026-10-26T18:31:43+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-115922

## From the sources

Open Neural Network Exchange (ONNX) is an open standard for machine learning interoperability. Prior to 1.22.0, _unpack_2bit() and _unpack_4bit() resize unpacked arrays according to attacker-controlled TensorProto.dims without verifying that raw_data or int32_data encodes the declared number of elements. Materializing an untrusted UINT2, INT2, UINT4, INT4, or FLOAT4E2M1 tensor through onnx.numpy_helper.to_array() or onnx.reference.ReferenceEvaluator can therefore expand a small packed payload into a disproportionately large allocation and exhaust memory. This issue is fixed in version 1.22.0.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
