Cross-IP Cookie Disclosure via Empty Custom Host Header Truncation
A malformed empty custom Host header caused libcurl to store a cookie with an empty domain, which was then sent to a different numerical IP address. An attacker could potentially disclose cookies across distinct IP origins when a shared cookie store is used.
Originally disclosed on HackerOne
- Disclosed after 20 hours
libcurl may disclose cookies across distinct numerical IP origins when an HTTP request uses a malformed custom Host: [] header and cookies are shared through a CURLSH cookie store. When a server at 127.0.0.1 responds to this request with a Set-Cookie header, the cookie is stored with an empty domain and may subsequently be sent to a different numerical IP address, such as 127.0.0.2. This behavior was reproduced using two separate easy handles: the first handle received the cookie and was destroyed with curl_easy_cleanup(), while a newly initialized second handle sharing the same CURLSH sent the cookie to the different IP without configuring a custom Host header. A negative-control request to localhost did not receive the cookie, and the affected cookie was also absent from CURLINFO_COOKIELIST despite being transmitted over the network. The behavior was reproduced against curl commit 0a108352bf16e8dbd0e077c46fa3929681335a84, which includes the fix for CVE-2026-6276. Researcher attribution: dotlinux26.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, libcurl failed to properly validate or reject an empty Host header, causing the cookie to be stored with an empty domain and thus treated as valid for any IP address.
Impact
Cookies may be disclosed across distinct numerical IP origins when a shared cookie store is used.
What the attacker needed
Libcurl with CURLSH cookie store; custom Host header set to empty; server responds with Set-Cookie
How it was found
- Create a libcurl easy handle with a custom Host header set to an empty value.
- Send a request to a server at one IP address that responds with a Set-Cookie header.
- Destroy the first handle with curl_easy_cleanup().
- Create a new easy handle sharing the same CURLSH cookie store.
- Send a request to a different IP address without a custom Host header.
- Observe that the cookie is sent to the second IP address.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Cookies are small pieces of data that websites store in your browser to remember you. Normally, a cookie is only sent back to the same website that set it. This report shows that a bug in a programming library called libcurl could cause a cookie to be sent to a different IP address, which could leak your session to another server.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.