CVE-2026-102944
HighCVSS 7.5Exploitation Probability (EPSS)
Low risk28th percentile - higher than 28% of all known CVEs
Summary
cpp-httplib before version 0.51.0 fails to strip Cookie headers on cross-origin 301, 302, 307, and 308 redirects. The create_redirect_client() function removes Host, Proxy-Authorization, and Authorization headers but leaves Cookie headers attached, causing session cookies to be sent to the redirect target.
Risk Assessment
An attacker controlling a redirect response or a network position for a non-HTTPS origin can capture session cookies intended for the original origin, leading to session hijacking.
Recommendation
Upgrade cpp-httplib to version 0.51.0 or later, which strips Cookie headers on cross-origin redirects.
Other vulnerabilities in cpp-httplib
See all- CVE-2026-22776High
cpp-httplib prior to version 0.30.1 contains a Denial of Service (DoS) vulnerability due to unsafe handling of compressed HTTP request bodies. The library validates payload_max_length against compressed data size but does not limit the size of decompressed data stored in memory.
- CVE-2026-21428High
cpp-httplib prior to version 0.30.0 does not check for CR & LF characters in user-supplied headers, allowing header injection and unexpected request body modification. This can lead to SSRF attacks, especially when combined with HTTP/1.1 pipelining servers. Version 0.30.0 fixes this issue.
- CVE-2026-45372Critical
The cpp-httplib library before version 0.44.0 improperly validates HTTP headers, allowing injection of newline characters via encoded header values.
- CVE-2025-66570Critical
cpp-httplib prior to 0.27.0 has a vulnerability that 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, and the server later appends its own internal metadata without erasing duplicates, potentially leading to the use of attacker-controlled values.
- CVE-2026-103930Low
cpp-httplib is a C++ header-only HTTP/HTTPS library. From 0.29.0 until 0.51.0, Client::open_stream in httplib.h accepts a caller-controlled path that reaches detail::write_request_line() without the detail::encode_path() protection used by the ordinary buffered request path. Raw carriage-return and line-feed bytes in the path can therefore split the outbound HTTP/1.1 request line and inject attacker-shaped request metadata.
- CVE-2026-77358High
cpp-httplib is a C++ header-only HTTP/HTTPS library. In versions 0.33.0 through 0.50.0, the TLS-enabled WebSocket client frees the TLS session before closing the WebSocket that still uses it, producing a use-after-free. This issue is fixed in version 0.50.1.
- CVE-2026-77341Medium
cpp-httplib version 0.49.0 does not validate header names and values in chunked response trailers, allowing CRLF injection and HTTP response splitting. Applications placing attacker-influenced data into trailers can emit attacker-controlled CRLF. Fixed in version 0.50.0.
- CVE-2026-54919High
The cpp-httplib library versions 0.31.0 through 0.46.1 (Mbed TLS backend) and 0.33.0 through 0.46.1 (wolfSSL backend) skip certificate chain validation when connecting to an IP-literal host in HTTPS mode. This allows a man-in-the-middle attacker to present a crafted certificate and intercept or modify traffic.
- CVE-2026-46527High
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).
- CVE-2026-45352Medium
cpp-httplib prior to 0.43.4 has a vulnerability related to negative chunk-size in chunked Transfer-Encoding. The ChunkedDecoder::read_payload function parses the chunk-size field using std::strtoul(), which accepts a leading minus sign, causing unsigned wrap-around. The library only rejects -1, but other negative values like -2 pass validation, leading to unbounded memory allocation and process crash.
Original NVD description (English source)
cpp-httplib is a C++ header-only HTTP/HTTPS library. Prior to 0.51.0, create_redirect_client() removes Host, Proxy-Authorization, and Authorization headers when following a cross-origin 301, 302, 307, or 308 redirect but leaves Cookie headers attached. detail::redirect() copies the request for those redirect codes, so cookies supplied directly or through default_headers_ are sent to the redirect target. An attacker who controls a redirect response, or a network position for a non-HTTPS origin, can receive session cookies intended for the original origin. A 303 redirect is not affected because that path clears all request headers. This issue is fixed in version 0.51.0.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

