GHSA-486p-g8x4-77mg
Duplicate Advisory: ONNX: TOCTOU arbitrary file read/write in save_external_dat
Summary
## Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-q56x-g2fj-4rj6. This link is maintained to preserve external references. ## Original Description In ONNX before 1.21.0, the 'save_external_data' function builds the external-data file path from the model's external_data location field and opens it for writing without 'O_NOFOLLOW/O_EXCL', after a non-atomic 'os.path.isfile()' check. A local attacker with write access to the directory where a victim serializes external data can deterministically pre-plant a symlink that is being followed, causing the victim's write to append to any file the victim can write, e.g. ~/.ssh/authorized_keys, cron files, or application configs. Fixed in 1.21.0.
Affected packages
| Ecosystem | Package | Affected versions | Fixed versions |
|---|---|---|---|
| PyPI | onnx | — | — |
Remediation: No patched version is listed by GitHub.
References
Includes data from the GitHub Advisory Database, licensed under CC-BY 4.0.