CVE-2025-66570

Unknown · Unknown Multiple Products

A critical vulnerability exists in the cpp-httplib library, a component used in multiple software products, which allows an attacker to spoof their network address and other connection details.

Executive summary

A critical vulnerability exists in the cpp-httplib library, a component used in multiple software products, which allows an attacker to spoof their network address and other connection details. By sending a specially crafted request, an attacker can bypass IP-based security controls, poison logs with false information, and potentially gain unauthorized access to systems. This flaw presents the highest possible risk and requires immediate attention.

Vulnerability

The vulnerability, known as header shadowing, stems from how the cpp-httplib library processes incoming HTTP headers. An attacker can inject headers with reserved names such as REMOTE_ADDR, REMOTE_PORT, LOCAL_ADDR, and LOCAL_PORT into a request. The library's read_headers() function parses and stores these malicious headers first. Subsequently, the server's process_request function appends the legitimate connection metadata using the same header names but fails to remove or overwrite the attacker-supplied duplicates. When downstream application code calls the Request::get_header_value function to retrieve connection information, the function returns the first value it finds, which is the spoofed value provided by the attacker. This allows an attacker to control server-visible metadata, leading to IP spoofing, which can be leveraged to bypass IP-based authorization controls, obscure the true source of an attack in logs, and interfere with other security mechanisms that rely on accurate client connection data.

Business impact

This vulnerability is rated critical with a CVSS score of 10, indicating the highest possible risk of exploitation with severe potential consequences. A successful exploit could directly impact business operations by enabling attackers to bypass critical security controls designed to protect sensitive data and internal systems. The primary business risks include unauthorized access to confidential information, data breaches, and compromise of internal infrastructure by an attacker masquerading as a trusted internal user. Furthermore, the log poisoning aspect significantly hinders incident response and forensic investigations, making it difficult to identify the true source of an attack and assess the extent of a compromise. A public breach resulting from this vulnerability could lead to significant financial loss, regulatory fines, and severe reputational damage.

Remediation

Immediate Action: Organizations must conduct a thorough software inventory to identify all applications and systems that utilize the vulnerable cpp-httplib library. Once identified, update the affected products or underlying library to a patched version incorporating cpp-httplib 0.27.0 or later. After patching, monitor application and network logs for any signs of post-remediation exploitation attempts.

Proactive Monitoring: Implement monitoring and alerting for incoming HTTP requests that contain headers such as REMOTE_ADDR, REMOTE_PORT, LOCAL_ADDR, or LOCAL_PORT, as these are not standard client-sent headers and are strong indicators of an exploit attempt. Security teams should correlate application-level logs with network firewall and proxy logs to detect discrepancies between the source IP address logged by the application and the actual source IP of the network connection.

Compensating Controls: If immediate patching is not feasible, implement the following compensating controls:

  • Deploy a Web Application Firewall (WAF) or reverse proxy rule to inspect all incoming traffic and strip the malicious headers (REMOTE_ADDR, etc.) before the request reaches the vulnerable application.
  • Enforce stricter network segmentation to limit the impact of a potential authorization bypass, preventing an attacker from moving laterally within the network.
  • If possible, modify application logic to use a more reliable method of determining the client's IP address that does not rely on the vulnerable get_header_value function for these specific keys.

Exploitation status

Public Exploit Available: false

Analyst recommendation

This vulnerability represents a critical and immediate threat to the organization. The primary recommendation is to urgently identify all assets using the vulnerable cpp-httplib library and apply the vendor-supplied patches or updates without delay. While this CVE is not currently listed on the CISA Known Exploited Vulnerabilities (KEV) catalog, its critical severity and potential for widespread impact make it a prime candidate for future inclusion. If patching cannot be performed immediately, the compensating controls outlined above, particularly the use of a WAF to strip malicious headers, must be implemented as a critical temporary mitigation to protect against potential exploitation.