High severity · published May 29, 2026
CVE-2026-46527
cpp-httplib: Malicious `X-Forwarded-For` Under Trusted-Proxy Configuration Triggers Empty `vector::front()`, Leading to Undefined Behavior and Server Crash
7.5
CVSS
0.3%
EPSS
No
On KEV
Description
cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.44.0, When the server has called Server::set_trusted_proxies() with a non-empty trusted-proxy list, an attacker can send an HTTP request that includes an X-Forwarded-For header whose value parses to no valid IP segments. The code path then executes get_client_ip(), which calls front() on an empty std::vector—undefined behavior in C++. On typical implementations this manifests as abnormal process termination (denial of service). With Sanitizers enabled, you get an explicit runtime diagnostic. This vulnerability is fixed in 0.44.0.
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Confidentiality
None
Integrity
None
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.3% · higher than 26% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
CP
cpp-httplib · yhirose
< 0.44.0 · source: vendor, NVD
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2026-46527
CVE.org
https://www.cve.org/CVERecord?id=CVE-2026-46527
Exploit
https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-hg3g-vrg8-578g
More from cpp-httplib
9.9
CVE-2026-45372
cpp-httplib: HTTP header value percent-decoding in server-side `parse_header` enables CRLF injection
9.8
CVE-2025-66570
cpp-httplib Untrusted HTTP Header Handling: Internal Header Shadowing (REMOTE*/LOCAL*)
8.8
CVE-2025-53628
cpp-httplib does not limit the length of a line
8.8
CVE-2023-26130
Versions of the package yhirose/cpp-httplib before 0.12.4 are vulnerable to CRLF Injection when untrusted user input is used to set the content-type header in the HTTP .Patch,…
8.2
CVE-2026-77358
cpp-httplib: Use-after-free of TLS session in WebSocketClient::shutdown_and_close()
