Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker controls redirect target or MITMs non-HTTPS origin
-
DeliveryVictim client sends request with session Cookie
-
ExploitServer returns cross-origin 302/301/307/308 redirect
-
Executioncpp-httplib copies Cookie to new origin
-
ImpactAttacker captures session cookie
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V6 - Authentication Credential protection in transit/storage
|
| Exploitation Conditions | Exploitation requires the consuming application to use a cpp-httplib client (prior to 0.51.0) with redirect-following enabled (set_follow_location(true)) AND to attach a Cookie header either directly or via default_headers_. The leak only occurs on cross-origin 301, 302, 307, or 308 redirects; 303 redirects are NOT affected because that code path clears all request headers, and same-origin redirects legitimately preserve cookies. The attacker must additionally either control the redirect response (e.g., a malicious or compromised destination server) OR occupy a network man-in-the-middle position against a non-HTTPS (plaintext) origin. Limiting factors: no leak against default clients that do not follow redirects or do not send cookies; HTTPS origins resist the MITM variant (leaving only the attacker-controlled-redirect variant); and only Host/Proxy-Authorization/Authorization were previously stripped while Cookie/Cookie2 were not. |
| Impact | This is a credential-leak flaw (CWE-522) rated CVSS 7.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N) - confidentiality-only, no integrity or availability impact. The high score is driven by the C:H component (session cookies exposed) combined with network vector and no required privileges or user interaction. However, the raw CVSS overstates real-world exposure: exploitation is NOT a default-configuration remote compromise. It requires an application built on cpp-httplib (<0.51.0) that (a) enables follow-location/redirect-following, (b) attaches Cookie headers (directly or via default_headers_), and (c) an attacker who either controls the redirect response or holds a network position against a non-HTTPS origin. No EPSS score, KEV listing, or POC was provided; there is no public exploit identified at time of analysis, and the vulnerability is not in CISA KEV, so there is no evidence of active or widespread exploitation. The signals are internally consistent - a genuine but conditional information-disclosure bug rather than a wormable critical. For most organizations this is a dependency-hygiene/patch item (bump to 0.51.0) rather than an emergency, though the fix is trivial and the leaked data (session cookies) is sensitive, warranting prompt remediation where cpp-httplib clients send cookies across redirects. |
| Exploit ScenarioDerived | An application uses a cpp-httplib client with set_follow_location(true) and sends a session Cookie to its origin. An attacker who controls (or compromises) the destination server, or who can MITM a plaintext HTTP origin, returns a 301/302/307/308 redirect pointing to an attacker-controlled host; the client re-sends the original Cookie header to that cross-origin target, handing the attacker the victim's session credentials. No public exploit code is identified, but the fixed-version test case (DoNotForwardCookie) effectively demonstrates the trigger. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 14, 2026
Cookie header leakage in cpp-httplib before 0.51.0 causes session cookies to be forwarded to a different origin when the library's client follows a cross-origin 301, 302, 307, or 308 redirect. Remote attackers who control the redirect response - or who occupy a network man-in-the-middle position against a plaintext HTTP origin - can capture cookies intended for the original origin, with confidentiality-only impact rated CVSS 7.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N). Exploitation requires the consuming application to enable set_follow_location(true) and to supply cookies directly or via default_headers_, so unauthenticated remote attackers, not authenticated local users, drive the vector, and there is no public exploit identified at time of analysis.
RemediationAI
Upgrade to cpp-httplib 0.51.0 or later, which is the vendor-released patch that adds Cookie and Cookie2 to the redirect header-stripping list alongside Host, Proxy-Authorization, and Authorization (release: https://github.com/yhirose/cpp-httplib/releases/tag/v0.51.0; fix commit: https://github.com/yhirose/cpp-httplib/commit/0c1cc8c9866bb567ff11c1cd0d09779e8c5f8585; advisory: https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-22mf-w2v3-r2jv). Where the header cannot be swapped immediately, disable redirect following in the consuming client (leave set_follow_location at its default false or explicitly turn it off) and handle redirects manually so the application can decide per-hop whether to re-attach credentials - the trade-off is added application complexity and the risk of silently breaking legitimate session flows that rely on same-origin redirects. If redirect following must remain enabled, stop passing cookies through default_headers_ and instead attach them only to the specific same-origin requests that need them, accepting that this requires call-site changes. As a compensating control against the network-man-in-the-middle variant, enforce HTTPS for all origins, which does not address the attacker-controlled-redirect path but removes the plaintext interception vector; note that cookies should also carry HttpOnly, Secure, and short lifetimes so any leaked value has a narrower window of abuse. Because the defect is compiled into the binary, any patched cpp-httplib.h must be rebuilt into all affected images and dependencies rather than relying on a runtime update.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
cpp-httplib is a single-header C++ HTTP/HTTPS client and server library. The flaw sits in ClientImpl::create_redirect_client(), which builds the follow-up request when the client encounters a redirect. Before the fix, that routine stripped only Host, Proxy-Authorization, and Authorization headers on a cross-origin hop, leaving Cookie and Cookie2 attached; detail::redirect() then copies the original request headers for 301, 302, 307, and 308 responses, so the cookie is transmitted to the redirect target. The 303 path is unaffected because it clears all request headers, and same-origin redirects legitimately retain cookies. This maps to CWE-522 (Insufficiently Protected Credentials): sensitive session material crosses an origin trust boundary without being scrubbed. The upstream commit (0c1cc8c9866bb567ff11c1cd0d09779e8c5f8585) adds Cookie and Cookie2 to the headers_to_remove vector and adds regression tests - one asserting a cross-port (different-host) redirect drops the cookie, and one asserting a same-origin redirect still forwards it, preserving normal session flows.
Know when Cpp Httplib gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Remote, no attacker privileges or user interaction once a redirect is served; confidentiality-only (session cookies), with no integrity or availability impact, matching CWE-522.
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
2DescriptionCVE.org
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.
Executive ViewAI
A session cookie leakage vulnerability in the cpp-httplib library (versions before 0.51.0) can allow remote attackers to capture authentication cookies when applications follow redirects to different origins. This unauthenticated flaw poses a high risk to confidentiality, potentially enabling account takeover and data breaches. No vendor-released patch identified at time of analysis, and no public exploit identified at time of analysis, but immediate mitigations are essential for any product using this library.
Disable redirect following (set_follow_location(false)), avoid passing cookies to untrusted origins, enforce HTTPS for all communications, and implement application-level cookie scoping to prevent cross-origin leakage.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
More in Cpp Httplib
View allcpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.27.0, a vulnerability allow
CVE-2025-53628 is a memory exhaustion vulnerability in cpp-httplib versions prior to 0.20.1 that allows unauthenticated
cpp-httplib is a C++ header-only HTTP/HTTPS server and client library. Rated high severity (CVSS 7.5), this vulnerabilit
cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. In version 0.21.0, when many http head
CVE-2025-53629 is a Denial of Service vulnerability in cpp-httplib versions prior to 0.23.0 that allows unauthenticated
cpp-httplib versions prior to 0.30.1 are vulnerable to denial of service attacks due to insufficient validation of decom
cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. [CVSS 7.5 HIGH]
Cpp-Httplib versions up to 0.30.0 contains a vulnerability that allows attackers to add extra headers, modify request bo
cpp-httplib through 0.5.8 does not filter \r\n in parameters passed into the set_redirect and set_header functions, whic
HTTP response/header injection in cpp-httplib server versions prior to 0.44.0 allows remote unauthenticated attackers to
Remote denial of service in cpp-httplib prior to version 0.37.0 allows unauthenticated attackers to crash server process
A security vulnerability in cpp-httplib (CVSS 5.3) that allows attacker-controlled http headers. Risk factors: public Po
EUVD-2026-101592
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB