Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit null-byte host to application
-
DeliveryApp forwards value to getaddrinfo()
-
ExploitNull byte truncates at C boundary
-
ExecutionPrior hostname validation bypassed
-
ImpactResolution targets unintended host
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Metacharacter neutralization
|
| Exploitation Conditions | Requires a Python application (CPython <3.16.0) that passes externally-influenced data as the host or port argument to socket.getaddrinfo(), typically in a pattern where a hostname is validated or allowlisted and then resolved. The concrete prerequisite is an attacker-supplied value containing an embedded, trailing, or leading null byte, which the pre-fix code truncated at the C boundary so the validated string and the resolved value diverge. The checks run before any name resolution, so no network access to a resolver is needed to trigger the error path. Limiting factors: standalone or trusted-input uses of getaddrinfo are unaffected, there is no impact without the vulnerable validate-then-resolve code path, and only Python versions before 3.16.0 are affected. |
| Impact | Signals point to a modest, context-dependent issue rather than an urgent emergency. There is no EPSS score and no CISA KEV listing in the input, and the vuln.today decision label is 'this_month' (not act_now/emergency), so there is no indication of active or imminent exploitation. No public exploit or PoC reference is present - only a patch PR, a tracking issue, and the PSF security advisory. The flaw itself is CWE-158 (null byte neutralization): socket.getaddrinfo() silently truncated host/port at the first null byte, which matters mainly as a validation/allowlist-bypass primitive in applications that check a hostname and then resolve it. The supplied CVSS 4.0 vector (AV:A/AC:L/AT:P/PR:H/UI:P/VC:H/VI:H/VA:N) is hard to reconcile with this mechanism: adjacent-network access, high privileges, required user interaction, and High confidentiality+integrity impact do not obviously match a standard-library truncation whose real impact is entirely dependent on the calling application - this inconsistency should be verified with the vendor/NVD. Net: a worthwhile defense-in-depth fix for a ubiquitous runtime, but on the available signals it is not a high-urgency, actively-exploited priority. |
| Exploit ScenarioDerived | An application validates an externally supplied hostname (for example against an allowlist to prevent SSRF) and then passes it to socket.getaddrinfo() on Python before 3.16.0. An attacker submits a host value containing an embedded null byte so the string the validator inspects differs from the truncated value seen at the C boundary, causing resolution of an unintended target and bypassing the check. No public exploit code is identified at time of analysis; realistic feasibility depends on the specific validate-then-resolve pattern in the calling application. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 29, 2026
CPython before 3.16.0 silently truncated the *host* and *port* arguments to socket.getaddrinfo() at the first embedded, leading, or trailing null byte because the C layer treated them as NUL-terminated strings, so a value that passed application-level validation could resolve to a different host or port than the one that was checked. The practical risk is confined to Python applications that feed externally influenced data into getaddrinfo() in a validate-then-resolve pattern; uses with static or trusted input are unaffected. The independent assessment rates this CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N, i.e. a modest, context-dependent issue; no confirmed active exploitation or public exploit code was identified, and the vendor fix is upstream in pull request 160899 for the 3.16.0 line.
RemediationAI
Upgrade to CPython 3.16.0 or later, the first release containing the fix from pull request https://github.com/python/cpython/pull/160899, which now raises ValueError when *host* or *port* contains a null character instead of truncating it; the change is announced in the vendor advisory at https://mail.python.org/archives/list/security-announce@python.org/thread/HCHE62VYTPYI6WOPJQDWUBR4CINBPSM7/ and tracked in issue https://github.com/python/cpython/issues/160898. Where upgrading immediately is not possible, address the application-side pattern that makes the bug exploitable: reject any *host* or *port* value containing a NUL character (and any bytes value that decodes to one) before it reaches socket.getaddrinfo(), or check the resolved result against the allowlist rather than trusting the pre-resolution string - both add a small amount of request-path validation but close the validate-then-resolve divergence. Applications that only pass static configuration values or already-trusted operator input to getaddrinfo() are not exposed and can schedule the interpreter upgrade normally.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw is CWE-158 (Improper Neutralization of Null Byte or NUL Character) in the CPython socket module's C implementation. socket.getaddrinfo() accepts str or bytes objects for *host* and *port*; internally Modules/socketmodule.c obtained the buffer with PyBytes_AsString()/PyUnicode_AsUTF8() and then handed it to the resolver, which treats it as a C string terminated at the first NUL. Python strings and bytes objects carry an explicit length and may legitimately contain NUL, so any embedded NUL caused the value seen by the resolver to be shorter than the Python object - a leading NUL collapsed the value to the empty string, and an embedded NUL shortened a hostname or service name. The patch captures the buffer lengths (PyBytes_GET_SIZE, PyUnicode_AsUTF8AndSize) and compares strlen() against the stored length before any name resolution occurs, raising ValueError when they diverge; the accompanying test covers embedded, trailing and leading NULs in both str and bytes form, including a non-ASCII host that is routed through IDNA encoding, and confirms the checks fire before any resolver/network activity. The security consequence is a validation/resolution mismatch rather than memory corruption: the string an application allowlisted and the string the resolver actually used can differ.
Know when Cpython gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:A/AC:L/AT:P/PR:H/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
Input is usually network-sourced (AV:N) and needs no attacker privileges (PR:N), but exploitation depends on an application-specific validate-then-resolve pattern (AC:H); impact is a limited validation bypass (C:L/I:L).
Primary rating from Vendor (PSF).
CVSS VectorVendor: PSF
DescriptionCVE.org
socket.getaddrinfo() previously accepted null bytes within *host* and *port* parameters which can cause the values to be silently truncated.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Integrity bypass in CPython's stringprep module causes divergent domain name normalization when processing international
CPython's ssl module validates TLS certificate chains that anchor to known-compromised eMudhra CA certificates, so anyon
A use-after-free in CPython's ssl module lets a remote, unauthenticated TLS client crash a Python TLS server process - o
CPython decompression modules (lzma, bz2, gzip) allow memory corruption via use-after-free when decompressor instances a
Out-of-bounds buffer write in CPython's asyncio.ProactorEventLoop (Windows only) allows remote attackers to trigger memo
Denial of service in CPython's tarfile module allows remote attackers to trigger an infinite loop by supplying a crafted
Stack-based buffer overflow in CPython's bz2.BZ2Decompressor allows remote attackers to crash Python applications by sen
FIPS algorithm enforcement in CPython 3.14.10's hashlib module can fail for hash requests made with usedforsecurity=True
Path traversal in CPython's tarfile module allows a crafted tar archive to bypass the 'data' and 'tar' extraction filter
Certificate hostname verification is silently skipped in CPython's TLS stack when an application enables SSLContext.chec
Command injection in CPython's webbrowser.open() API bypasses previous CVE-2026-4519 mitigation via specially crafted UR
The webbrowser.open() API in CPython accepts URLs with leading dashes, which certain web browsers interpret as command-l
EUVD-2026-113279
GHSA-q27h-3599-9x7j
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB