Skip to main content

cpp-httplib CVE-2026-77341

MEDIUM
Improper Neutralization of CRLF Sequences ('CRLF Injection') (CWE-93)
2026-08-27 GitHub_M
5.3
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Submit request with CRLF-embedded payload
  2. Delivery
    Application reflects payload into chunked trailer field
  3. Exploit
    write_content_chunked() writes unsanitized bytes to socket
  4. Execution
    HTTP client parses injected CRLF as header boundary
  5. Impact
    Attacker-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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.3% exploitation probability (EPSS)

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

Alert me

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

Vendor (GitHub_M) PRIMARY 5.3 MEDIUM
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
vuln.today AI 4.7 MEDIUM

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.

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

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

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

EPSS Score
0.3%
Top 81% exploitable
Prevalence
Medium
widely embedded C++ HTTP library in server tools and IoT projects
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment Vendor GitHub

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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

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

Attack Technique

Code Injection CRITICAL

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

cpe:2.3:a:yhirose:cpp-httplib:*:*:*:*:*:*:*:*
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

Vendor 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

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