CPython >3.11 Insecure Input Validation resulting in privilege escalation (CVE-2026-12003)
Published Last modified Sources: Red Hat, BSI, OSV, CVE.org, Msrc Update Guide
What is affected, what to do
To allow builds of Python to be run from an in-tree layout (rather than an installed file layout), the VPATH variable is defined at build time and used to locate certain landmarks - specifically, Modules/setup.local. When this landmark is found relative to VPATH relative to the executable, Python assumes it is running in a source tree and generates a different default sys.path.
Update Python Software Foundation CPython to version 3.11.16, Python Software Foundation CPython to version 3.12.14, Python Software Foundation CPython to version 3.13.15.
- Affected
- Python Software Foundation CPython
lt *..3.11.16 - Python Software Foundation CPython
lt 3.12.0..3.12.14 - Python Software Foundation CPython
lt 3.13.0..3.13.15 - Python Software Foundation CPython
lt 3.14.0..3.14.7 - Python Software Foundation CPython
lt 3.15.0a1..3.15.0b3
- Python Software Foundation CPython
- Fixed in
- Python Software Foundation CPython
3.11.16 - Python Software Foundation CPython
3.12.14 - Python Software Foundation CPython
3.13.15 - Python Software Foundation CPython
3.14.7 - Python Software Foundation CPython
3.15.0b3
- Python Software Foundation CPython
Not sure whether and how you are affected? Ask a question about this vulnerability
Metrics
5.3
Priority
XIEM Effective CVSS: highest available CVSS rating from NVD and vendor data.
Source: NVD, CVSS v4
5.3
CVSS v4
Severity Medium on the scale from 0 to 10.
Source: Red Hat, BSI, OSV, CVE.org, Msrc Update Guide
0.1 %
EPSS score
Low — model estimates < 1% exploitation likelihood.
Source: FIRST EPSS, percentile 3.5
Show all metrics
- Severity
- Medium
Priority (0–325)
The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?
Read in glossary- 45.48 Methodology
Exploit maturity
An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.
Read in glossary- no public PoC known
XIEM Effective CVSS
XIEM® is the tiered managed-security operating model from NEOSEC and a registered trademark of NEOSEC GmbH. It extends classic SIEM — the central collection, normalisation and correlation of security-relevant events — with endpoint forensics, network visibility and deception technology, and consolidates them into three building tiers: Sentry, Orchestrate and Command.
Read in glossary- 5.3 Methodology
CVSS v4
CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.
Read in glossary- 5.3
EPSS score
The EPSS score is the absolute model output for an individual vulnerability: the estimated probability of real-world exploitation within the next 30 days, expressed as a value between 0 and 1 (i.e. 0 % to 100 %). A score of 0.42 means „the model estimates a 42 % chance of real-world exploitation within 30 days“.
Read in glossary- 0.1 %
- Low — model estimates < 1% exploitation likelihood.
EPSS percentile
The EPSS percentile is the relative position of a vulnerability within all EPSS-scored CVEs, expressed as a value between 0 and 1. A percentile of 0.90 means „this CVE has a higher EPSS score than 90 % of all other scored CVEs“. Unlike the EPSS score, it is not a probability — but a positioning within a ranking.
Read in glossary- 3.5
- Low — this CVE sits in the lower 10% of all CVEs scored today.
KEV status
The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.
Read in glossary- —
- Published
- CISA assessment (SSVC)
- Exploitation: none known · not automatable · Technical impact: total
- Source: CISA Vulnrichment, as of 16 June 2026
CWE
CWE is a catalogue of typical weakness types in software and hardware — such as flawed input validation, unsafe memory handling or poor authentication. Where a CVE names a concrete vulnerability in a concrete product, a CWE describes the underlying class of defect.
Read in glossary- CWE-427
Detection rules
No NEOSEC detection rule is available for this vulnerability yet.
Classification under NIS2 and CRA
Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.
NIS2
NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.
Read in glossary- Handle the vulnerability in regular vulnerability handling under Art. 21(2)(e) NIS2.
CRA
The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.
Read in glossary- From 11.12.2027, Annex I Part II CRA requires manufacturers of affected products with digital elements to handle vulnerabilities without delay and provide security updates.
ISO/IEC 27001
ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.
Read in glossary- Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.
Description
To allow builds of Python to be run from an in-tree layout (rather than an installed file layout), the VPATH variable is defined at build time and used to locate certain landmarks - specifically, Modules/setup.local. When this landmark is found relative to VPATH relative to the executable, Python assumes it is running in a source tree and generates a different default sys.path. This code remains in release builds, so that release-ready builds can be built in-tree. On Windows, since builds are written to 'PCbuild/', the value of VPATH is set to '..\..', which results in a landmark of '..\..\Modules\setup.local'. This path is outside the install directory of Python, and may have different permissions, potentially allowing a low-privilege user to create the landmark and an alternative `Lib` folder that will be discovered by an otherwise restricted install. Such a setup occurs with the legacy default install location for all users (in the now superseded EXE installer), due to how Windows allows all users to create folders in the root directory of their OS drive. Our recommended mitigation on Windows is to migrate away from the legacy installer and use the new [Python install manager](https://www.python.org/downloads/latest/pymanager/) to install for the current user. Installs where the directory two levels above the Python installation directory have equivalent permissions are unaffected (in general, a per-user install cannot be modified at all by other users, removing any escalation of privilege risk, and could be directly modified by a privileged user, making the potential tampering irrelevant). Alternative mitigations might include preemptively creating and restricting access to a `Modules` directory. Be aware that only 3.13 and 3.14 will receive updated legacy installers - earlier fixes are only provided as sources. Platforms other than Windows allow VPATH to be overridden, but as they don't usually use a separated directory in the build for binaries, are unlikely to have a landmark reference outside of the install directory. The landmark detection involving VPATH is a fallback for when a more specific landmark - .\pybuilddir.txt - is absent, and was included for compatibility. Future releases of Python will no longer include the fallback, and so builds will need to generate or preserve the pybuilddir.txt file in order to work in-tree. This landmark file has been generated on Windows since 3.11, and on other platforms for longer.
Source: redhat_csaf, BSI WID Portal, BSI CSAF, OSV (Open Source Vulnerabilities), NVD (NIST), Microsoft Security Update Guide, cvelistv5, CVE.org (MITRE)
Affected products
The following versions are affected. Older releases of the same product line are also vulnerable unless stated otherwise.
| Affected versions | Fixed in | ||
|---|---|---|---|
| Python Software Foundation | CPython |
|
|
| Open Source | Python |
|
|
Distribution and container packages (3)
Downstream packages (e.g. Bitnami, Debian, Ubuntu, Red Hat). Versions refer to the distribution, not the vendor.
| Affected versions | Fixed in | ||
|---|---|---|---|
| bitnami | python-min |
|
|
Vendors and products
Weakness classes (CWE)
CWE-427Uncontrolled Search Path Element
Base
The product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors.
Entry at MITRE CWE-427
References & sources
- github.compython/cpython/pull/151545web, Patch
- github.compython/cpython/issues/151544report, Issue tracking
- httpsmail.python.org/archives/list/security-announce@python.org/thre…advisory, Vendor advisory
- github.compython/cpython/commit/16c40f944b7bff724a403cf4902763d095bb4b2afix, Patch
- github.compython/cpython/commit/9e863fab283eddca9c2a8f9d1ee30f4dc243e314fix, Patch
- github.compython/cpython/commit/a86de0bc236fbb9452f98998fc8437e9fca35700fix, Patch
- github.compython/cpython/commit/b93d6d3399adbd3a5037b6b92fc3587c85ac5d56fix, Patch
- github.compython/cpython/commit/03ab7b44788bfd6b8927e16bcdbd025aa08dce06Patch
- openwall.comlists/oss-security/2026/06/16/8
- github.compython/cpython/commit/872038377db2e170e0e140b5f8aaedf636b3fbf5fix, Patch
- NVD (NIST)vuln/detail/CVE-2026-12003web
Changes to this CVE
Who changed this CVE and when: NVD (analysis, affected products, CVSS), the CVE publisher (CNA) and additional providers such as CISA (ADP).
Record modifiedpython.org
Show the original change
Individual changes of this event as published by NVD Type Action Before After Reference added —https://github.com/python/cpython/commit/872038377db2e170e0e140b5f8aaedf636b3fbf5Source identifier: cna@python.org
Record modifiedpython.org
1 individual change: Affected versions (publisher)
Show the original change
Individual changes of this event as published by NVD Type Action Before After Affected versions (publisher) changed CPythonCPythonSource identifier: cna@python.org
Record modifiedpython.org
1 individual change: Affected versions (publisher)
Show the original change
Individual changes of this event as published by NVD Type Action Before After Affected versions (publisher) changed CPythonCPythonSource identifier: cna@python.org
Receivedpython.org
CVSS V4.0: AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
Weakness type: CWE-427
Description added or changed
Show 6 original changes
Individual changes of this event as published by NVD Type Action Before After Description added —To allow builds of Python to be run from an in-tree layout (rather than an installed file layout), the VPATH variable is defined at build time and used to locate certain landmarks - specifically, Modules/setup.local. When this landmark is found relative to VPATH relative to the executable, Python assumes it is running in a source tree and generates a different default sys.path. This code remains in release builds, so that release-ready builds can be built in-tree. On Windows, since builds are written to 'PCbuild/', the value of VPATH is set to '..\..', which results in a landmark of '..\..\Modules\setup.local'. This path is outside the install directory of Python, and may have different permissions, potentially allowing a low-privilege user to create the landmark and an alternative `Lib` folder that will be discovered by an otherwise restricted install. Such a setup occurs with the legacy default install location for all users (in the now superseded EXE installer), due to how Windows allows all users to create folders in the root directory of their OS drive. Our recommended mitigation on Windows is to migrate away from the legacy installer and use the new [Python install manager](https://www.python.org/downloads/latest/pymanager/) to install for the current user. Installs where the directory two levels above the Python installation directory have equivalent permissions are unaffected (in general, a per-user install cannot be modified at all by other users, removing any escalation of privilege risk, and could be directly modified by a privileged user, making the potential tampering irrelevant). Alternative mitigations might include preemptively creating and restricting access to a `Modules` directory. Be aware that only 3.13 and 3.14 will receive updated legacy installers - earlier fixes are only provided as sources. Platforms other than Windows allow VPATH to be overridden, but as they don't usually use a separated directory in the build for binaries, are unlikely to have a landmark reference outside of the install directory. The landmark detection involving VPATH is a fallback for when a more specific landmark - .\pybuilddir.txt - is absent, and was included for compatibility. Future releases of Python will no longer include the fallback, and so builds will need to generate or preserve the pybuilddir.txt file in order to work in-tree. This landmark file has been generated on Windows since 3.11, and on other platforms for longer.CVSS added —AV:L/AC:L/AT:P/PR:L/UI:A/VC:H/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:XWeakness type (CWE) added —CWE-427Reference added —https://github.com/python/cpython/issues/151544Reference added —https://github.com/python/cpython/pull/151545Reference added —https://https://mail.python.org/archives/list/security-announce@python.org/thread/JIFOBO7UX3LY4VJKJUOKYJV62CFR2IRH/Source identifier: cna@python.org
One NVD translation into another language is hidden.
Embed badge
Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.
<a href="https://intel.neosec.eu/en/cve/CVE-2026-12003"><img src="https://intel.neosec.eu/badge/cve/CVE-2026-12003.svg?lang=en" alt="CVE-2026-12003 – NEOSEC Intel" height="20"></a>