Skip to main content

CPython CVE-2026-2297

MEDIUM
Exposure of Resource to Wrong Sphere (CWE-668)
2026-03-04 cna@python.org
5.7
CVSS 4.0 · Vendor: python
Share

Severity by source

Vendor (python) PRIMARY
5.7 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
vuln.today AI
4.7 MEDIUM

Local vector with AC:H captures the AT:P pre-condition (audit hooks must be deployed); PR:L reflects minimum local privileges; I:H for security-control bypass enabling unauthorized code execution.

3.1 AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N
4.0 AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
SUSE
5.5 MEDIUM
AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
Red Hat
3.3 LOW
qualitative

Primary rating from Vendor (python).

CVSS VectorVendor: python

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
X

Lifecycle Timeline

5
Source Code Evidence Fetched
Jul 24, 2026 - 08:24 vuln.today
CVSS changed
May 01, 2026 - 16:22 NVD
5.7 (MEDIUM)
Analysis Generated
Mar 12, 2026 - 22:05 vuln.today
CVE Published
Mar 04, 2026 - 23:16 cve.org
MEDIUM 5.7
CVE Published
Mar 04, 2026 - 23:16 nvd
N/A

DescriptionCVE.org

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.

AnalysisAI

CPython's import subsystem silently bypasses sys.audit security hooks when loading legacy precompiled .pyc files via SourcelessFileLoader, because the base class FileLoader omits SourcelessFileLoader from the isinstance check that gates calls to io.open_code(). Environments relying on PEP 578 audit hooks for security monitoring or enforcement are therefore blind to .pyc file loads through this path, allowing unauthorized bytecode to execute without triggering registered handlers. No public exploit has been identified at time of analysis and EPSS is negligible (0.02%, 3rd percentile), but the CVSS 4.0 vector assigns VI:H reflecting the integrity consequence of bypassing an active security control.

Technical ContextAI

The flaw resides in Lib/importlib/_bootstrap_external.py, specifically in FileLoader - the abstract base class for CPython's file-based module loaders. SourcelessFileLoader is the concrete loader used to import precompiled .pyc bytecode files that have no corresponding .py source counterpart. FileLoader.get_filename() contains an isinstance guard that determines whether to call io.open_code() (the audited file-open function introduced by PEP 578), but prior to the fix that guard tested only for SourceLoader and ExtensionFileLoader, leaving SourcelessFileLoader uncovered. The fix (commit 482d6f8) adds SourcelessFileLoader to the isinstance tuple, restoring the audit event for all loader types. CWE-668 (Exposure of Resource to Wrong Sphere) accurately describes the root cause: the .pyc resource enters the runtime through an unaudited channel, sidestepping the security boundary that io.open_code() was designed to enforce.

Affected ProductsAI

CPython, the reference Python interpreter, is affected across multiple maintained release branches. Five distinct commits (482d6f8bdba9, a51b1b512de1, e58e9802b9be, 69ddd9bb2cc4, 876858c9f65d) in the CPython GitHub repository address the issue across parallel branches, implying at least five active release lines are patched. Red Hat has confirmed impact and issued patched packages under advisories RHSA-2026:10950, RHSA-2026:7443, RHSA-2026:7661, RHSA-2026:8822, and RHSA-2026:8824. SUSE has issued SUSE-SU-2026:0971. Exact affected version floor is not enumerated in available data; affected versions are inferred from the scope of backport commits across CPython branches.

RemediationAI

The primary fix is to upgrade CPython to a version incorporating the upstream patches, available in the CPython repository via commits 482d6f8bdba9, a51b1b512de1, e58e9802b9be, 69ddd9bb2cc4, and 876858c9f65d (https://github.com/python/cpython/pull/145507). Red Hat users should apply whichever of RHSA-2026:10950, RHSA-2026:7443, RHSA-2026:7661, RHSA-2026:8822, or RHSA-2026:8824 corresponds to their platform (https://access.redhat.com/errata/). SUSE users should apply SUSE-SU-2026:0971 (https://www.suse.com/support/update/SUSE-SU-2026:0971/). Where immediate patching is not feasible and audit hooks are in use for security enforcement, a targeted compensating control is to replace or wrap SourcelessFileLoader with a custom loader that calls io.open_code() explicitly before delegating to the parent; this preserves audit semantics without disabling .pyc imports entirely. Disabling .pyc imports entirely is an option only if the application does not depend on sourceless bytecode distribution, and carries a performance trade-off from always recompiling from source.

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
Container suse/multi-linux-manager/5.1/x86_64/proxy-salt-broker:5.1.3.9.16.1 Container suse/multi-linux-manager/5.1/x86_64/server:5.1.3.8.16.1 Image SLES15-SP6 Image SLES15-SP6-EC2 Image SLES15-SP6-EC2-ECS-HVM Image SLES15-SP6-SAP Image SLES15-SP6-SAP-EC2 Image SLES15-SP6-SAPCAL Image SLES15-SP6-SAPCAL-EC2 Image SLES15-SP7-Azure-3P Image SLES15-SP7-Azure-Basic Image SLES15-SP7-Azure-Standard Image SLES15-SP7-BYOS-Azure Image SLES15-SP7-BYOS-EC2 Image SLES15-SP7-BYOS-GCE Image SLES15-SP7-EC2 Image SLES15-SP7-EC2-ECS-HVM Image SLES15-SP7-Hardened-BYOS-Azure Image SLES15-SP7-Hardened-BYOS-EC2 Image SLES15-SP7-Hardened-BYOS-GCE Image SLES15-SP7-SAPCAL-Azure Image SLES15-SP7-SAPCAL-EC2 Affected
Container suse/multi-linux-manager/5.1/x86_64/server-saline:5.1.3.9.16.1 Affected
Container suse/sl-micro/6.0/baremetal-os-container:2.1.3-6.112 Image SLE-Micro Image SLE-Micro-Azure Image SLE-Micro-BYOS Image SLE-Micro-BYOS-Azure Image SLE-Micro-BYOS-EC2 Image SLE-Micro-BYOS-GCE Image SLE-Micro-EC2 Image SLE-Micro-GCE Affected
Container suse/sl-micro/6.0/toolbox:latest Affected
Container suse/sl-micro/6.1/baremetal-os-container:2.2.1-7.81 Image SUSE-Multi-Linux-Manager-Proxy-BYOS-EC2 Image SUSE-Multi-Linux-Manager-Server-BYOS-EC2 Affected

Share

CVE-2026-2297 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy