CVE-2025-66570: CWE-290: Authentication Bypass by Spoofing in yhirose cpp-httplib
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 Analysis
Technical Summary
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.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Italy, Spain, Poland, Belgium
CVE-2025-66570: CWE-290: Authentication Bypass by Spoofing in yhirose 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
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.
For access to advanced analysis and higher rate limits, contact root@offseq.com
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 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-14117: Cross-Site Request Forgery in fit2cloud Halo
MediumCVE-2025-13292: CWE-269 Improper Privilege Management in Google Cloud Apigee-X
HighCVE-2025-13922: CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in stevejburge Tag, Category, and Taxonomy Manager – AI Autotagger with OpenAI
MediumCVE-2025-12505: CWE-285 Improper Authorization in wedevs weDocs: AI Powered Knowledge Base, Docs, Documentation, Wiki & AI Chatbot
MediumCritical XXE Bug CVE-2025-66516 (CVSS 10.0) Hits Apache Tika, Requires Urgent Patch
CriticalActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.