How I Found and Reproduced a Race Condition in AWS API Key Creati
AWS enforced a limit of two access keys per IAM user, but the check was not synchronised, so sending several key-creation requests at the same moment let more keys through. An attacker with access to an account could create extra long-lived credentials beyond the intended cap.
In this blog, I’ll share how I discovered and responsibly disclosed a race condition that allowed bypassing the API key creation limit for a single AWS account. This wasn’t “hacking AWS,” but rather identifying a timing issue related to API key generation.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the quota check and the key creation were not performed atomically, so concurrent requests all passed the check before any key was written.
Impact
The per-user key quota could be exceeded, leaving extra active credentials that outlive the intended limit and widen the window for misuse if they leak.
What the attacker needed
Access to an AWS account you own; user already at the two-key limit; a proxy that can send parallel requests
The fix
The limit check should be made atomic, for example with server-side locking or a conditional write, so concurrent requests cannot all pass before a key is stored.
How it was found
- Sign in to the AWS console and open IAM, then a user's security credentials.
- Make sure the user already holds the maximum of two access keys.
- Delete the existing keys and intercept the key-creation request in a proxy.
- Send several copies of that request in parallel.
- Refresh the console and observe that more than two keys now exist.
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 write-up has not been written yet. The Original tab links to the source.
A race condition is when a program checks something and then acts on it, and someone slips extra actions in between the check and the action. Here the service counted your existing keys, decided you were under the limit, and only then created a new one; firing several requests at once meant each one saw the same low count. The result was more keys than the rules allow.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.