# ChatGPT Account Takeover - Wildcard Web Cache Deception

URL-encoded path traversal in ChatGPT's /share/ cache rule let attackers cache /api/auth/session responses, leaking victims' auth tokens and enabling account takeover.

- Payout: $6,500
- Severity: critical
- Program: OpenAI
- Found by: Harel
- Disclosed: 2024-02-04
- Write-up quality: 8/10
- Original: https://nokline.github.io/bugbounty/2024/02/04/ChatGPT-ATO.html
- Library page: https://bugbountylibrary.com/r/blog%3Anokline-github-io-bugbounty-2024-02-04-chatgpt-ato-html
- Tags: area:web domain:web impact:ato impact:data-leak kind:bounty platform:blog sev:critical tech:cdn technique:chained technique:parser-differential vuln:account-takeover vuln:cache-deception vuln:info-disclosure vuln:path-traversal

**Target:** chat.openai.com /share/ path behind Cloudflare CDN
**Root cause:** CDN cache rule matched /share/* without decoding %2F, while origin decoded and normalized the traversal, so sensitive endpoints were cached under attacker-controlled URLs.
**Steps:**
1. Observe shared chat links don't update and return `Cf-Cache-Status: HIT` on `/share/CHAT-UUID`.
2. Confirm arbitrary paths under `/share/` are cached: `/share/random-path-that-does-not-exist`.
3. Craft `https://chat.openai.com/share/%2F..%2Fapi/auth/session?cachebuster=123`; CDN caches it, origin resolves to `/api/auth/session`.
4. Lure victim to the URL so their session response is cached.
5. Request the same URL to retrieve the victim's cached auth token.
**How found:** Noticed shared chat links didn't update, hypothesized caching, confirmed Cf-Cache-Status: HIT on a non-static /share/ path, then tested a nonexistent path to infer the /share/* cache rule and probed parser differentials with encoded traversal.
**Exploitation:** Victim visits the crafted /share/%2F..%2Fapi/auth/session URL; CDN stores the origin's session JSON under that key. Attacker fetches the same URL and reads the victim's auth token, then uses it to access chats, billing, and account settings.
**Escalation:** Token theft escalates to full account takeover including chats and billing data.
**Insight:** When a cache rule is path-prefix based rather than extension based, test whether the CDN and origin disagree on decoding %2F/%2E%2E; a prefix like /share/ can be turned into a wildcard cache for any origin endpoint.

## Proof of concept (copied exactly from the original report)

**Path traversal payload caching auth session token**

```
https://chat.openai.com/share/%2F..%2Fapi/auth/session?cachebuster=123
```

