CVE-2026-2297: Vulnerability in Python Software Foundation CPython
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.
AI Analysis
Technical Summary
The vulnerability in CPython arises because the import hook that manages legacy .pyc files (SourcelessFileLoader) is incorrectly implemented in its base class FileLoader. Specifically, FileLoader does not utilize io.open_code() when reading .pyc files, which results in sys.audit events for this operation not being triggered. This flaw affects the auditing mechanism rather than the core loading functionality itself.
Potential Impact
The impact is limited to the failure of sys.audit handlers to fire during the reading of legacy .pyc files. This could reduce the effectiveness of auditing and monitoring systems relying on these events to detect or log import activities. There is no indication of direct code execution or privilege escalation from this vulnerability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or patch links are provided at this time. Users should monitor Python Software Foundation advisories for updates and consider additional auditing or monitoring controls to compensate for this gap until a fix is available.
CVE-2026-2297: Vulnerability in Python Software Foundation CPython
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.
CVSS v4.0
Score 5.7medium
Affected software
Python Software Foundation
CPython
pkg:github/python/cpythonpkg:github/CPythonRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in CPython arises because the import hook that manages legacy .pyc files (SourcelessFileLoader) is incorrectly implemented in its base class FileLoader. Specifically, FileLoader does not utilize io.open_code() when reading .pyc files, which results in sys.audit events for this operation not being triggered. This flaw affects the auditing mechanism rather than the core loading functionality itself.
Potential Impact
The impact is limited to the failure of sys.audit handlers to fire during the reading of legacy .pyc files. This could reduce the effectiveness of auditing and monitoring systems relying on these events to detect or log import activities. There is no indication of direct code execution or privilege escalation from this vulnerability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or patch links are provided at this time. Users should monitor Python Software Foundation advisories for updates and consider additional auditing or monitoring controls to compensate for this gap until a fix is available.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- PSF
- Date Reserved
- 2026-02-10T16:26:08.298Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 69a8afacd1a09e29cb7ac729
Added to database: 03/04/2026, 22:18:20 UTC
Last enriched: 08/13/2026, 13:09:14 UTC
Last updated: 09/14/2026, 22:01:33 UTC
Views: 679
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.