Input validation error in Cpp-httplib - CVE-2026-31870

 

Input validation error in Cpp-httplib - CVE-2026-31870

Published: April 24, 2026


Vulnerability identifier: #VU127463
CSH Severity: Medium
CVSS v4: 8.7 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2026-31870
CWE-ID: CWE-20
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to cause a denial of service.

The vulnerability exists due to improper input validation in ClientImpl::open_stream() when parsing the Content-Length response header in the streaming API. A remote attacker can send a specially crafted HTTP response with a malformed Content-Length header to cause a denial of service.

Only the streaming API paths that call open_stream() are affected; the regular non-streaming request path is not affected.


Affected software

Cpp-httplib
openEuler
cpp-httplib
cpp-httplib-debuginfo
cpp-httplib-debugsource
cpp-httplib-devel

How to mitigate CVE-2026-31870

Install security update from vendor's website.

Cpp-httplib - update to 0.37.1
cpp-httplib - update to 0.38.0-1
cpp-httplib-debuginfo - update to 0.38.0-1
cpp-httplib-debugsource - update to 0.38.0-1
cpp-httplib-devel - update to 0.38.0-1

External References

Related Security Bulletins