Skip to content
Misconfiguration Disclosed report Intermediate

Public-suffix cookie injection when libpsl is disabled

When curl is built without libpsl, it accepts cookies with a Domain attribute set to a public suffix such as .co.uk. A malicious server can then plant a cookie that curl later sends to unrelated sibling domains that share the same cookie jar.

pwnie Follow

Originally disclosed on HackerOne

  • Disclosed after 3 days

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:

  1. Build curl without libpsl (e.g., ./configure --disable-shared --without-libpsl && make -j; confirm curl --version lists no PSL feature).
  2. 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>).
  3. Store cookies: /tmp/curl/src/curl -v --resolve attacker.co.uk:8000:127.0.0.1 http://attacker.co.uk:8000/ -c /tmp/cjar2.
  4. 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.
  5. Observe Cookie: sess=attack sent to victim.co.uk and .co.uk stored in the jar (see artifacts/cookie_server.log and artifacts/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

The original report as published on HackerOne, by pwnie. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 curl's cookie Domain validation relies on libpsl to reject public suffixes, and when built without libpsl it accepts them.

Impact

A malicious server could 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.

What the attacker needed

Curl built without libpsl; attacker controls a host under the public suffix; victim reuses the same cookie jar across domains

How it was found

  1. Build curl without libpsl and confirm the version output has no PSL feature.
  2. Run a local HTTP server that sets a cookie with Domain .co.uk when the Host header starts with attacker.co.uk.
  3. Use curl to request attacker.co.uk and save the cookies to a jar file.
  4. Reuse the same cookie jar to request victim.co.uk.
  5. Observe that the cookie is sent to victim.co.uk and the public-suffix cookie is stored in the jar.

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.

A cookie is a small piece of data a website asks your browser or tool to store and send back later. Normally a site can only set cookies for its own domain, but here curl was built without a list of public suffixes (like .co.uk) and so it wrongly allowed a cookie for the whole suffix. That meant a bad site could plant a cookie that curl would later hand to a completely different site.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by pwnie

View all

2 more disclosed reports, best first.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.