Why Users See Someone Else's Data: Steam and ChatGPT

When strangers see each other’s data, the login is usually fine. The leak sits after login, in something your app uses to go faster: a cache, a shared connection, a variable that lives longer than a request. Two companies proved it.
The cause of each is rebuilt small here, so you can see the mechanics and run the tests yourself. The code is on the site: /examples/stranger-data-postmortem/.
Christmas Day 2015: Steam
On December 25, 2015, Steam’s store was under a denial of service attack. Valve’s postmortem says traffic to the store was up 2000% over the average during its big sale. A web caching partner deployed caching rules. During the second wave, a new configuration “incorrectly cached web traffic for authenticated users.”
The result, in Valve’s words: some users saw store pages generated for other users, from the front page in the wrong language to another person’s account page. Between 11:50 and 13:20 PST, pages for about 34,000 users may have been returned to other people. They could include a billing address, purchase history, an email address, the last two digits of a card number and the last four digits of a Steam Guard phone number, among other things. Not passwords, not full card numbers, and not enough to log in as someone else. The store was shut down until every cache configuration had been reviewed and cached data purged (Valve’s own account).
Nobody broke in. The page was stored under a name that did not include who it belonged to.
March 20, 2023: ChatGPT
On March 20, 2023, some ChatGPT users could see titles from another active user’s chat history. OpenAI later found the same bug may have exposed payment details for 1.2% of ChatGPT Plus subscribers who were active in a nine-hour window: name, email, payment address, card type, the last four digits of the card number and expiry date. Full card numbers were never exposed (OpenAI’s postmortem).
The cause was a bug in redis-py, an open-source library. OpenAI used Redis to cache user information, with a shared pool of connections. If a request was cancelled after being sent but before its response was read, the connection was left corrupted, and the next response read on it, for a different request, could be the leftover one. Usually that crashed. But “in some cases the corrupted data happens to match the data type the requester was expecting”, so it looked valid and went back to the wrong person. A server change at 1 a.m. Pacific time raised the number of cancelled requests.
The wrong data passed the type check. A type check asks “is this shaped like a profile?” and does not ask “is this your profile?”. One of the fixes OpenAI listed: “redundant checks to ensure the data returned by our Redis cache matches the requesting user.”
What both incidents had in common
Login worked in both. The broken layer existed for speed, and nobody reviews a cache the way they review a login form. Both fired under unusual load, when they are hardest to notice. The fix that stuck was a second check, close to where the data is used.
Three ways your app can do the same thing
The demo is a Node and Express app with two users, Alice and Bob. In every case Alice does nothing wrong.
1. A variable that outlives the request
let currentUser = null; // "keep the logged-in user in a variable"
app.use(async (req, res, next) => { currentUser = await lookupSession(req); next();});
app.get("/api/me", async (req, res) => { await loadPreferences(); // any await is a gap where another request runs res.json({ name: currentUser.name });});Node handles many requests at once in one process. If Bob’s request starts while Alice’s is waiting on the database, Bob overwrites the variable and Alice’s response reads Bob. It passes every test you run alone. In the test run, 20 of 40 concurrent requests came back with the wrong person’s name.
Fix: the user lives on the request (req.user), not in a variable shared by every request. Hunt for this with grep -rnE '^(export )?(let|var|const) .*(new Map|new Set|= \{\}|= \[\])|^(let|var) ' --include='*.js' --include='*.ts' --include='*.mjs' src server app (use the folders your code lives in) and ask of each hit: could this ever hold one person’s data?
2. A page that any cache may keep
app.get("/account", (req, res) => { res.set("Cache-Control", "public, max-age=60"); // "make it fast" res.json({ name: currentUser.name, card: currentUser.card });});A shared cache (a CDN or reverse proxy) is allowed to store a response marked public and hand it to the next visitor. Here is the part most people miss: section 3.5 of RFC 9111 says a shared cache must not reuse a response to a request that carries an Authorization header unless the response explicitly allows it. Most web apps log in with a cookie instead, so that protection does not apply, and nothing tells the cache the page is personal except you. The public in the example is what overrides it even when an Authorization header is present.
This uses a 40-line stand-in for a CDN that follows the basic rules (it is not a real CDN, so treat the result as a model of the rule, not of any vendor). Alice loads /account. Bob loads it and sees Alice’s card.
Fix: Cache-Control: private, no-store on anything personal. And do not count on Vary: Cookie as the safety. Vercel’s docs say a Vary on Cookie isn’t cacheable and tell you to use private for per-user responses.
Cloudflare does not cache HTML or JSON by default. It caches by file extension. The dangerous moment is when someone adds a rule to cache everything (“my site is slow, make it cache more”), the kind of change Steam made in a hurry.
3. A cache that is trusted blindly
const billingCache = new Map();app.get("/api/billing", (req, res) => { res.json(billingCache.get(req.user.id)); // whatever comes back, send it});Libraries, refactors and key typos can hand you the wrong cache entry. Stamp each entry with its owner when you write it, and compare the stamp when you read:
if (entry.owner !== req.user.id) { console.error("cache owner mismatch"); billingCache.delete(req.user.id); return res.status(500).json({ error: "Something went wrong" });}A 500 is a bad afternoon. Serving Bob’s card to Alice is a postmortem. Fail closed. Log the user ids involved (never the data) so the mismatch can be investigated, which is the second half of the fix.
The tests: behaviors, not code
Four of the five tests talk to the app over HTTP, the way a user or a CDN does, and know nothing about how the server is written. The fourth needs a test-only hook to plant a wrong entry in the cache, because corruption like OpenAI’s cannot be triggered on demand. That planted entry is the control: without it, a test that only sees normal traffic would pass on a broken cache too. Keep hooks like that out of production builds.
test("two people hitting the server at the same moment each get their own profile", async () => { const wrong = []; for (let i = 0; i < 20; i++) { const [a, b] = await Promise.all([ get(originUrl, "/api/me", "alice"), sleep(8).then(() => get(originUrl, "/api/me", "bob")), ]); if (a.json.name !== "Alice") wrong.push(`Alice's request returned ${a.json.name}`); if (b.json.name !== "Bob") wrong.push(`Bob's request returned ${b.json.name}`); } assert.deepStrictEqual(wrong, []);});
test("a CDN in front of the app never serves Alice's account page to Bob", async () => { await get(cdnUrl, "/account", "alice"); const b = await get(cdnUrl, "/account", "bob"); assert.strictEqual(b.json.card, "Mastercard 1111");});A test that checks “the code calls setHeader” breaks when you refactor and passes when you break the behavior. A test that checks “Bob never sees Alice’s card” survives refactors, including the one your AI tool does next week, and fails the moment someone breaks the promise.
They were run in a scratch folder, from a clean npm install. First against the vulnerable version:
$ npm run test:before✖ two people hitting the server at the same moment each get their own profile✖ a CDN in front of the app never serves Alice's account page to Bob✖ personal pages declare themselves private✖ a cache entry that belongs to someone else is refused, not served✔ the owner still gets their own billing detailsℹ tests 5 ℹ pass 1 ℹ fail 4
20 of 40 requests returned someone else's dataBob saw Visa 4242 (x-cache: HIT)Alice was served Bob's card detailsThen against the fixed version:
$ npm run test:after✔ two people hitting the server at the same moment each get their own profile✔ a CDN in front of the app never serves Alice's account page to Bob✔ personal pages declare themselves private✔ a cache entry that belongs to someone else is refused, not served✔ the owner still gets their own billing detailsℹ tests 5 ℹ pass 5 ℹ fail 0The one passing test in the first run is the “owner still gets their own data” check. It is the guard against over-fixing: a fix that locks everyone out would fail it. Tests only protect the behavior they cover: these five promises, not your whole app.
How do I check my own app in five minutes?
- Open your live site logged in, and fetch a personal page with its response headers:
curl -sI https://yourapp.com/account -H "Cookie: <your session cookie>". Look atCache-Control. It should sayprivateorno-store. If it sayspublicor hass-maxage, a CDN may keep it. NoCache-Controlat all is a finding too: one “cache everything” rule later, the CDN’s own default applies. Setprivate, no-storeexplicitly. - Request it twice and look at the cache status header (
CF-Cache-Statuson Cloudflare,x-vercel-cacheon Vercel).HITon a personal page is the Steam bug. - Refreshing by hand almost never reproduces a race. Use a test that sends many pairs of requests at once, like the first test above, which fires 20 pairs.
- Run the grep from bug 1 on your server code and ask of each hit whether it holds one user’s data.
Paste this into your AI tool
Audit this app for places where one user's data could be shown to another user.Look for: variables at module level that store user-specific data, caches andmemoized functions whose key does not include the user id, responses withCache-Control: public or s-maxage on logged-in pages, and any place where anobject is returned without checking it belongs to the requesting user. Foreach finding, write a failing test that logs in as two different users andchecks only HTTP behavior, run it, show me the failure, then fix it and showthe test passing. Do not write tests that inspect how the code is built.Limits: this is a small model of two incidents, not a reproduction of either company’s system, and the cache in the test is a stand-in, not a real CDN. Run the header check against your real host before you trust it.
More on the habits that prevent this: the 20-minute security check, what a teardown of an AI-built app turns up, and what breaks when a vibe-coded app gets real users. Before launch, use the launch checklist.
The Get AI Native ebook goes deeper on this. It is free, and the expected launch is around Christmas. Join the waitlist on the homepage.