What’s Vulnerable › Vulnerabilities

CVE-2026-2297: SourcelessFileLoader does not use io.open_code()

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

How to fix

Upgrade to a fixed version: Python 3.10.21, 3.11.16, 3.12.14, 3.13.13. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2026-2297 or the next vulnerability affects your stack