CVE-2025-6069

4.3 MEDIUM

📋 TL;DR

This CVE describes a denial-of-service vulnerability in Python's html.parser.HTMLParser class where specially crafted malformed HTML inputs can trigger worst-case quadratic time complexity, causing excessive CPU consumption. This affects any Python application using html.parser to parse untrusted HTML input. The vulnerability could allow attackers to cause service degradation or complete unavailability.

💻 Affected Systems

Products:
  • Python
  • Any application using Python's html.parser module
Versions: Python versions before the fix commits (specific versions not specified in references)
Operating Systems: All operating systems running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using html.parser.HTMLParser to parse untrusted HTML input

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service unavailability due to CPU exhaustion, potentially affecting multiple services on the same host

🟠

Likely Case

Service degradation with increased response times and reduced throughput

🟢

If Mitigated

Minimal impact with proper input validation and resource limits in place

🌐 Internet-Facing: MEDIUM - Internet-facing services parsing user-provided HTML are vulnerable to DoS attacks
🏢 Internal Only: LOW - Internal services typically process trusted or controlled HTML content

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending specially crafted malformed HTML to a vulnerable parser

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Python versions containing the referenced commits

Vendor Advisory: https://github.com/python/cpython/security/advisories

Restart Required: Yes

Instructions:

1. Update Python to version containing the fix commits
2. Restart affected Python applications
3. Test HTML parsing functionality after update

🔧 Temporary Workarounds

Input validation and sanitization

all

Validate and sanitize HTML input before parsing to prevent malformed content

Resource limiting

all

Implement CPU time limits and request timeouts for HTML parsing operations

🧯 If You Can't Patch

  • Implement strict input validation to reject malformed HTML
  • Deploy rate limiting and request throttling to prevent DoS attacks

🔍 How to Verify

Check if Vulnerable:

Check if application uses html.parser.HTMLParser and processes untrusted HTML input

Check Version:

python --version

Verify Fix Applied:

Verify Python version includes the fix commits or test with known malformed HTML payloads

📡 Detection & Monitoring

Log Indicators:

  • Unusually high CPU usage by Python processes
  • Increased HTML parsing times
  • Request timeouts on HTML processing endpoints

Network Indicators:

  • Repeated requests with malformed HTML content
  • Traffic patterns suggesting DoS attempts

SIEM Query:

source="application_logs" AND (process="python" AND cpu_usage>90% AND duration>30s)

🔗 References

📤 Share & Export