// Security Advisory Triage
socket.getaddrinfo() accepts null bytes, silently truncating host and port
Python security announcements · published 2026-10-31 05:47 UTC
WHAT CHANGEDCPython's socket.getaddrinfo() accepts embedded null bytes in host and port parameters, causing silent truncation of the values. The vulnerability is tracked as CVE-2026-116566 and rated MEDIUM severity.
WHY IT MATTERSSilent truncation of host or port values can bypass validation logic that checks the full string, potentially allowing connections to unintended destinations when attacker-controlled input reaches getaddrinfo().
WHAT TO DOCheck whether your code passes user input to socket.getaddrinfo() without rejecting null bytes. Remediation: see bulletin https://www.cve.org/CVERecord?id=CVE-2026-116566
Model-reported confidence 85% (not measured accuracy)
Primary source ↗
written by anthropic/claude-sonnet-4.5
Show the reasoning — raw diff, triage verdict, confidence
RAW DIFF
+## [Security-announce][CVE-2026-116566] socket.getaddrinfo() accepts embedded null bytes in host and port +https://mail.python.org/archives/list/security-announce@python.org/message/HCHE62VYTPYI6WOPJQDWUBR4CINBPSM7/ +Thu, 29 Oct 2026 17:46:30 +0000 + +There is a MEDIUM severity vulnerability affecting CPython. + +socket.getaddrinfo() previously accepted null bytes within *host* and +*port* parameters which can cause the values to be silently truncated. + +Please see the linked CVE ID for the latest information on affected +versions: + +* https://www.cve.org/CVERecord?id=CVE-2026-116566 +* https://github.com/python/cpython/pull/160899
HOW IT WAS JUDGED
Triage signals below are model-reported assertions, preserved verbatim; they are not independent arithmetic verification.
| triage verdict | MATERIAL at 0.92, needed 0.5 |
|---|---|
| triage reasoning | Python runtime vulnerability in standard library socket module affects any service using DNS resolution. |
| signals | Python runtime vulnerability · socket.getaddrinfo() affected — standard library function in dependency tree · null byte injection in host/port parameters · silent truncation behavior — security-relevant parsing defect · CVE assigned and documented · affects CPython directly |
| suppression | — |
| triage model | anthropic/claude-haiku-4.5 ($0.00000) |
| writer model | anthropic/claude-sonnet-4.5 ($0.00000) |