# CVE-2026-2297: SourcelessFileLoader does not use io.open\_code()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.7
- **CVSS:** 5.7 (v4.0, CNA) `CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Attack requirements: Present; Privileges required: Low; User interaction: None; Confidentiality impact: None; Integrity impact: High; Availability impact: None; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.22% (percentile 7, 2026-11-26)
- **CWE:** CWE-668
- **Published:** 2026-03-04T22:10:43.297Z
- **Modified:** 2026-11-24T18:18:21.813Z

## Who should check

- Anyone running Python Software Foundation CPython \< 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

## Description

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.

## Affected and fixed versions

- Python Software Foundation CPython: \< 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 (cvelist)

## Mitigation

- Upgrade CPython to 3.15.0a7 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-2297. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-2297.md
Affected: Python Software Foundation CPython < 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
Fixed in: Python Software Foundation CPython 3.10.21, Python Software Foundation CPython 3.11.16, Python Software Foundation CPython 3.12.14, Python Software Foundation CPython 3.13.13, Python Software Foundation CPython 3.14.4, Python Software Foundation CPython 3.15.0a7

Steps:
1. Search this machine and project for Python Software Foundation CPython: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-2297 being exploited?

There is no confirmed exploitation: CVE-2026-2297 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.22% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-2297?

Medium: CVSS 5.7 (v4.0, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-2297?

Python Software Foundation CPython \< 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.

### Is there a fix for CVE-2026-2297?

Yes. Fixed in Python Software Foundation CPython 3.10.21, Python Software Foundation CPython 3.11.16, Python Software Foundation CPython 3.12.14, Python Software Foundation CPython 3.13.13, Python Software Foundation CPython 3.14.4, Python Software Foundation CPython 3.15.0a7. Upgrade CPython to 3.15.0a7 or later.

### How do I check if I'm affected by CVE-2026-2297?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/python/cpython/issues/145506>
- patch: <https://github.com/python/cpython/pull/145507>
- patch: <https://github.com/python/cpython/commit/482d6f8bdba9da3725d272e8bb4a2d25fb6a603e>
- patch: <https://github.com/python/cpython/commit/a51b1b512de1d56b3714b65628a2eae2b07e535e>
- patch: <https://github.com/python/cpython/commit/e58e9802b9bec5cdbf48fc9bf1da5f4fda482e86>
- patch: <https://github.com/python/cpython/commit/69ddd9bb2cc4bd69b1565647c18659c6a789ccd9>
- patch: <https://github.com/python/cpython/commit/876858c9f65d9ab656c7fa639f268ce7856d89dd>
- patch: <https://github.com/python/cpython/commit/c70adad78caeeea33f92f560ecb93331ca11bf66>
- other: <http://www.openwall.com/lists/oss-security/2026/03/05/6>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-2297>

HTML: <https://flawdb.com/CVE-2026-2297> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-2297>
