Skip to main content

cpp-httplib CVE-2026-102944

| EUVDEUVD-2026-101592 HIGH
Insufficiently Protected Credentials (CWE-522)
2026-10-14 security-advisories@github.com
7.5
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker controls redirect target or MITMs non-HTTPS origin
  2. Delivery
    Victim client sends request with session Cookie
  3. Exploit
    Server returns cross-origin 302/301/307/308 redirect
  4. Execution
    cpp-httplib copies Cookie to new origin
  5. Impact
    Attacker 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

cpp-httplib < 0.51.0

Affected Packages

euvd cpp_httplib fix: 0.51.0

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

Vendor (github) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
vuln.today AI 7.5 HIGH

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.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Lifecycle Timeline

2
Patch available
Oct 14, 2026 - 20:34 EUVD
CVE Published
Oct 14, 2026 - 19:17 cve.org
HIGH 7.5

DescriptionCVE.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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.4%
Top 72% exploitable
Prevalence
Medium
popular header-only C++ HTTP library, but client redirect-with-cookies usage is specific
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2025-66570 CRITICAL POC
10.0 Dec 05

cpp-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 HIGH POC
8.8 Jul 10

CVE-2025-53628 is a memory exhaustion vulnerability in cpp-httplib versions prior to 0.20.1 that allows unauthenticated

CVE-2025-46728 HIGH POC
7.5 May 06

cpp-httplib is a C++ header-only HTTP/HTTPS server and client library. Rated high severity (CVSS 7.5), this vulnerabilit

CVE-2025-52887 HIGH POC
7.5 Jun 26

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 HIGH POC
7.5 Jul 10

CVE-2025-53629 is a Denial of Service vulnerability in cpp-httplib versions prior to 0.23.0 that allows unauthenticated

CVE-2026-22776 HIGH POC
7.5 Jan 12

cpp-httplib versions prior to 0.30.1 are vulnerable to denial of service attacks due to insufficient validation of decom

CVE-2026-28435 HIGH POC
7.5 Mar 04

cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. [CVSS 7.5 HIGH]

CVE-2026-21428 HIGH POC
7.5 Jan 01

Cpp-Httplib versions up to 0.30.0 contains a vulnerability that allows attackers to add extra headers, modify request bo

CVE-2020-11709 HIGH POC
7.5 Apr 12

cpp-httplib through 0.5.8 does not filter \r\n in parameters passed into the set_redirect and set_header functions, whic

CVE-2026-45372 CRITICAL
9.9 May 29

HTTP response/header injection in cpp-httplib server versions prior to 0.44.0 allows remote unauthenticated attackers to

CVE-2026-29076 MEDIUM POC
5.9 Mar 07

Remote denial of service in cpp-httplib prior to version 0.37.0 allows unauthenticated attackers to crash server process

CVE-2025-66577 MEDIUM POC
5.3 Dec 05

A security vulnerability in cpp-httplib (CVSS 5.3) that allows attacker-controlled http headers. Risk factors: public Po

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy