CVE-2026-128089
Memory exhaustion via out‑of‑range WKS service number in dnspython before 2.9.2.
- CVSS 7.5
- CWE-400
- Resource Management
- Remote
dnspython is a DNS toolkit for Python. Prior to version 2.9.2, the from_text() parser for WKS records does not require the service number to be between 0 and 65535 before using it as a bitmap offset. An attacker-controlled zone file can supply a larger number, causing the service bitmap to grow to an extremely large size through inefficient repeated extension, consuming excessive memory and CPU and potentially terminating the process. Applications are affected only when they parse zone-file text whose record type and rdata are attacker controlled. This issue is fixed in version 2.9.2.
- CWE
- CWE-400
- CVSS base score
- 7.5
- Published
- 2026-11-13
- OWASP
- A04 Insecure Design
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Resource Management
- Subcategory
- Resource Exhaustion
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- dnspython
- Fixed by upgrading
- Yes
Solution
Upgrade dnspython to version 2.9.2 or later.
Vulnerable code sample
import dns.rdata
import dns.rdatatype
def parse_wks(rdata_text):
"""
Parse a WKS record from its textual representation.
Vulnerable: does not validate the service number range.
"""
# VULNERABLE: unchecked service number can cause huge bitmap allocation
return dns.rdata.from_text(dns.rdatatype.WKS, rdata_text)
# Example usage (the caller supplies rdata_text from an untrusted zone file)
# wks = parse_wks("999999 1 0.0.0.0")Patched code sample
import dns.rdata
import dns.rdatatype
def parse_wks(rdata_text):
"""
Parse a WKS record from its textual representation.
Fixed: enforce service number limits before parsing.
"""
# FIX: validate service number is within 0‑65535 to prevent bitmap blow‑up
first_token = rdata_text.split(maxsplit=1)[0]
try:
service_num = int(first_token)
except ValueError:
raise dns.exception.SyntaxError("Invalid service number")
if not (0 <= service_num <= 65535):
raise dns.exception.SyntaxError("Service number out of range")
return dns.rdata.from_text(dns.rdatatype.WKS, rdata_text)
# Example usage (the caller supplies rdata_text from an untrusted zone file)
# wks = parse_wks("53 1 0.0.0.0")Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Constrain WKS bitmap size. (rthalley/dnspython)
dns/rdtypes/IN/WKS.py · WKS.from_text,dns/rdtypes/IN/WKS.py · WKS.__init__
Cite this entry
@misc{vaitp:cve2026128089,
title = {{Memory exhaustion via out‑of‑range WKS service number in dnspython before 2.9.2.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-128089},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-128089/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
