Summary
An HTTP Response Splitting vulnerability in the file httplib.h allows attackers to tamper with HTTP Response via CRLF injection on vulnerable cpp-httplib versions.
Product
This vulnerability affects cpp-httplib version v0.17.3 through v0.18.3
Impact
The vulnerability allowing an attacker to exploit HTTP Response Splitting by injecting CRLF prepended by a null byte.
Steps to reproduce
- Set up an HTTP server using cpp-httplib
- Read a value from the query-string and assign it to an HTTP header
- Send a request to the server, set the value for the query-string parameter to:
%00%0d%0a%0d%0aINJECTED_BODY
Expected result:
INJECTED_BODY string will be presented in the response’s body
Remediation
A fix was released in commit 9c36aae for version 0.18.4, where the headers are now validated against allowed characters list.
Credit
This issue was discovered and reported by Checkmarx Senior Security Researcher Ori Ron.