# curl cookie mixed case PSL bypass

curl's PSL check compared cookie domains case-sensitively, so a server could set domain=co.UK and bypass the public-suffix guard to plant supercookies sent to unrelated sites.

- Payout: $2,540
- Severity: medium
- Program: Internet Bug Bounty
- Found by: nyymi
- Disclosed: 2023-12-22
- CVE: CVE-2023-46218
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/2274981
- Library page: https://bugbountylibrary.com/r/h1%3A2274981
- Tags: area:oss domain:oss impact:data-leak kind:bounty platform:hackerone sev:medium tech:curl technique:parser-differential vuln:info-disclosure

**Target:** curl cookie domain / Public Suffix List validation
**Root cause:** The function verifying a cookie's domain against the PSL did not normalize case, so a mixed-case PSL entry (co.UK) failed to match the lowercase PSL entry (co.uk) and was treated as a registrable domain.
**Steps:**
1. Malicious server responds with `Set-Cookie: ...; domain=co.UK` while the request URL host is lowercase `curl.co.uk`.
2. curl's PSL check compares `co.UK` against PSL entry `co.uk` case-sensitively and does not recognize it as a public suffix.
3. Cookie is accepted as a valid domain cookie for `co.UK`.
4. Subsequent requests to other `*.co.uk` hosts receive the cookie, leaking it to unrelated origins.
**How found:** Researcher noticed the PSL domain verification was case-sensitive: a mixed-case suffix like co.UK did not match the lowercase PSL entry co.uk, so the public-suffix rejection was skipped.
**Exploitation:** A malicious HTTP server sets a cookie with a mixed-case public-suffix domain (e.g. domain=co.UK) that bypasses the PSL guard; curl then sends that cookie to other unrelated sites under the same suffix, exposing data to those origins.
**Insight:** When a security check consults a static list (PSL, allowlist, blocklist), test case variants of the listed entries—case-sensitive comparison against a normalized list is a recurring bypass.

