---
id: "CVE-2026-115921"
kind: "vulnerability"
aliases: ["CVE-2026-115921"]
title: "ONNX: malformed Scan model crashes shape inference via unchecked attribute"
severity: "medium"
cvss: 6.2
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["machine-learning", "onnx", "package", "python"]
not_affected_if: ["trusted-models-only"]
published_at: "2026-10-26T18:17:39+00:00"
first_seen_at: "2026-10-26T18:31:43+00:00"
updated_at: "2026-10-26T18:34:05+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-115921", "first_seen_at": "2026-10-26T18:31:43+00:00"}]
---

# ONNX: malformed Scan model crashes shape inference via unchecked attribute

ONNX, an open machine learning model format library, mishandles the num_scan_inputs attribute in its Scan inference functions. A crafted model with that attribute missing or negative can crash or disrupt shape inference when loaded.

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

## How to check

- Check the installed ONNX version with `python -c "import onnx; print(onnx.__version__)"`; versions from `1.4.0` up to but not including `1.22.0` are affected
- Look for model loading of untrusted ONNX files in your pipelines and services

## Fix

- Upgrade the onnx package to `1.22.0` or later
- Only load ONNX models from trusted sources until upgraded

## Timeline

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

## From the sources

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.

---

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