How Fast Do Leaked API Keys Get Abused? Seconds, Not Days
A Stony Brook study saw a leaked AWS key used 7.86 seconds after it went public. What that and two recent leaked-key incidents mean for your app.
Updated 2026-11-18
7.86 seconds
Researchers Billy Tsouvalas and Nick Nikiforakis at Stony Brook University published 300 decoy container images across eight public registries over four months. The images held planted AWS, OpenAI, and Anthropic keys plus fake SSH and database logins. Their paper, Gone in 8 Seconds, was presented at ACM CCS 2026.
The fastest use of a planted AWS key came 7.86 seconds after its image went up on Docker Hub. The median time to the first AWS call was 51.19 seconds, and all 100 AWS keys in the first round were used within 15 minutes. The planted OpenAI and Anthropic keys were used to drain the test accounts' balances.
That study measured Docker images, not websites. But the lesson carries over: bots watch public places where secrets land and test them automatically. The researchers saw the bots read image files directly instead of running the containers, the same way a bot can read your public JavaScript without ever using your app.
Two recent leaked-key incidents
Cursor, October 2026: Cursor said an attacker got an access key Cursor had issued to its vendor Fireworks AI, which was exposed in a Fireworks breach. Some coding-agent traces in the shared data held credentials that had not been redacted. Starting from those, the attacker reached other tools and, on October 29, placed a malicious copy of the Claude Code extension on the cache behind Cursor's extension marketplace for about 11 hours.
Lighter, November 16, 2026: on the trading exchange Lighter, an attacker got a trader's API keys and used them to move about $10.4 million in USDC out, according to blockchain analysts reported by CoinDesk. Lighter said the keys leaked because the trader's own unofficial signing code reused nonces, which let anyone work out the private key from public signatures. About $5 million was returned to the trader, and Lighter said it is adding IP allowlists and per-key permissions.
Neither one was a key pasted into a web page. But both show the same thing: once a key is out, it gets used, and a key that can do everything does the most damage.
What this means for a vibe-coded app
If a secret key ships in your public JavaScript, an exposed /.env file, or a public repo, plan as if it was copied the moment it went live. There is no safe window to fix it later.
- Rotate first. Revoke the leaked key in the provider's dashboard and create a new one before you touch the code.
- Then look at the provider's usage, billing, and logs from the time the key went public, not just today.
- Give each key only what it needs: separate keys per app and environment, restricted keys where the provider offers them, and AWS roles with short-lived credentials instead of long-lived access keys.
- Set spending limits or budget alerts where the provider offers them, so a stolen AI key cannot run up an unlimited bill.
- Keep secrets out of chats, support tickets, and AI agent sessions. Anything you paste there is another copy you do not control.
- Check the built output before it goes public: the live site, the Docker image, or the package, not just the source folder.
A prompt you can paste into your coding agent
Use this after you have rotated any leaked key:
List every API key, token, and password this project uses and where each one is read. For each: is it ever sent to the browser, written into a build, a Docker image, or a log? Move anything secret into a server-only environment variable (no NEXT_PUBLIC_ or VITE_ prefix) and into server code. Tell me which keys could be replaced with a restricted or lower-permission key, and do not print any key values in your answer.
Quick answers
How long after a key leaks is it abused?
In the Stony Brook honeypot study, the fastest planted AWS key was used 7.86 seconds after it went public on Docker Hub, the median was about 51 seconds, and all 100 AWS keys in the first round were used within 15 minutes.
Is deleting the key from my code enough?
No. Copies already exist. Only revoking or rotating the key in the provider's dashboard makes those copies useless.
Can Freedom Check tell me if my leaked key was already used?
No. It only finds key patterns on your live site. Check the provider's usage, billing, and logs to see whether a key was used.
Sources
- Tsouvalas and Nikiforakis, Gone in 8 Seconds, ACM CCS 2026
- BleepingComputer: Cloud keys leaked in Docker Hub images are stolen within seconds
- Cursor: An update on our recent security incident
- Fireworks AI: October 2026 security incident
- CoinDesk: Lighter pauses withdrawals after a leaked API key leads to $10.4 million theft
- The Block: Lighter reopens withdrawals after trader's API key leak, returns about $5 million
Check your live app for free
Freedom Check's free scan reads your live page, up to 8 same-site scripts it loads, and any public source maps for OpenAI, Anthropic, Stripe, AWS, GitHub, Slack, and SendGrid key patterns, private keys, and Supabase service_role keys, and it checks /.env, /.env.local, /.git/config, and /.git/HEAD. It only sees the website at that URL: it cannot see Docker images, your git history, chat logs, or whether a key was already used.
The free scan shows how many issues turned up and explains the most serious one with a fix prompt. The full report is $19 one time, or $29/month for unlimited.
Run a free scan →See pricing