Browse / AI Framework and Platform Flaws / CVE-2022-45907
PyTorch vulnerable to arbitrary code execution
- Class
- AI Framework and Platform Flaws (filed by a model that read the advisory)
- Technique
- Code and command execution
- Affected
- torch (PyPI)
- CVSS
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS
- 1.3% chance of exploitation in 30 days
How it works, in short
PyTorch's parse_type_line passes type annotation text to eval, so crafted annotation input executes arbitrary Python code. (Our summary, written by a model. The source text is below.)
Details
In PyTorch before trunk/89695, torch.jit.annotations.parse_type_line can cause arbitrary code execution because eval is used unsafely. The fix for this issue is available in version 1.13.1. There is a release checker in issue #89855.
References
- https://nvd.nist.gov/vuln/detail/CVE-2022-45907
- https://github.com/pytorch/pytorch/issues/88868
- https://github.com/pytorch/pytorch/issues/89855
- https://github.com/pytorch/pytorch/pull/89189
- https://github.com/pytorch/pytorch/commit/767f6aa49fe20a2766b9843d01e3b7f7793df6a3
- https://github.com/pypa/advisory-database/tree/main/vulns/torch/PYSEC-2022-43015.yaml
- https://github.com/pytorch/pytorch
- https://github.com/pytorch/pytorch/releases/tag/v1.13.1
Source: GitHub Advisory Database, used under CC BY 4.0.