cpp-httplib
CVE-2026-77341
MEDIUM
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit request with CRLF-embedded payload
-
DeliveryApplication reflects payload into chunked trailer field
-
Exploitwrite_content_chunked() writes unsanitized bytes to socket
-
ExecutionHTTP client parses injected CRLF as header boundary
-
ImpactAttacker-forged headers accepted by client or proxy
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization CRLF sequence sanitization
|
| Exploitation Conditions | Exploitation requires two simultaneous application-level conditions: first, the application must invoke cpp-httplib's chunked content provider API with trailer support (set_chunked_content_provider combined with done_with_trailer()), which is a non-default and relatively uncommon code path distinct from standard response APIs; second, attacker-controlled data must reach a trailer field name or value without prior CRLF sanitization in application code. Neither condition is met by typical cpp-httplib usage. Factors limiting exploitation include the passive user-interaction requirement (UI:P in CVSS 4.0) meaning a victim's HTTP client must receive and process the crafted response, the specificity of the chunked-trailer code path which many deployments never invoke, and the absence of any known public exploit beyond the library's own regression test. The CVSS PR:N metric indicates no authentication is required on the attacker's side, but the attacker must control input that a server-side code path reflects into trailer fields. |
| Impact | The CVSS 4.0 base score of 5.3 (Medium), vector AV:N/AC:L/AT:N/PR:N/UI:P, indicates network-reachable exploitation with no authentication required and passive user interaction, reflecting a scenario where a victim's HTTP client receives and processes the split response. The subsequent-system impact metrics SC:L/SI:L confirm that the primary harm falls on the downstream client rather than the server itself. Real-world risk is substantially lower than the network-level metrics imply: exploitation requires a specific application pattern - chunked responses with trailers containing attacker-reflected data - that is neither a default cpp-httplib usage nor a common idiom. No EPSS data was provided in the intelligence feed, making probability-of-exploitation estimation unavailable from that signal. No CISA KEV listing and no standalone POC have been identified; the commit diff includes a test case demonstrating the injection but this is part of the fix, not a weaponized exploit. The CVSS vector's AC:L may overstate ease of exploitation since it does not capture the application-level prerequisite of actually reflecting untrusted input into trailers. On balance this is a real but narrow-surface vulnerability requiring an audit of whether any cpp-httplib deployment reflects attacker data into trailer fields. |
| Exploit ScenarioDerived | An attacker submits a crafted HTTP request to a cpp-httplib 0.49.0 application that echoes a user-supplied value - such as a query parameter or request header - into a chunked response trailer field. The library writes the unsanitized value, containing an embedded sequence such as legit Injected-Header: pwned , directly to the socket, causing the victim's HTTP client or intermediary proxy to parse the injected bytes as a new response header or even a second HTTP response. The commit diff test case (ChunkedTrailerCRLFInjection) serves as a technical proof of concept demonstrating that both field-value and field-name injection are possible, though no standalone weaponized exploit has been published. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 28, 2026
HTTP response splitting in cpp-httplib 0.49.0 allows an attacker who can influence chunked response trailer values to inject arbitrary headers into the HTTP response stream, potentially forging responses seen by downstream clients. The trailer-writing path in write_content_chunked() is the sole code path in the library that omits the CRLF validation applied by set_header() and every other header-writing function, meaning attacker-controlled CR/LF sequences pass directly to the socket. No public exploit code and no CISA KEV listing have been identified; the fix is confirmed in version 0.50.0 via upstream security advisory GHSA-2r2h-jc8w-w66c.
RemediationAI
Upgrade cpp-httplib to version 0.50.0 or later, which incorporates the fix from commit 568d434e72fc51729d0ad33abffb181e5f7a453d; this is confirmed by the upstream security advisory at https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-2r2h-jc8w-w66c. Because cpp-httplib is header-only, updating requires replacing httplib.h with the 0.50.0 version and rebuilding. If immediate upgrade is not feasible, the most targeted compensating control is to sanitize all attacker-influenced data before passing it to done_with_trailer(), specifically rejecting or stripping any string containing CR (0x0D) or LF (0x0A) bytes; this must be applied at every call site where trailer field names or values originate from external input. A second compensating control is to disable use of chunked trailers entirely on endpoints that process user-supplied data, substituting standard response headers instead; this eliminates the vulnerable path but may affect streaming response semantics. Both workarounds require application-level code changes and carry the risk of incomplete coverage if trailer insertion points are numerous or non-obvious.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
cpp-httplib (CPE: cpe:2.3:a:yhirose:cpp-httplib:*:*:*:*:*:*:*:*) is a popular C++ header-only HTTP/HTTPS library authored by yhirose and embedded in many C++ server and tooling projects. CWE-93 (Improper Neutralization of CRLF Sequences) identifies the root cause class: the library's write_content_chunked() function in httplib.h writes HTTP trailer field names and values directly to the wire without invoking the fields::is_field_name() and fields::is_field_value() validators that guard all other header-writing paths including set_header(). HTTP chunked transfer encoding (RFC 7230) permits optional trailers - header fields appended after the final zero-length chunk - and this is the only code path in cpp-httplib that failed to strip or reject carriage-return and line-feed characters. The fix introduced in commit 568d434e adds the missing guard clauses, silently dropping trailer fields that fail either check, consistent with the behavior of set_header().
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
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N
AC:H because exploitation requires application to reflect untrusted data into chunked trailers, a non-default pattern; S:C and UI:R capture the HTTP response-splitting impact on downstream clients.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
DescriptionCVE.org
cpp-httplib is a C++ header-only HTTP/HTTPS library. In version 0.49.0, the chunked-response trailer output path writes trailer header names and values directly to the socket without validating them, allowing CRLF sequences in a trailer field to inject additional headers or split the HTTP response. Unlike every other header-writing path in the library, the trailer-writing code applies none of the field-name and field-value checks that reject carriage return and line feed, so an application that places attacker-influenced data into a chunked response trailer emits attacker-controlled CRLF onto the wire. This enables HTTP response splitting, letting an attacker forge response headers or inject a second response. This issue is fixed in version 0.50.0.
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
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Affected Products (CPE)CVE.org
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
Same technique Code Injection
View allVendor StatusVendor
SUSE
Severity: Moderate| Product | Status |
|---|---|
| SUSE Linux Enterprise Desktop 15 SP7 | Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP7 | Affected |
| SUSE Linux Enterprise Server 15 SP7 | Affected |
| SUSE Linux Enterprise Server 16.0 | Affected |
| SUSE Linux Enterprise Server 16.0 | Affected |
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| openSUSE Leap 16.0 | Affected |
| openSUSE Leap 16.0 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP4 | Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP4 | Affected |
| SUSE Linux Enterprise Server 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP5 | Affected |
| SUSE Linux Enterprise Server 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Affected |
| SUSE CaaS Platform 4.0 | Affected |
| SUSE Enterprise Storage 6 | Affected |
| SUSE Enterprise Storage 7 | Affected |
| SUSE Enterprise Storage 7.1 | Affected |
| SUSE Linux Enterprise Desktop 15 | Affected |
| SUSE Linux Enterprise Desktop 15 SP1 | Affected |
| SUSE Linux Enterprise Desktop 15 SP2 | Affected |
| SUSE Linux Enterprise Desktop 15 SP3 | Affected |
| SUSE Linux Enterprise Desktop 15 SP4 | Affected |
| SUSE Linux Enterprise Desktop 15 SP5 | Affected |
| SUSE Linux Enterprise Desktop 15 SP6 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP1 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP1-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP1-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP2 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP2-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP2-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP3 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP3-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP3-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15-LTSS | Affected |
| SUSE Linux Enterprise Module for Development Tools 15 | Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP1 | Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP2 | Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP3 | Affected |
| SUSE Linux Enterprise Real Time 15 SP2 | Affected |
| SUSE Linux Enterprise Real Time 15 SP3 | Affected |
| SUSE Linux Enterprise Real Time 15 SP4 | Affected |
| SUSE Linux Enterprise Server 15 | Affected |
| SUSE Linux Enterprise Server 15 SP1 | Affected |
| SUSE Linux Enterprise Server 15 SP1-BCL | Affected |
| SUSE Linux Enterprise Server 15 SP1-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP2 | Affected |
| SUSE Linux Enterprise Server 15 SP2-BCL | Affected |
| SUSE Linux Enterprise Server 15 SP2-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP3 | Affected |
| SUSE Linux Enterprise Server 15 SP3-BCL | Affected |
| SUSE Linux Enterprise Server 15 SP3-LTSS | Affected |
| SUSE Linux Enterprise Server 15-LTSS | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP1 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP2 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP3 | Affected |
| SUSE Manager Proxy 4.0 | Affected |
| SUSE Manager Proxy 4.1 | Affected |
| SUSE Manager Proxy 4.2 | Affected |
| SUSE Manager Proxy 4.3 | Affected |
| SUSE Manager Retail Branch Server 4.0 | Affected |
| SUSE Manager Retail Branch Server 4.1 | Affected |
| SUSE Manager Retail Branch Server 4.2 | Affected |
| SUSE Manager Retail Branch Server 4.3 | Affected |
| SUSE Manager Server 4.0 | Affected |
| SUSE Manager Server 4.1 | Affected |
| SUSE Manager Server 4.2 | Affected |
| SUSE Manager Server 4.3 | Affected |
| openSUSE Leap 15.3 | Affected |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB