Yhirose cpp-httplib
cpp-httplib: Cookie header leaked on cross-origin redirect
cpp-httplib is a C++ header-only HTTP/HTTPS library. Prior to 0.51.0, create_redirect_client() removes Host, Proxy-Authorization, and Authorization headers when following a cross-origin 301, 302, 307, or 308 redirect but leaves Cookie headers attached. detail::redirect() copies the request for those redirect codes, so cookies supplied directly or through default_headers_ are sent to the redirect target. An attacker who controls a redirect response, or a network position for a non-HTTPS origin, can receive session cookies intended for the original origin. A 303 redirect is not affected because that path clears all request headers. This issue is fixed in version 0.51.0.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 0.51.0
Fixed in 0.51.0
Mitigation
Upgrade cpp-httplib to 0.51.0 or later.
References
- Vendor advisory github.com/yhirose/cpp-httplib/security/adviso…
- Patch github.com/yhirose/cpp-httplib/commit/0c1cc8c9…
- Release notes github.com/yhirose/cpp-httplib/releases/tag/v0…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.