CVE-2026-15308: Python HTML Parser CPU DoS Vulnerability – HIGH Severity
Python's built-in HTML parser can be forced to consume excessive CPU resources when processing specially crafted HTML containing repeated unterminated markup declarations. An attacker who can submit or inject malicious HTML into an application using Python's html.parser.HTMLParser can trigger a denial-of-service condition, potentially freezing or slowing the affected service. This vulnerability affects the standard library across Python versions and requires no authentication or user interaction to exploit.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Weaknesses (CWE)
- CWE-400
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-07-09 / 2026-08-13
NVD description (verbatim)
The incremental HTML parser (html.parser.HTMLParser) allows for CPU denial-of-service through repeated unterminated markup declarations when processing uncontrolled data.
11 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2026-15308 is a CPU exhaustion vulnerability in Python's html.parser.HTMLParser module. The parser's incremental processing logic fails to efficiently handle repeated unterminated markup declarations (such as unclosed '<!...>' sequences), causing pathological backtracking or inefficient state transitions that consume disproportionate CPU cycles. The vulnerability is classified under CWE-400 (Uncontrolled Resource Consumption), indicating a resource-exhaustion weakness in parsing logic. The CVSS 3.1 score of 7.5 (HIGH) reflects a network-exploitable flaw with no privilege or user interaction requirements, though impact is limited to availability rather than confidentiality or integrity.
Business impact
Any service or application that parses untrusted HTML using Python's standard library parser becomes a denial-of-service vector. Common affected scenarios include web scrapers, content management systems, email processors, security tools that analyze HTML payloads, and any Python web framework or library that internally uses html.parser for HTML sanitization or processing. A successful attack can render the affected service unavailable, disrupting user access and potentially affecting downstream systems that depend on timely responses. Organizations running Python-based SaaS platforms, APIs, or backend services should prioritize assessment and remediation.
Affected systems
Python interpreter installations across all maintained versions that include the standard library html.parser module. The vulnerability is inherent to the parser implementation itself, making it a platform-level issue rather than a third-party package concern. Any Python application or service that processes HTML from untrusted sources is theoretically at risk. Web frameworks, libraries, and tools built on Python that rely on html.parser (rather than alternative parsers) are in scope.
Exploitability
Exploitation is straightforward and requires only the ability to submit or inject malicious HTML into a vulnerable application. No special tools, authentication, or user interaction are needed. The attack surface depends on application design: web forms accepting HTML input, email parsers, social media content processors, or API endpoints that accept HTML payloads are all viable attack vectors. The low complexity and network accessibility (CVSS AV:N/AC:L) mean this vulnerability is practical to exploit at scale if vulnerable services are internet-facing. However, widespread automated exploitation is unlikely without public proof-of-concept tools or exploitation frameworks.
Remediation
Patch Python to a version that includes the fix for html.parser.HTMLParser. Organizations should verify the exact patched version against official Python security advisories and apply updates according to their Python version and release schedule. For applications unable to immediately upgrade Python, temporary mitigations include rate-limiting or timeout enforcement on HTML parsing operations, using alternative HTML parsers (such as html5lib or lxml with libxml2), or implementing input validation to reject malformed HTML before parsing. Applications should also review their HTML processing pipeline to ensure untrusted input is validated and resource limits are enforced.
Patch guidance
Consult the official Python Security Advisory and release notes for CVE-2026-15308 to identify the patched version for your Python release series (3.8, 3.9, 3.10, 3.11, 3.12, etc.). Update using your package manager or Python installer, then verify the fix by confirming the version post-patch. Organizations with containerized deployments should rebuild container images with the patched Python version. For those running Python on embedded systems or air-gapped networks, coordinate a maintenance window to apply patches systematically. Test patch compatibility with dependent libraries before broad rollout.
Detection guidance
Monitor for abnormal CPU usage spikes correlated with HTML parsing operations in application logs. Intrusion detection systems can flag HTTP requests or API payloads containing repeated unterminated markup sequences (e.g., '<!...<!...<!...') as potential exploitation attempts. Application performance monitoring (APM) tools can alert on parsing timeout or resource exhaustion events. Log aggregation should capture any exceptions or warnings from html.parser during untrusted input processing. Network sensors can detect patterns of malicious HTML injection in request payloads, though signature-based detection may require updating once exploit patterns emerge.
Why prioritize this
This vulnerability merits high priority due to its HIGH CVSS score (7.5), network exploitability, and the ubiquity of Python in infrastructure. The standard library nature of html.parser means the vulnerability is present in nearly all Python deployments. While not yet in the CISA KEV catalog, the combination of ease of exploitation, broad applicability, and denial-of-service impact justifies rapid assessment and patching. Organizations operating customer-facing or mission-critical Python services should prioritize this above lower-severity issues.
Risk score, explained
The CVSS 3.1 score of 7.5 (HIGH) is driven by network accessibility (AV:N), no privilege or user interaction requirements (PR:N/UI:N), and a high impact on availability (A:H). The score reflects that an unauthenticated attacker can remotely trigger a service outage with a single crafted request. The lack of confidentiality or integrity impact (C:N/I:N) prevents a critical rating. Organizations may adjust internal risk ratings upward if their threat model includes active DoS threats or if their application processes HTML from highly adversarial sources.
Frequently asked questions
Does this affect all Python applications, or only those parsing HTML?
Only applications that explicitly use the html.parser.HTMLParser module from the standard library are vulnerable. Applications using third-party HTML parsers (lxml, html5lib, BeautifulSoup with an alternative backend) are not directly affected by this CVE. However, if your application or a dependency imports html.parser, it is in scope.
Can this be exploited through normal user input in a web form?
Yes. If a web application accepts HTML input from users (e.g., in a comment field, forum post, or content editor) and passes it to html.parser without validation, an attacker can inject the malicious markup and trigger a DoS. This makes the vulnerability relevant to many common web applications.
What is the difference between this and other HTML parser vulnerabilities?
This vulnerability is specific to the efficiency of html.parser's incremental parsing logic when handling repeated unterminated declarations. Other HTML parsers may have different vulnerabilities or may handle this case more efficiently. The impact is denial-of-service only, not code execution or data exfiltration.
Should we switch to a different HTML parser as a permanent solution?
Switching parsers is a valid long-term architectural decision if your application has no strong dependency on html.parser. However, applying the official Python patch is the recommended first step. Only migrate parsers if you have operational justification or if html.parser cannot meet your requirements after patching.
This analysis is based on the published CVE record and CVSS vector as of the modification date. Actual patch availability, version numbers, and timeline details must be verified against official Python security advisories. This document does not constitute legal advice or guarantee of security. Organizations should conduct their own risk assessment and testing before deploying patches. No exploit code or weaponized proof-of-concept is provided; security research should follow responsible disclosure practices. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2023-54365HIGHTraefik HTTP/2 Denial of Service Vulnerability – Rapid Reset Attack
- CVE-2024-14036HIGHDräger Core Denial of Service via Malformed SDC Messages
- CVE-2025-52293HIGHGPAC MP4Box HEVC Parser Denial of Service (CVSS 7.5)
- CVE-2025-53114HIGHCometD Denial-of-Service via Unacknowledged Message Queue Overflow
- CVE-2025-61025HIGHOpenLink Virtuoso 7.2.11 Remote DoS via SQL Query Parsing
- CVE-2026-10069HIGHShibby Tomato miniupnpd Resource Exhaustion Vulnerability
- CVE-2026-10143HIGHkafka-python SCRAM DoS – Event Loop Freeze Vulnerability
- CVE-2026-12151HIGHundici WebSocket Memory Exhaustion DoS Vulnerability