Advisory

GHSA-538c-55jv-c5g9

Also known as: CVE-2026-34445, PYSEC-2026-2240

Summary

ONNX: Malicious ONNX models can crash servers by exploiting unprotected object settings.

Details

Summary
The ExternalDataInfo class in ONNX was using Python’s setattr() function to load metadata (like file paths or data lengths) directly from an ONNX model file. The problem? It didn’t check if the "keys" in the file were valid. Because it blindly trusted the file, an attacker could craft a malicious model that overwrites internal object properties.

Why its Dangerous
Instant Crash DoS: An attacker can set the length property to a massive number like 9 petabytes. When the system tries to load the model, it attempts to allocate all that RAM at once, causing the server to crash or freeze Out of Memory.

Access Bypass: By setting a negative offset -1, an attacker can trick the system into reading parts of a file it wasn't supposed to touch.

Object Corruption: Attackers can even inject "dunder" attributes like __class__ to change the object's type entirely, which could lead to more complex exploits.

Fixed: https://github.com/onnx/onnx/pull/7751 object state corruption and DoS via ExternalDataInfo attribute injection

Severity

High Basis: The source's own band: HIGH

Dates

Published
2026-04-01 21:10 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

onnx

PyPI · All systems

Affected

  • introduced 0, fixed 1.21.0 (ecosystem)

Fixed versions

1.21.0

Fix

  • Fixed version 1.21.0
    pip install --upgrade onnx==1.21.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences