SourcelessFileLoader does not use io.open_code()
CVE-2026-2297Published 4 Mar 2026, 22:10 UTC
Real-world risk
1.3/ 10Low
Routine
If the vulnerable configuration applies to you: 3.0
PreliminaryFrom the CVSS vector only · confidence low
CVSS
5.7
scored by the vendor (CNA), CVSS 4.0
In plain words
No plain-language summary yet. The original description is below.
Original description (from PSF)
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.
Am I affected?
| Product | Affected versions (from the sources) | Fixed in |
|---|---|---|
| CPythonUbiquitous | < 3.10.21; >= 3.11.0, < 3.11.16; >= 3.12.0, < 3.12.14; >= 3.13.0, < 3.13.13; >= 3.14.0, < 3.14.4; >= 3.15.0a1, < 3.15.0a7 | 3.10.21, 3.11.16, 3.12.14, 3.13.13, 3.14.4, 3.15.0a7 |
What to do
Update to a fixed version: 3.10.21, 3.11.16, 3.12.14, 3.13.13, 3.14.4, 3.15.0a7.
Why this score
| Factor | Value | Evidence | × |
|---|---|---|---|
| Impact | Major data tamperingWrites or changes important data without gaining execution | From the CVSS vector | 0.70 |
| Attacker position | LocalMust already run code or have a shell on the machine | From the CVSS vector | 0.50 |
| Privileges needed | LowA real low-privileged account | From the CVSS vector | 1.00 |
| Victim interaction | NoneNothing | From the CVSS vector | 1.00 |
| Configuration | UncommonNeeds a non-default feature that a minority enables | From the CVSS vector | 0.45 |
| Reliability | ReliableDeterministic: injection, logic bug, path traversal | From the CVSS vector | 1.00 |
Threat level T1: Nothing known (× 0.85)
The default for a new disclosure
EPSS 0.2% chance of exploitation in 30 days (percentile 12), as of 2026-12-03.
The arithmetic
- Prerequisites multiplied together0.225
- Threat T1: Nothing known0.850
- 10 × impact 0.7 × prerequisites 0.225 × threat 0.851.339
- Rounded to one decimal between 0.1 and 101.3
Exploitation and evidence timeline
- 4 Mar 2026 Published
- 3 Dec 2026 Risk 1.3 (cvss fallback)
Weakness
CWE-668
References
- https://github.com/python/cpython/issues/145506issue-tracking
- https://github.com/python/cpython/pull/145507patch
- https://github.com/python/cpython/commit/482d6f8bdba9da3725d272e8bb4a2d25fb6a603epatch
- https://github.com/python/cpython/commit/a51b1b512de1d56b3714b65628a2eae2b07e535epatch
- https://github.com/python/cpython/commit/e58e9802b9bec5cdbf48fc9bf1da5f4fda482e86patch
- https://github.com/python/cpython/commit/69ddd9bb2cc4bd69b1565647c18659c6a789ccd9patch
- https://github.com/python/cpython/commit/876858c9f65d9ab656c7fa639f268ce7856d89ddpatch
- https://github.com/python/cpython/commit/c70adad78caeeea33f92f560ecb93331ca11bf66patch
- http://www.openwall.com/lists/oss-security/2026/03/05/6
- CVE-2026-2297 on CVE.org