CVE-2026-21428: cpp-httplib has CRLF injection in http headers

Published Jan 1, 2026
·
Updated

cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to version 0.30.0, the writeheaders 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.

Affected Software

2 affected components
cpp-httplib<0.30.0
Yhirose Cpp-httplib<0.30.0

Event History

Jan 1, 2026
CVE Published
via MITRE·05:54 PM
Data Sourced
via MITRE·05:54 PM
DescriptionWeakness
Data Sourced
via NVD·06:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Sep 15, 58035
Event
via FIRST·02:15 PM

Frequently Asked Questions

1

What is the severity of CVE-2026-21428?

CVE-2026-21428 has a high severity due to potential header injection vulnerabilities in the cpp-httplib library.

2

How do I fix CVE-2026-21428?

To fix CVE-2026-21428, update cpp-httplib to version 0.30.0 or later.

3

What are the consequences of exploiting CVE-2026-21428?

Exploiting CVE-2026-21428 could lead to denial of service or the execution of arbitrary commands through HTTP headers.

4

Which versions of cpp-httplib are affected by CVE-2026-21428?

CVE-2026-21428 affects all versions of cpp-httplib prior to 0.30.0.

5

What does the write_headers function in cpp-httplib do regarding CVE-2026-21428?

The write_headers function in cpp-httplib fails to validate CR & LF characters in user-supplied headers, which leads to potential header injection vulnerabilities.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203