Skip to content
5.7 Medium

CVE-2026-2297 The import hook in CPython that handles legacy *.pyc files (SourcelessFileLoader) is incorrectly handled in FileLoader…

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 products and versions

Product Affected versions Fixed in
CPython 3.15 3.15.0a1 → < 3.15.0a7 3.15.0a7
CPython 3.14 3.14.0 → < 3.14.4 3.14.4
CPython 3.13 3.13.0 → < 3.13.13 3.13.13
CPython 3.12 3.12.0 → < 3.12.14 3.12.14
CPython 3.11 3.11.0 → < 3.11.16 3.11.16
CPython 3.10 earliest → < 3.10.21 3.10.21
The 80 CVEs of CPython →
Track this CVE