All vulnerabilities

PyPI

CVE-2026-115921

ONNX: Null Pointer Dereference in ScanInferenceFunction Due to Missing Required Attribute

Severity
Medium 6.2
Published
28 Oct 2026
Last changed
28 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
1.22.0
Exploit chance
0.1% in the next 30 daysHigher than 2% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
CWE-195Null pointer dereference (CWE-476)
Attack
Needs local access · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-m4pr-6v3c-6fgr
Sources
OSV.dev and GitHub

Description

ONNX shape inference did not safely validate the required Scan num_scan_inputs attribute. Two malformed values could terminate or disrupt the process:

  • If the attribute was missing, ctx.getAttribute("num_scan_inputs") returned null and was dereferenced.
  • If the attribute was negative, conversion to size_t produced a very large value that reached a vector allocation and raised std::length_error.

The negative-value variant passed onnx.checker.check_model() before reaching shape inference.

The vulnerable Scan inference implementations used the following pattern:

This 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.

The fix uses the required-attribute helper and checked narrowing:

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
onnxPyPI · osv:PyPI:onnx
  • From 1.4.0 before 1.22.0

About onnx

Weekly downloads (PyPI)
4,009,268PyPI Stats, 23 Nov 2026

References