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.
{
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/21xxx/CVE-2026-21428.json",
"cwe_ids": [
"CWE-93"
]
}{
"cpe": "cpe:2.3:a:yhirose:cpp-httplib:*:*:*:*:*:*:*:*",
"extracted_events": [
{
"introduced": "0"
},
{
"fixed": "0.30.0"
}
],
"source": [
"CPE_RANGE",
"REFERENCES"
]
}"2026-07-15T19:14:46Z"
[
{
"target": {
"function": "ClientImpl::write_request",
"file": "httplib.h"
},
"id": "CVE-2026-21428-2a3c35de",
"digest": {
"function_hash": "236783576194208022074912422607734971641",
"length": 3337.0
},
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"source": "https://github.com/yhirose/cpp-httplib/commit/98048a033a532ff22320ce1d11789f8d5710dfcd"
},
{
"target": {
"function": "TEST",
"file": "test/test.cc"
},
"id": "CVE-2026-21428-31c10d64",
"digest": {
"function_hash": "21230083771032333993136639908271811634",
"length": 835.0
},
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"source": "https://github.com/yhirose/cpp-httplib/commit/98048a033a532ff22320ce1d11789f8d5710dfcd"
},
{
"target": {
"file": "test/test.cc"
},
"id": "CVE-2026-21428-448d1d4e",
"digest": {
"line_hashes": [
"149066278595483493855647045669558341282",
"218176843687203766514303688750036368582",
"36395984737058306102492305876818156149",
"93131711617347560139037053523218007776",
"45174732858542764499925482307158537653",
"279773556912318610451730088793098218503",
"277234281654859354833338151130670461364",
"314494236331862484654061324103828914858",
"136760103424630328282988441890438143934",
"15726091890124120109828290476748461765",
"76556508603325617234579544446984262255",
"99496090020014608424618678419031898992",
"335975449700889255680156298553548466433",
"133768166030581392097269098867277444429",
"265020585373190799148156166855220153964",
"27770235393975933996540380392045428241",
"10226280177045922361835483296143219745",
"33247392374783198708328400794859133751"
],
"threshold": 0.9
},
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"source": "https://github.com/yhirose/cpp-httplib/commit/98048a033a532ff22320ce1d11789f8d5710dfcd"
},
{
"target": {
"file": "httplib.h"
},
"id": "CVE-2026-21428-746e0aeb",
"digest": {
"line_hashes": [
"261101704612475793201431655521474618235",
"144589759349256299201670368972538539041",
"14267181052624035337458094170249302267",
"284222080548487386926119947587123280263",
"325375147206123982559252304512715923796",
"197009881000278662781612493647102468119",
"228545043346182666402236792122161832282",
"175653250537658213357291402723937868653",
"104227765803765844293956305785663278136",
"168743860198275992295170544526578853962",
"270089662993397192109201213448850263687",
"7518849500697083840705577566274303515",
"139416975375343922165160912439092283941",
"283000712248793343507093691301483802539",
"280958175002367772702631987063312568248",
"11396608072443187724369991874410071781"
],
"threshold": 0.9
},
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"source": "https://github.com/yhirose/cpp-httplib/commit/98048a033a532ff22320ce1d11789f8d5710dfcd"
},
{
"target": {
"function": "ClientImpl::open_stream",
"file": "httplib.h"
},
"id": "CVE-2026-21428-8b207bc8",
"digest": {
"function_hash": "17615259011025421480534109435573669298",
"length": 3361.0
},
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"source": "https://github.com/yhirose/cpp-httplib/commit/98048a033a532ff22320ce1d11789f8d5710dfcd"
},
{
"target": {
"function": "TEST",
"file": "test/test.cc"
},
"id": "CVE-2026-21428-96e04230",
"digest": {
"function_hash": "261119415164471213635728064887671045638",
"length": 937.0
},
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"source": "https://github.com/yhirose/cpp-httplib/commit/98048a033a532ff22320ce1d11789f8d5710dfcd"
},
{
"target": {
"function": "Server::write_response_core",
"file": "httplib.h"
},
"id": "CVE-2026-21428-baa49ede",
"digest": {
"function_hash": "320522676550951009926090657476060146965",
"length": 1961.0
},
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"source": "https://github.com/yhirose/cpp-httplib/commit/98048a033a532ff22320ce1d11789f8d5710dfcd"
}
]
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-21428.json"