CVE-2026-2297

SourcelessFileLoader does not use io.open_code()

State
Published
Severity
5.7 Medium
Published
Mar 4, 2026
Updated
Aug 13, 2026
Reserved
Feb 10, 2026

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
4.05.7 MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:NPSF

Weaknesses

  • CWE-668 Exposure of Resource to Wrong Sphere

Affected Products

ProductVersions
CPythonPython Software Foundation
  • before 3.10.21Affected
  • 3.11.0 to before 3.11.16Affected
  • 3.12.0 to before 3.12.14Affected
  • 3.13.0 to before 3.13.13Affected
  • 3.14.0 to before 3.14.4Affected
  • 3.15.0a1 to before 3.15.0a7Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.