# CVE-2026-2297: SourcelessFileLoader does not use io.open_code()

- Severity: Medium 5.7 (CVSS:4.0, scored by PSF) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 12% of CVEs (2026-12-02)
- Published: 2026-03-04T22:10:43.297Z
- Modified: 2026-11-24T18:18:21.813Z
- Also known as: PSF-2026-9, BIT-LIBPYTHON-2026-2297, BIT-PYTHON-2026-2297, BIT-PYTHON-MIN-2026-2297
- Weaknesses: CWE-668
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: PSF

## 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.

(As written by CVE List.)

## Affected

- Python Software Foundation CPython: before 3.10.21; from 3.11.0 before 3.11.16; from 3.12.0 before 3.12.14; from 3.13.0 before 3.13.13; from 3.14.0 before 3.14.4; from 3.15.0a1 before 3.15.0a7
- https://github.com/python/cpython: before 482d6f8bdba9da3725d272e8bb4a2d25fb6a603e; before a51b1b512de1d56b3714b65628a2eae2b07e535e; before e58e9802b9bec5cdbf48fc9bf1da5f4fda482e86; before 69ddd9bb2cc4bd69b1565647c18659c6a789ccd9; before 876858c9f65d9ab656c7fa639f268ce7856d89dd; before c70adad78caeeea33f92f560ecb93331ca11bf66
- python python: before 3.10.21; from 3.11.0 before 3.11.16; from 3.13.0 before 3.13.13; from 3.14.0 before 3.14.4; 3.15.0
- libpython (Bitnami): before 3.15.0
- python (Bitnami): before 3.15.0
- python-min (Bitnami): before 3.15.0

## Every score

- PSF: CVSS:4.0 5.7 Medium `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`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://github.com/python/cpython/issues/145506> (issue-tracking, report, vendor-advisory, web)
- <https://github.com/python/cpython/pull/145507> (issue-tracking, patch, vendor-advisory, web)
- <https://github.com/python/cpython/commit/482d6f8bdba9da3725d272e8bb4a2d25fb6a603e> (fix, patch, web)
- <https://github.com/python/cpython/commit/a51b1b512de1d56b3714b65628a2eae2b07e535e> (fix, patch, web)
- <https://github.com/python/cpython/commit/e58e9802b9bec5cdbf48fc9bf1da5f4fda482e86> (fix, patch, web)
- <https://github.com/python/cpython/commit/69ddd9bb2cc4bd69b1565647c18659c6a789ccd9> (fix, patch)
- <https://github.com/python/cpython/commit/876858c9f65d9ab656c7fa639f268ce7856d89dd> (fix, patch)
- <https://github.com/python/cpython/commit/c70adad78caeeea33f92f560ecb93331ca11bf66> (fix, patch)
- <http://www.openwall.com/lists/oss-security/2026/03/05/6> (mailing-list, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-2297> (web)

## Sources

- CVE List: [CVE-2026-2297](https://www.cve.org/CVERecord?id=CVE-2026-2297), CVE Terms of Use, modified 2026-08-13
- Python Software Foundation: [PSF-2026-9](https://osv.dev/vulnerability/PSF-2026-9), CC-BY-4.0, modified 2026-08-05
- NVD: [CVE-2026-2297](https://nvd.nist.gov/vuln/detail/CVE-2026-2297), Public domain, modified 2026-11-24
- Bitnami Vulnerability Database: [BIT-LIBPYTHON-2026-2297](https://osv.dev/vulnerability/BIT-LIBPYTHON-2026-2297), Apache-2.0, modified 2026-03-27
- Bitnami Vulnerability Database: [BIT-PYTHON-2026-2297](https://osv.dev/vulnerability/BIT-PYTHON-2026-2297), Apache-2.0, modified 2026-03-27
- Bitnami Vulnerability Database: [BIT-PYTHON-MIN-2026-2297](https://osv.dev/vulnerability/BIT-PYTHON-MIN-2026-2297), Apache-2.0, modified 2026-03-27

---

Page: https://cve.day/CVE-2026-2297 · Whole record: https://cve.day/CVE-2026-2297.json · Rebuilt by cve.day 2026-11-25T22:59:15.234Z
