New Device confirmation tokens are not properly validated.
New device confirmation tokens were not invalidated when a newer token was issued, so an older code still worked. An attacker holding an earlier confirmation code could confirm a device even after a fresh code had been sent.
- Fixed in 3 months
- Paid in 3 months
- Disclosed after 8 months
Hi, team I noticed that the new device confirmation code sent by your server is not validated . POC:
- Login to a new computer and ask for confirmation code two times.
Say around at 12.00 PM and at 12.01 PM 2) Now verify the device with the confirmation token which arrived at 12.01 PM
and after doing your work go to https://www.coinbase.com/settings/security_settings and remove that device . say around 12.30 PM 3) Now you need to confirm the device once again and your server will send the new device confirmation code to user's email address at 12.30 PM 4) Here this time use the confirmation code which arrived at 12.00 PM and u can see that , your device is confirmed.
Fix: Invalidate all the previous confirmation tokens as soon as new token is generated.
What the report shows
The target is Coinbase, and the feature under scrutiny is the new device confirmation flow: when a user signs in from an unrecognised computer, the server emails a confirmation code that the user must enter before the device is trusted. The researcher, born2hack, reported that these confirmation codes are not properly validated, specifically that an older code stays valid after a newer one has been issued.
The proof of concept is a short numbered sequence:
- Log in to a new computer and request a confirmation code twice, roughly a minute apart (the report uses 12.00 PM and 12.01 PM as example times).
- Verify the device using the code that arrived at 12.01 PM, do whatever work is needed, then go to
https://www.coinbase.com/settings/security_settingsand remove that device (around 12.30 PM in the example). - Request confirmation for the device again, which causes the server to send a fresh confirmation code to the user's email address at 12.30 PM.
- This time, enter the code that arrived at 12.00 PM, the very first one. The device is confirmed.
The finding is that a code issued much earlier, and already superseded by a later code, is still accepted at a point in time when only the newest code should work. The report does not describe the request or response format of the confirmation endpoint, the length or format of the code, any rate limiting, or how long a code remains valid beyond the example timeline.
The report records a bounty of 100.00 USD. It does not state a severity rating or CVSS score. The weakness is classified as improper authentication. The fix the researcher proposes is to invalidate all previous confirmation tokens as soon as a new token is generated. The report was disclosed on 2015-05-25.
Root cause
Because the earlier token is never explicitly invalidated when a new one is issued, it remains usable until its own expiry, and the report's timeline shows the earlier code was still accepted after the device was removed and confirmation requested again..
If the check is only "does this code belong to this user and is it still live", then any outstanding code for that user will pass, regardless of which request it was issued for.
Impact
The report demonstrates that a stale code can be replayed to confirm a device. The direct consequence is that an older confirmation code can still be used to confirm a device after a newer code has been issued. The impact should be read as the report frames it: a validation flaw in the confirmation step that lets a superseded token be reused.
How this kind of bug works
Confirmation and one-time tokens are meant to be single-use and short-lived. The security property relies on three things: the token is unpredictable, it is bound to the specific action it authorises, and it stops being valid once used or once a replacement is issued.
Bugs appear when one of these is dropped. Common variants include tokens that are never deleted after use, tokens that remain valid after a newer one is generated, tokens that are checked only for existence rather than for a match against the current pending action, and tokens whose expiry is set too far in the future or not enforced at all. In each case the server keeps a set of live tokens where it should keep exactly one, or none.
The defence is state discipline: when a new token is issued for an action, delete or mark invalid every previous token for that action; when a token is successfully used, delete it immediately; and when the action completes or is cancelled, clear any outstanding tokens. Expiry should be short and enforced server-side at verification time, not only at issuance.
How to test for it
A general method for this bug class:
- Identify every flow that emails or otherwise delivers a short code or link: new device confirmation, email change, password reset, MFA enrolment, invitation acceptance, payment confirmation.
- Trigger the flow twice in a row for the same account and action, keeping both delivered tokens. Note whether the second request is accepted at all or whether the first is silently invalidated.
- Use the older token first and observe whether it is accepted. Then repeat with the newer token. Then try the older token again after the newer one has been used.
- Add a state change in between: cancel the action, remove the device, change the password, or complete the flow, then retry the old token.
- Check expiry by waiting past the stated lifetime and retrying, and check reuse by submitting a token that has already succeeded.
A positive result is any case where a token that should be dead (superseded, already used, or belonging to a cancelled action) still completes the action. Useful signals to record are the exact timestamps of issuance and use, the server responses, and whether the action succeeds on the target account.
Common false positives: the application may intentionally allow a grace window where several recent codes work, which is a design choice rather than a bug; the second request may not actually have generated a new token; or the apparent success may come from a session that was already trusted, so verify from a clean session and confirm the device or action state changed. Also rule out caching and client-side validation that hides a server rejection.
How it is fixed
The standard fix is the one the report proposes: invalidate all previous confirmation tokens as soon as a new token is generated, so at most one token per pending action is live. Beyond that, delete the token on successful use, enforce a short server-side expiry, bind the token to the specific action and account, and reject any token that does not match the current pending record. Logging failed and stale-token attempts helps detect abuse.
Hunting notes
This class tends to hide in flows that are rarely exercised twice: device trust, email and phone changes, MFA reset, API key creation, and anything with a "resend code" button. The resend button is the natural entry point, because it is the feature that creates the second token.
Recon signals include multiple endpoints that issue codes for the same account, tokens that appear in URLs or emails without an obvious server-side record, and flows where the UI hides the previous step after completion. Reading the JavaScript for how the code is submitted can reveal whether the client sends an identifier for the pending action or just the code.
To make a report land, show the full sequence with timestamps, demonstrate that the stale token completes the action on a fresh session, and state clearly what state changed as a result. Keep the demonstration minimal and reproducible, and propose the invalidation fix so the triager can see the intended behaviour.
What happened, in plain words
Coinbase is a service where people hold and move money online. Because of that, it tries hard to know that the person signing in is really the account owner. One of its protections is the new device confirmation: when you sign in from a computer the service has not seen before, it sends a code to your email address. You type that code in, and only then does the service treat that computer as trusted.
A researcher called born2hack looked at this feature and found that the codes are not checked properly. The problem is not that the code is easy to guess. The problem is that an old code keeps working after a newer one has been sent. The report calls this improper authentication, which simply means the step that is supposed to prove who you are can be passed in a way it should not allow.
Think of it like a hotel that gives you a new key card every time you ask at reception, but never switches off the previous card. The old card still opens the door, even though the hotel believes only the newest one works.
The proof of concept, step by step
The report gives a short numbered sequence. The times are examples used to make the order of events clear.
- Sign in on a new computer and ask for a confirmation code twice, about a minute apart. The report uses 12.00 PM and 12.01 PM. Asking twice matters because it creates two codes: an older one and a newer one. The whole bug depends on both existing at the same time.
- Confirm the device with the code that arrived at 12.01 PM, the newer one. Do whatever work you need, then go to the security settings page and remove that device, around 12.30 PM. Removing the device puts the account back into the state where that computer is not trusted, which is what makes the next step possible.
https://www.coinbase.com/settings/security_settings
That address is the account's security settings page, where a user can manage which devices are trusted. The researcher removes the device there so that a fresh confirmation will be needed.
- Confirm the device once again. The server sends a new confirmation code to the user's email address at 12.30 PM. This is the third code in the story, and by any reasonable expectation it should be the only one that works now.
- This time, enter the code that arrived at 12.00 PM, the very first one. The device is confirmed.
That last step is the finding. A code issued half an hour earlier, and already replaced by a newer one, is still accepted. The service behaves as if the old code were still current.
The report does not show the request or response used to submit the code, the length or format of the code, any rate limiting, or how long a code stays valid beyond this example timeline. It records a bounty of 100.00 USD, classifies the weakness as improper authentication, and does not give a severity rating or CVSS score. It was disclosed on 2015-05-25.
Why it matters
The security value of an emailed code rests on a simple promise: only the most recent code, sent to the account owner's inbox, can complete the confirmation. If older codes keep working, that promise is broken. An older confirmation code can still be used later to confirm a device, even after a newer code has been sent.
The report does not describe how an attacker would get hold of an earlier email, and it does not claim that an account can be taken over. It shows the validation flaw itself: a code that should be dead still completes the action.
The fix the report proposes
The researcher's suggested fix is short and direct: invalidate all the previous confirmation tokens as soon as a new token is generated. In plain terms, when the service sends a new code, every earlier code for that same confirmation should stop working immediately. At most one code should be live at any moment.
In general, how this kind of bug works
A token is a short piece of text that stands in for proof of something. A confirmation code in an email is a token. A session cookie, the small file your browser sends with every request so the site remembers you are signed in, is another kind of token. A request is simply the message your browser sends to a server when you click a button or load a page.
One-time tokens are supposed to have three properties:
- They are hard to guess.
- They are tied to one specific action, such as confirming this device for this account.
- They stop working once they are used, or once a replacement is issued.
Bugs appear when one of those properties is dropped. Common variants are tokens that are never deleted after use, tokens that stay valid after a newer one is generated, tokens that are only checked for existence rather than matched against the current pending action, and tokens whose expiry is too long or not enforced on the server at all. In each case the server keeps a pile of live tokens where it should keep exactly one, or none.
The defence is discipline about state, meaning what the server currently remembers about a pending action. When a new token is issued, delete or mark invalid every earlier token for that action. When a token is used successfully, delete it at once. When the action is completed or cancelled, clear anything outstanding. Expiry should be short and checked on the server when the token is submitted, not only when it is created.
In general, how to test for it
A simple method anyone can follow with a browser and an email inbox:
- Find every flow that emails a short code or link: new device confirmation, email change, password reset, two-factor enrolment, invitation acceptance, payment confirmation.
- Trigger the flow twice in a row for the same account and action, and keep both delivered tokens. Note whether the second request is accepted, or whether the first is quietly cancelled.
- Try the older token first and see whether it is accepted. Then try the newer one. Then try the older one again after the newer one has been used.
- Put a state change in between: cancel the action, remove the device, change the password, or finish the flow, then retry the old token.
- Check expiry by waiting past the stated lifetime and retrying, and check reuse by submitting a token that has already succeeded.
A positive result is any case where a token that should be dead, because it was replaced, already used, or belongs to a cancelled action, still completes the action. Record the exact times of issue and use, the server responses, and whether the action really succeeded on the account.
Watch for false positives. The application may deliberately allow a short grace window where several recent codes work, which is a design choice rather than a bug. The second request may not actually have created a new token. The apparent success may come from a session that was already trusted, so test from a clean session and confirm the device state really changed. Also rule out caching and checks done only in the browser that hide a rejection from the server.
In general, how it is fixed
The standard fix is the one proposed here: invalidate all previous tokens as soon as a new one is generated, so at most one token per pending action is live. Beyond that, delete the token on successful use, enforce a short expiry on the server, bind the token to the specific action and account, and reject any token that does not match the current pending record. Logging failed and stale-token attempts helps detect abuse.
Glossary
- Token: a short piece of text that proves something, such as a code emailed to confirm a device.
- Confirmation code: the token sent by email that a user types in to prove they control the account's inbox.
- New device confirmation: the step where a service asks for extra proof before trusting a computer it has not seen before.
- Request: the message a browser sends to a server when a user clicks or loads something.
- Response: the message the server sends back.
- Cookie: a small piece of data the browser stores and sends with requests so the site knows who is signed in.
- Session: the period during which a site remembers a signed-in user, usually tracked with a cookie.
- Improper authentication: a weakness where the step meant to prove identity can be passed when it should not be.
- Validation: checking that something submitted is correct and allowed.
- Invalidate: to make something stop working, such as cancelling an old code.
- Expiry: the point in time after which a token is no longer accepted.
- Replay: sending an old, previously valid value again in the hope it is still accepted.
- Rate limiting: a limit on how often an action can be performed in a period of time.
- CVSS: a standard scoring system for rating the severity of a security flaw.
- Bounty: a payment a company makes to a researcher who reports a valid security flaw.
- Proof of concept: a short, repeatable demonstration that a flaw is real.
- False positive: a result that looks like a bug but is not one.