Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-2297: Vulnerability in Python Software Foundation CPython

0
Medium
VulnerabilityCVE-2026-2297cvecve-2026-2297
Published: Wed Mar 04 2026 (03/04/2026, 22:10:43 UTC)
Source: CVE Database V5
Vendor/Project: Python Software Foundation
Product: 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.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 04/07/2026, 22:40:58 UTC

Technical Analysis

The vulnerability in CPython concerns the handling of legacy .pyc files by the import hook mechanism. Specifically, the FileLoader base class incorrectly processes these files by not utilizing io.open_code() for reading, which prevents sys.audit handlers from firing during this import event. This issue impacts CPython versions including 0, 3.14.0, and 3.15.0a1. The CVSS 4.0 score is 5.7 (medium severity), indicating a local attack vector with low complexity, requiring partial privileges, no user interaction, and resulting in high impact on integrity but no impact on confidentiality or availability.

Potential Impact

The vulnerability causes sys.audit handlers not to trigger when legacy .pyc files are imported, potentially reducing the effectiveness of auditing and monitoring mechanisms that rely on these handlers. There is no direct impact on confidentiality or availability, but integrity could be affected if malicious .pyc files are loaded without proper audit logging. No known exploits are reported in the wild.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Since no patch links or official fixes are provided, users should monitor Python Software Foundation advisories for updates. Until a fix is available, consider additional monitoring or controls around the use of legacy .pyc files and audit configurations.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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: 3/4/2026, 10:18:20 PM

Last enriched: 4/7/2026, 10:40:58 PM

Last updated: 4/18/2026, 9:52:49 AM

Views: 366

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses