CVE-2026-21428
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2026-01-01

Last updated on: 2026-01-06

Assigner: GitHub, Inc.

Description
cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to version 0.30.0, the ``write_headers`` function does not check for CR & LF characters in user supplied headers, allowing untrusted header value to escape header lines. This vulnerability allows attackers to add extra headers, modify request body unexpectedly & trigger an SSRF attack. When combined with a server that supports http1.1 pipelining (springboot, python twisted etc), this can be used for server side request forgery (SSRF). Version 0.30.0 fixes this issue.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-01-01
Last Modified
2026-01-06
Generated
2026-05-07
AI Q&A
2026-01-01
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
yhirose cpp-httplib to 0.30.0 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-93 The product uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2026-21428 is a CRLF (Carriage Return Line Feed) injection vulnerability in the cpp-httplib library versions prior to 0.30.0. The vulnerability occurs because the `write_headers` function does not validate or sanitize user-supplied HTTP header values, allowing attackers to inject CR and LF characters. This enables attackers to prematurely terminate HTTP header lines and insert additional headers or manipulate the HTTP request body. This flaw can be exploited to perform HTTP/1.1 request splitting, which can lead to server-side request forgery (SSRF) attacks when combined with servers supporting HTTP/1.1 pipelining, such as Spring Boot or Python Twisted. The vulnerability allows attackers to add extra headers, modify request bodies unexpectedly, and trigger SSRF attacks. [2, 3]


How can this vulnerability impact me? :

This vulnerability can allow attackers to inject arbitrary HTTP headers and manipulate the request body, which can lead to server-side request forgery (SSRF) attacks. SSRF attacks can cause the server to make unintended requests to internal or external systems, potentially exposing sensitive information or enabling further attacks. The vulnerability can cause unexpected server behavior by processing multiple HTTP requests from a single crafted request. However, the overall severity is considered low with no direct impact on confidentiality, integrity, or availability, and no privileges or user interaction required. [2]


How can this vulnerability be detected on my network or system? Can you suggest some commands?

Detection of this vulnerability involves monitoring HTTP headers for CRLF injection attempts, such as headers containing unexpected carriage return (\r) and line feed (\n) characters that break header lines and inject additional headers or requests. A practical approach is to capture and inspect HTTP traffic using tools like Wireshark or tcpdump to look for suspicious header values containing CRLF sequences. Additionally, testing with crafted HTTP requests that include CRLF sequences in header values can help identify vulnerable cpp-httplib versions. For example, using curl or netcat to send headers with embedded \r\n sequences and observing if the server processes multiple requests or unexpected headers can indicate vulnerability. Specific commands might include: 1) Using tcpdump to capture HTTP traffic: `tcpdump -i <interface> -A 'tcp port 80 or tcp port 443'` 2) Using curl to send a crafted header (note: some clients may sanitize input, so raw socket tools like netcat or custom scripts may be needed): `curl -v -H $'X-Test: test\r\nInjected-Header: injected' http://target` 3) Using netcat or a custom script to send raw HTTP requests with CRLF injection payloads to test server behavior. These methods help detect if the server improperly processes injected headers or multiple requests due to the vulnerability. [2, 3]


What immediate steps should I take to mitigate this vulnerability?

The immediate mitigation step is to upgrade the cpp-httplib library to version 0.30.0 or later, where the vulnerability is fixed by adding strict validation of HTTP header names and values to prevent CRLF injection. If upgrading is not immediately possible, implement input validation to sanitize or reject headers containing CR or LF characters before they are processed or sent. Additionally, avoid using vulnerable versions of cpp-httplib in environments where HTTP/1.1 pipelining is enabled, as this increases the risk of SSRF exploitation. Monitoring and blocking suspicious HTTP requests with injected CRLF sequences at the network perimeter or application firewall can also help mitigate exploitation attempts until the patch is applied. [1, 2, 3]


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart