CVE-2026-2297
CVE-2026-2297 · SourcelessFileLoader does not use io.open_code()
This page contains facts from public vulnerability sources. Check the original advisory before updating.
The import hook in CPython that handles legacy *.pyc files (SourcelessFileLoader) is incorrectly handled in FileLoader (a base class) and so does not use io.open_code() to read the .pyc files. sys.audit handlers for this audit event therefore do not fire.
CVSS 5.7 · Medium · EPSS 0.2% · Fix available
- Published
- Updated
Affected products and versions
python
- Versions
- ≥ 0, < 3.10.21: Affected (python)
- ≥ 3.11.0, < 3.11.16: Affected (python)
- ≥ 3.12.0, < 3.12.14: Affected (python)
- ≥ 3.13.0, < 3.13.13: Affected (python)
- ≥ 3.14.0, < 3.14.4: Affected (python)
- ≥ 3.15.0a1, < 3.15.0a7: Affected (python)
Update to 3.10.21; Update to 3.11.16; Update to 3.12.14; Update to 3.13.13; Update to 3.14.4; Update to 3.15.0a7
pypy3 Debian:12
- Versions
- 7.3.11+dfsg-2
- 7.3.11+dfsg-2+deb12u1
- 7.3.11+dfsg-2+deb12u2
- 7.3.11+dfsg-2+deb12u3
- 7.3.12+dfsg-1
- 7.3.12~rc1+dfsg-1
- 7.3.12~rc2+dfsg-1
- 7.3.13+dfsg-1
- 7.3.14+dfsg-1
- 7.3.15+dfsg-1
- 7.3.16+dfsg-1
- 7.3.16+dfsg-2
- 7.3.17+dfsg-1
- 7.3.17+dfsg-2
- 7.3.17+dfsg-3
- 7.3.18+dfsg-1
- 7.3.18+dfsg-2
- 7.3.19+dfsg-1
- 7.3.19+dfsg-2
- 7.3.20+dfsg-1
- 7.3.20+dfsg-2
- 7.3.20+dfsg-3
- 7.3.20+dfsg-4
- 7.3.21+dfsg-1
- 7.3.21+dfsg-2
- 7.3.21+dfsg-3
- 7.3.21+dfsg-4
- 7.3.22+dfsg-1
- 7.3.23+dfsg-1
- 7.3.23+dfsg-2
- 8.0.0+dfsg-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
pypy3 Debian:13
- Versions
- 7.3.19+dfsg-2
- 7.3.20+dfsg-1
- 7.3.20+dfsg-2
- 7.3.20+dfsg-3
- 7.3.20+dfsg-4
- 7.3.21+dfsg-1
- 7.3.21+dfsg-2
- 7.3.21+dfsg-3
- 7.3.21+dfsg-4
- 7.3.22+dfsg-1
- 7.3.23+dfsg-1
- 7.3.23+dfsg-2
- 8.0.0+dfsg-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
pypy3 Debian:14
- Versions
- 7.3.19+dfsg-2
- 7.3.20+dfsg-1
- 7.3.20+dfsg-2
- 7.3.20+dfsg-3
- 7.3.20+dfsg-4
- 7.3.21+dfsg-1
- 7.3.21+dfsg-2
- 7.3.21+dfsg-3
- 7.3.21+dfsg-4
- Affected ranges
- ECOSYSTEM: < 7.3.22+dfsg-1
Update to 7.3.22+dfsg-1
python3.11 Debian:12
- Versions
- 3.11.2-6
- 3.11.2-6+deb12u1
- 3.11.2-6+deb12u2
- 3.11.2-6+deb12u3
- 3.11.2-6+deb12u4
- 3.11.2-6+deb12u5
- 3.11.2-6+deb12u6
- 3.11.2-6+deb12u7
- Affected ranges
- ECOSYSTEM: < 3.11.2-6+deb12u8
Update to 3.11.2-6+deb12u8
python3.13 Debian:13
- Versions
- 3.13.5-2
- Affected ranges
- ECOSYSTEM: < 3.13.5-2+deb13u1
Update to 3.13.5-2+deb13u1
python3.13 Debian:14
- Versions
- 3.13.11-1
- 3.13.12-1
- 3.13.5-2
- 3.13.6-1
- 3.13.7-1
- 3.13.8-1
- 3.13.9-1
- Affected ranges
- ECOSYSTEM: < 3.13.14-1
Update to 3.13.14-1
python3.14 Debian:14
- Versions
- 3.14.0-1
- 3.14.0-2
- 3.14.0-3
- 3.14.0-4
- 3.14.0-5
- 3.14.0~a7-1
- 3.14.0~b1-1
- 3.14.0~b2-1
- 3.14.0~b3-1
- 3.14.0~b4-1
- 3.14.0~rc1-1
- 3.14.0~rc2-1
- 3.14.0~rc3-1
- 3.14.2-1
- 3.14.3-1
- 3.14.3-2
- 3.14.3-3
- Affected ranges
- ECOSYSTEM: < 3.14.3-4
Update to 3.14.3-4
python3.8 Ubuntu:Pro:18.04:LTS
- Versions
- 3.8.0-3~18.04
- 3.8.0-3~18.04.1
- 3.8.0-3ubuntu1~18.04.2
- 3.8.0-3ubuntu1~18.04.2+esm1
- 3.8.0-3ubuntu1~18.04.2+esm2
- 3.8.0-3ubuntu1~18.04.2+esm3
- 3.8.0-3ubuntu1~18.04.2+esm4
- 3.8.0-3ubuntu1~18.04.2+esm5
- 3.8.0-3ubuntu1~18.04.2+esm6
- 3.8.0-3ubuntu1~18.04.2+esm7
- 3.8.0-3ubuntu1~18.04.2+esm8
- 3.8.0-3ubuntu1~18.04.2+esm9
- 3.8.0-3ubuntu1~18.04.2+esm10
- 3.8.0-3ubuntu1~18.04.2+esm11
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
python3.8 Ubuntu:Pro:20.04:LTS
- Versions
- 3.8.0-1
- 3.8.0-2
- 3.8.0-3
- 3.8.0-4
- 3.8.0-5
- 3.8.1-2ubuntu3
- 3.8.2~rc1-1ubuntu1
- 3.8.2-1
- 3.8.2-1ubuntu1
- 3.8.2-1ubuntu1.1
- 3.8.2-1ubuntu1.2
- 3.8.5-1~20.04
- 3.8.5-1~20.04.2
- 3.8.5-1~20.04.3
- 3.8.10-0ubuntu1~20.04
- 3.8.10-0ubuntu1~20.04.1
- 3.8.10-0ubuntu1~20.04.2
- 3.8.10-0ubuntu1~20.04.4
- 3.8.10-0ubuntu1~20.04.5
- 3.8.10-0ubuntu1~20.04.6
- 3.8.10-0ubuntu1~20.04.7
- 3.8.10-0ubuntu1~20.04.8
- 3.8.10-0ubuntu1~20.04.9
- 3.8.10-0ubuntu1~20.04.10
- 3.8.10-0ubuntu1~20.04.11
- 3.8.10-0ubuntu1~20.04.12
- 3.8.10-0ubuntu1~20.04.13
- 3.8.10-0ubuntu1~20.04.14
- 3.8.10-0ubuntu1~20.04.15
- 3.8.10-0ubuntu1~20.04.16
- 3.8.10-0ubuntu1~20.04.17
- 3.8.10-0ubuntu1~20.04.18
- 3.8.10-0ubuntu1~20.04.18+esm1
- 3.8.10-0ubuntu1~20.04.18+esm2
- 3.8.10-0ubuntu1~20.04.18+esm3
- 3.8.10-0ubuntu1~20.04.18+esm4
- 3.8.10-0ubuntu1~20.04.18+esm5
- 3.8.10-0ubuntu1~20.04.18+esm6
- 3.8.10-0ubuntu1~20.04.18+esm7
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
python3.9 Ubuntu:Pro:20.04:LTS
- Versions
- 3.9.0~rc1-1~20.04
- 3.9.0-5~20.04
- 3.9.5-3~20.04.1
- 3.9.5-3ubuntu0~20.04.1
- 3.9.5-3ubuntu0~20.04.1+esm1
- 3.9.5-3ubuntu0~20.04.1+esm2
- 3.9.5-3ubuntu0~20.04.1+esm3
- 3.9.5-3ubuntu0~20.04.1+esm4
- 3.9.5-3ubuntu0~20.04.1+esm5
- 3.9.5-3ubuntu0~20.04.1+esm6
- 3.9.5-3ubuntu0~20.04.1+esm7
- 3.9.5-3ubuntu0~20.04.1+esm8
- 3.9.5-3ubuntu0~20.04.1+esm9
- 3.9.5-3ubuntu0~20.04.1+esm10
- 3.9.5-3ubuntu0~20.04.1+esm11
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
python3.10 Ubuntu:22.04:LTS
- Versions
- 3.10.0-2
- 3.10.0-3
- 3.10.0-4
- 3.10.0-5
- 3.10.0-5build1
- 3.10.1-1
- 3.10.1-2
- 3.10.2-1
- 3.10.2-5
- 3.10.2-7
- 3.10.3-1
- 3.10.4-3
- 3.10.4-3ubuntu0.1
- 3.10.6-1~22.04
- 3.10.6-1~22.04.1
- 3.10.6-1~22.04.2
- 3.10.6-1~22.04.2ubuntu1
- 3.10.6-1~22.04.2ubuntu1.1
- 3.10.12-1~22.04.2
- 3.10.12-1~22.04.3
- 3.10.12-1~22.04.4
- 3.10.12-1~22.04.5
- 3.10.12-1~22.04.6
- 3.10.12-1~22.04.7
- 3.10.12-1~22.04.8
- 3.10.12-1~22.04.9
- 3.10.12-1~22.04.10
- 3.10.12-1~22.04.11
- 3.10.12-1~22.04.12
- 3.10.12-1~22.04.13
- 3.10.12-1~22.04.14
- 3.10.12-1~22.04.15
- Affected ranges
- ECOSYSTEM: < 3.10.12-1~22.04.16
Update to 3.10.12-1~22.04.16
python3.11 Ubuntu:Pro:22.04:LTS
- Versions
- 3.11.0~rc1-1~22.04
- 3.11.0~rc1-1~22.04.1~esm1
- 3.11.0~rc1-1~22.04.1~esm2
- 3.11.0~rc1-1~22.04.1~esm3
- 3.11.0~rc1-1~22.04.1~esm4
- 3.11.0~rc1-1~22.04.1~esm5
- 3.11.0~rc1-1~22.04.1~esm6
- 3.11.0~rc1-1~22.04.1~esm7
- 3.11.0~rc1-1~22.04.1~esm8
- 3.11.0~rc1-1~22.04.1~esm9
- 3.11.0~rc1-1~22.04.1
- 3.11.0~rc1-1~22.04.1+esm1
- 3.11.0~rc1-1~22.04.1+esm2
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
python3.12 Ubuntu:24.04:LTS
- Versions
- 3.12.0-1
- 3.12.0-5
- 3.12.0-6
- 3.12.0-7
- 3.12.1-2
- 3.12.2-1
- 3.12.2-4build3
- 3.12.2-4build4
- 3.12.2-5ubuntu3
- 3.12.3-1
- 3.12.3-1ubuntu0.1
- 3.12.3-1ubuntu0.2
- 3.12.3-1ubuntu0.3
- 3.12.3-1ubuntu0.4
- 3.12.3-1ubuntu0.5
- 3.12.3-1ubuntu0.6
- 3.12.3-1ubuntu0.7
- 3.12.3-1ubuntu0.8
- 3.12.3-1ubuntu0.9
- 3.12.3-1ubuntu0.10
- 3.12.3-1ubuntu0.11
- 3.12.3-1ubuntu0.12
- 3.12.3-1ubuntu0.13
- Affected ranges
- ECOSYSTEM: < 3.12.3-1ubuntu0.15
Update to 3.12.3-1ubuntu0.15
python3.13 Ubuntu:25.10
- Versions
- 3.13.3-1
- 3.13.3-2
- 3.13.3-4
- 3.13.4-1
- 3.13.5-1
- 3.13.5-2
- 3.13.6-1
- 3.13.7-1
- 3.13.7-1ubuntu0.1
- 3.13.7-1ubuntu0.2
- 3.13.7-1ubuntu0.3
- 3.13.7-1ubuntu0.4
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
python3.14 Ubuntu:25.10
- Versions
- 3.14.0~a7-0ubuntu1
- 3.14.0~b1-1
- 3.14.0~b3-1
- 3.14.0~rc1-1
- 3.14.0~rc2-1
- 3.14.0~rc3-1
- 3.14.0-1
- 3.14.0-1ubuntu0.1
- 3.14.0-1ubuntu0.2
- 3.14.0-1ubuntu0.3
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
Original sources
- https://github.com/python/cpython/issues/145506
- https://github.com/python/cpython/pull/145507
- https://github.com/python/cpython/commit/482d6f8bdba9da3725d272e8bb4a2d25fb6a603e
- https://github.com/python/cpython/commit/a51b1b512de1d56b3714b65628a2eae2b07e535e
- https://github.com/python/cpython/commit/e58e9802b9bec5cdbf48fc9bf1da5f4fda482e86
- https://github.com/python/cpython/commit/69ddd9bb2cc4bd69b1565647c18659c6a789ccd9
- https://github.com/python/cpython/commit/876858c9f65d9ab656c7fa639f268ce7856d89dd
- https://github.com/python/cpython/commit/c70adad78caeeea33f92f560ecb93331ca11bf66
- http://www.openwall.com/lists/oss-security/2026/03/05/6
- https://nvd.nist.gov/vuln/detail/CVE-2026-2297