Skip to content
HighVulnerability

GHSA-q56x-g2fj-4rj6: ONNX: TOCTOU arbitrary file read/write in save_external_dat

Published
Record updated
View JSON
Affected
  • onnx <= 1.20.1
Fixed in
1.21.0
  • released March 27, 2026, 5 days before disclosure

Summary

The ONNX save_external_data method in onnx/external_data_helper.py is reported to contain a local TOCTOU flaw, enabling arbitrary file read and write. Between os.path.isfile and open, the code creates no atomic file and does not use O_NOFOLLOW, so an attacker can swap in a symlink and overwrite victim files under the same privilege scope. A possible path validation bypass on Windows, using absolute paths such as C:\ with a single path part, is described but not verified by the reporter.

Mitigation

The source does not state a fix yet. Check the original advisory for updates.