Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-66570: CWE-290: Authentication Bypass by Spoofing in yhirose cpp-httplib

0
Critical
VulnerabilityCVE-2025-66570cvecve-2025-66570cwe-290cwe-345cwe-807
Published: Fri Dec 05 2025 (12/05/2025, 18:18:02 UTC)
Source: CVE Database V5
Vendor/Project: yhirose
Product: cpp-httplib

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 inject headers named REMOTE_ADDR, REMOTE_PORT, LOCAL_ADDR, LOCAL_PORT that are parsed into the request header multimap via read_headers() in httplib.h (headers.emplace), then the server later appends its own internal metadata using the same header names in Server::process_request without erasing duplicates. Because Request::get_header_value returns the first entry for a header key (id == 0) and the client-supplied headers are parsed before server-inserted headers, downstream code that uses these header names may inadvertently use attacker-controlled values. Affected files/locations: cpp-httplib/httplib.h (read_headers, Server::process_request, Request::get_header_value, get_header_value_u64) and cpp-httplib/docker/main.cc (get_client_ip, nginx_access_logger, nginx_error_logger). Attack surface: attacker-controlled HTTP headers in incoming requests flow into the Request.headers multimap and into logging code that reads forwarded headers, enabling IP spoofing, log poisoning, and authorization bypass via header shadowing. This vulnerability is fixed in 0.27.0.

AI-Powered Analysis

AILast updated: 12/05/2025, 18:45:19 UTC

Technical Analysis

CVE-2025-66570 is an authentication bypass vulnerability in the yhirose cpp-httplib library, a widely used C++11 single-header HTTP/HTTPS client-server library. Versions prior to 0.27.0 improperly handle certain HTTP headers that influence server-side metadata and authorization decisions. Specifically, attacker-controlled headers named REMOTE_ADDR, REMOTE_PORT, LOCAL_ADDR, and LOCAL_PORT are parsed into the request header multimap via the read_headers() function without filtering or validation. The server later appends its own internal metadata using the same header names in Server::process_request but does not erase duplicates. Because Request::get_header_value returns the first header entry, which is attacker-supplied, downstream code relying on these headers for IP-based authorization or logging uses spoofed values. This allows attackers to spoof client IP addresses, poison logs, and bypass authorization checks that depend on these headers. The vulnerability affects key functions in httplib.h and related logging code in docker/main.cc. The attack surface includes any incoming HTTP requests where the attacker can inject headers. Exploitation requires no authentication or user interaction and can be performed remotely over the network. The vulnerability has a CVSS 3.1 base score of 10.0 (critical) due to its high impact on confidentiality and integrity and ease of exploitation. No known exploits are currently reported in the wild. The issue is resolved in cpp-httplib version 0.27.0 by properly handling duplicate headers and ensuring server-generated metadata cannot be overridden by client input.

Potential Impact

For European organizations, this vulnerability poses a significant risk especially to those using cpp-httplib in web servers, microservices, or embedded systems that rely on HTTP headers for client identification and authorization. Attackers can spoof IP addresses to bypass IP-based access controls, potentially gaining unauthorized access to sensitive systems or data. Log poisoning can obscure attack traces or mislead incident response teams, complicating forensic investigations. Critical infrastructure sectors such as finance, healthcare, and government services that use C++ libraries for backend services are particularly vulnerable. The ability to bypass authentication without credentials or user interaction increases the risk of automated attacks and lateral movement within networks. Organizations relying on cpp-httplib for internal or external APIs may face data breaches or service disruptions. The vulnerability undermines trust in logging and monitoring systems, which are essential for compliance with European data protection regulations like GDPR. Failure to patch promptly could lead to regulatory penalties and reputational damage.

Mitigation Recommendations

The primary mitigation is to upgrade all instances of cpp-httplib to version 0.27.0 or later, where this vulnerability is fixed. Organizations should audit their codebases and dependencies to identify usage of vulnerable cpp-httplib versions. Additionally, implement strict validation and sanitization of incoming HTTP headers, especially those related to client IP and port information. Servers should avoid relying solely on client-supplied headers for authorization decisions and instead use secure, server-controlled mechanisms for client identification. Logging systems must be hardened to detect and reject suspicious or duplicate headers that could indicate spoofing attempts. Network-level protections such as Web Application Firewalls (WAFs) can be configured to block or alert on anomalous header patterns. Security teams should enhance monitoring for unusual access patterns and conduct regular penetration testing to verify the effectiveness of mitigations. Finally, ensure incident response plans include procedures for detecting and responding to header spoofing and log poisoning attacks.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2025-12-04T16:17:35.386Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 693324bbf88dbe026c02bd7a

Added to database: 12/5/2025, 6:30:19 PM

Last enriched: 12/5/2025, 6:45:19 PM

Last updated: 12/6/2025, 5:37:36 AM

Views: 20

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats