{"id":"CVE-2026-31214","details":"The torch-checkpoint-shrink.py script in the ml-engineering project in commit 0099885db36a8f06556efe1faf552518852cb1e0 (2025-20-27) contains an insecure deserialization vulnerability (CWE-502). The script uses torch.load() to process PyTorch checkpoint files (.pt) without enabling the security-restrictive weights_only=True parameter. This oversight allows the deserialization of arbitrary Python objects via the pickle module. A remote attacker can exploit this by providing a maliciously crafted checkpoint file, leading to arbitrary code execution in the context of the user running the script.","modified":"2026-10-28T02:30:42.810655653Z","published":"2026-05-12T00:00:00Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31214.json","cna_assigner":"mitre"},"references":[{"type":"WEB","url":"https://github.com/stas00/ml-engineering/blob/master/training/checkpoints/torch-checkpoint-shrink.py#L57"},{"type":"WEB","url":"https://www.notion.so/CVE-2026-31214-35d1e1393188813fa40eef73c174cee5"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31214.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31214"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/stas00/ml-engineering","events":[{"introduced":"0"},{"last_affected":"0099885db36a8f06556efe1faf552518852cb1e0"}],"database_specific":{"extracted_events":[{"range":[{"introduced":"0"},{"last_affected":"0099885db36a8f06556efe1faf552518852cb1e0"}],"source":"DESCRIPTION"}]}}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31214.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}