curl · Report #3475472
Public-suffix cookie injection when libpsl is disabled
N/Astatus
11upvotes
25 Dec 2025disclosed
How it was found
Summary: When libcurl is built without libpsl, Domain attribute validation accepts public suffixes like .co.uk, allowing a malicious host to plant cookies that are later sent to unrelated sibling domains using the same cookie jar. AI assistance was used to draft this report.
Steps to Reproduce:
- Build curl without libpsl (e.g.,
./configure --disable-shared --without-libpsl && make -j; confirmcurl --versionlists no PSL feature). - Run a local HTTP server that sets
Set-Cookie: sess=attack; Domain=.co.uk; Path=/when the Host header starts with attacker.co.uk (example:/tmp/curl/cookie_server.py 8000 <logpath>). - Store cookies:
/tmp/curl/src/curl -v --resolve attacker.co.uk:8000:127.0.0.1 http://attacker.co.uk:8000/ -c /tmp/cjar2. - Reuse the cookie jar on a different host:
/tmp/curl/src/curl -v --resolve victim.co.uk:8000:127.0.0.1 http://victim.co.uk:8000/ -b /tmp/cjar2. - Observe
Cookie: sess=attacksent to victim.co.uk and.co.ukstored in the jar (seeartifacts/cookie_server.logandartifacts/cookie_jar_public_suffix.txt).
Impact: A malicious server can inject cookies scoped to public suffixes and have them sent to unrelated domains, enabling session fixation or request poisoning in applications that reuse a shared cookie jar across multiple domains.
Impact
Look at original report impact