Skip to main content

CPython EUVDEUVD-2026-113279

| CVE-2026-116566 MEDIUM
Improper Neutralization of Null Byte or NUL Character (CWE-158)
2026-10-29 PSF GHSA-q27h-3599-9x7j
5.3
CVSS 4.0 · Vendor: PSF
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit null-byte host to application
  2. Delivery
    App forwards value to getaddrinfo()
  3. Exploit
    Null byte truncates at C boundary
  4. Execution
    Prior hostname validation bypassed
  5. Impact
    Resolution 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

CPython 0 <3.16.0

Affected Packages

euvd cpython fix: 3.16.0

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

Vendor (PSF) PRIMARY 5.3 MEDIUM
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
vuln.today AI 4.8 MEDIUM

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).

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (PSF).

CVSS VectorVendor: PSF

Attack Vector
Adjacent
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
High
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

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

EPSS Score
0.3%
Top 82% exploitable
Prevalence
Ubiquitous
CPython standard library, deployed across most server and application environments
Social Media
2
Sightings
Data Quality
7 sources
Confidence: High

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Controlled
Automatable
No
Human Impact· derived
High
Technical Impact
Total

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2026-17084 MEDIUM POC
6.0 Aug 18

Integrity bypass in CPython's stringprep module causes divergent domain name normalization when processing international

CVE-2026-115557 CRITICAL
9.4 Oct 24

CPython's ssl module validates TLS certificate chains that anchor to known-compromised eMudhra CA certificates, so anyon

CVE-2026-19445 CRITICAL
9.2 Sep 30

A use-after-free in CPython's ssl module lets a remote, unauthenticated TLS client crash a Python TLS server process - o

CVE-2026-6100 CRITICAL
9.1 Apr 13

CPython decompression modules (lzma, bz2, gzip) allow memory corruption via use-after-free when decompressor instances a

CVE-2026-3298 HIGH
8.8 Apr 21

Out-of-bounds buffer write in CPython's asyncio.ProactorEventLoop (Windows only) allows remote attackers to trigger memo

CVE-2026-11972 HIGH
8.2 Jun 23

Denial of service in CPython's tarfile module allows remote attackers to trigger an infinite loop by supplying a crafted

CVE-2026-9669 HIGH
8.2 Jun 08

Stack-based buffer overflow in CPython's bz2.BZ2Decompressor allows remote attackers to crash Python applications by sen

CVE-2026-119170 HIGH
8.2 Nov 06

FIPS algorithm enforcement in CPython 3.14.10's hashlib module can fail for hash requests made with usedforsecurity=True

CVE-2026-11940 HIGH
7.8 Jun 23

Path traversal in CPython's tarfile module allows a crafted tar archive to bypass the 'data' and 'tar' extraction filter

CVE-2026-19553 HIGH
7.6 Sep 30

Certificate hostname verification is silently skipped in CPython's TLS stack when an application enables SSLContext.chec

CVE-2026-4786 HIGH
7.0 Apr 13

Command injection in CPython's webbrowser.open() API bypasses previous CVE-2026-4519 mitigation via specially crafted UR

CVE-2026-4519 HIGH
7.0 Mar 20

The webbrowser.open() API in CPython accepts URLs with leading dashes, which certain web browsers interpret as command-l

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