Vulnerability · Published Mar 4, 2026 · Assigned by PSF
CVE-2026-2297SourcelessFileLoader does not use io.open_code()
Medium 5.7
In plain English
A medium-severity security flaw in CPython from Python Software Foundation. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 13% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Severity (CVSS 4.0)5.7Medium
Exploit odds (30 days)0.2%top 87.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:10 | python-unversioned-command | 3.12.13-2.el10_2 | ALSA-2026:19064 |
| AlmaLinux:10 | python3 | 3.12.13-2.el10_2 | ALSA-2026:19064 |
| AlmaLinux:10 | python3-debug | 3.12.13-2.el10_2 | ALSA-2026:19064 |
| AlmaLinux:10 | python3-devel | 3.12.13-2.el10_2 | ALSA-2026:19064 |
| AlmaLinux:10 | python3-idle | 3.12.13-2.el10_2 | ALSA-2026:19064 |
| AlmaLinux:10 | python3-libs | 3.12.13-2.el10_2 | ALSA-2026:19064 |
| AlmaLinux:10 | python3-test | 3.12.13-2.el10_2 | ALSA-2026:19064 |
| AlmaLinux:10 | python3-tkinter | 3.12.13-2.el10_2 | ALSA-2026:19064 |
| AlmaLinux:8 | python3.12 | 3.12.13-2.el8_10 | ALSA-2026:10950 |
| AlmaLinux:9 | python3.12 | 3.12.13-2.el9_8 | ALSA-2026:19177 |
| AlmaLinux:8 | python3.12-debug | 3.12.13-2.el8_10 | ALSA-2026:10950 |
| AlmaLinux:9 | python3.12-debug | 3.12.13-2.el9_8 | ALSA-2026:19177 |
| AlmaLinux:8 | python3.12-devel | 3.12.13-2.el8_10 | ALSA-2026:10950 |
| AlmaLinux:9 | python3.12-devel | 3.12.13-2.el9_8 | ALSA-2026:19177 |
| AlmaLinux:8 | python3.12-idle | 3.12.13-2.el8_10 | ALSA-2026:10950 |
| AlmaLinux:9 | python3.12-idle | 3.12.13-2.el9_8 | ALSA-2026:19177 |
| AlmaLinux:8 | python3.12-libs | 3.12.13-2.el8_10 | ALSA-2026:10950 |
| AlmaLinux:9 | python3.12-libs | 3.12.13-2.el9_8 | ALSA-2026:19177 |
| AlmaLinux:8 | python3.12-rpm-macros | 3.12.13-2.el8_10 | ALSA-2026:10950 |
| AlmaLinux:8 | python3.12-test | 3.12.13-2.el8_10 | ALSA-2026:10950 |
| AlmaLinux:9 | python3.12-test | 3.12.13-2.el9_8 | ALSA-2026:19177 |
| AlmaLinux:8 | python3.12-tkinter | 3.12.13-2.el8_10 | ALSA-2026:10950 |
| AlmaLinux:9 | python3.12-tkinter | 3.12.13-2.el9_8 | ALSA-2026:19177 |
| AlmaLinux:10 | python3.14 | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14 | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-debug | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-debug | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-devel | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-devel | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-freethreading | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-freethreading | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-freethreading-debug | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-freethreading-debug | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-freethreading-devel | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-freethreading-devel | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-freethreading-idle | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-freethreading-idle | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-freethreading-libs | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-freethreading-libs | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-freethreading-test | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-freethreading-test | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-freethreading-tkinter | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-freethreading-tkinter | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-idle | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-idle | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-libs | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-libs | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-test | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-test | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| AlmaLinux:10 | python3.14-tkinter | 3.14.4-2.el10_2 | ALSA-2026:19019 |
| AlmaLinux:9 | python3.14-tkinter | 3.14.4-2.el9_8 | ALSA-2026:19176 |
| Alpine:v3.21 | python3 | 3.12.14-r0 | ALPINE-CVE-2026-2297 |
| Alpine:v3.22 | python3 | 3.12.14-r0 | ALPINE-CVE-2026-2297 |
| Alpine:v3.23 | python3 | 3.12.14-r0 | ALPINE-CVE-2026-2297 |
| Alpine:v3.24 | python3 | 3.14.5-r0 | ALPINE-CVE-2026-2297 |
| Debian:12 | pypy3 | no fix listed | DEBIAN-CVE-2026-2297 |
| Debian:13 | pypy3 | no fix listed | DEBIAN-CVE-2026-2297 |
| Debian:14 | pypy3 | 7.3.22+dfsg-1 | DEBIAN-CVE-2026-2297 |
| Debian:12 | python3.11 | 3.11.2-6+deb12u8 | DEBIAN-CVE-2026-2297 |
| Debian:13 | python3.13 | 3.13.5-2+deb13u1 | DEBIAN-CVE-2026-2297 |
| Debian:14 | python3.14 | 3.14.3-4 | DEBIAN-CVE-2026-2297 |
| Rocky Linux:10 | python3.12 | 0:3.12.13-2.el10_2 | RLSA-2026:19064 |
| Rocky Linux:8 | python3.12 | 0:3.12.13-2.el8_10 | RLSA-2026:10950 |
| Rocky Linux:9 | python3.12 | 0:3.12.13-2.el9_8 | RLSA-2026:19177 |
| Rocky Linux:10 | python3.14 | 0:3.14.4-2.el10_2 | RLSA-2026:19019 |
| Rocky Linux:9 | python3.14 | 0:3.14.4-2.el9_8 | RLSA-2026:19176 |
| Ubuntu:22.04:LTS | python3.10 | 3.10.12-1~22.04.16 | USN-8509-1 |
| Ubuntu:22.04:LTS | python3.10 | 3.10.12-1~22.04.16 | UBUNTU-CVE-2026-2297 |
| Ubuntu:24.04:LTS | python3.12 | 3.12.3-1ubuntu0.15 | USN-8509-1 |
| Ubuntu:24.04:LTS | python3.12 | 3.12.3-1ubuntu0.15 | UBUNTU-CVE-2026-2297 |
| Ubuntu:25.10 | python3.13 | no fix listed | UBUNTU-CVE-2026-2297 |
| Ubuntu:25.10 | python3.14 | no fix listed | UBUNTU-CVE-2026-2297 |
| Ubuntu:26.04:LTS | python3.14 | 3.14.4-1ubuntu0.1 | USN-8509-1 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Python Software Foundation | CPython | 0 – before 3.10.213.11.0 – before 3.11.163.12.0 – before 3.12.143.13.0 – before 3.13.133.14.0 – before 3.14.43.15.0a1 – before 3.15.0a7 |
Weakness: CWE-668 · Vector: 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
References
- https://github.com/python/cpython/issues/145506 issue-tracking
- 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 patch
- http://www.openwall.com/lists/oss-security/2026/03/05/6