At a glance
- Controls
- CWE-799 · A07:2021 Identification and Authentication Failures
What it is
Many products send a six-digit code by text or email to confirm a sign-in, a password reset or a payment. There are only a million such codes. If the product accepts wrong guesses without limit, a script can try them all while the code is still valid.
An attacker starts the flow for a victim's account, then sends guess after guess to the verify step. One correct guess hands over the account or approves the action. AI-assisted attackers find these verify endpoints quickly by reading app traffic and public code, then write the guessing script in minutes.
Where it hides
What a reviewer can look for in the code and in the behaviour, before anyone proves it.
- Password reset verify endpoints
- Second-factor and new-device sign-in checks
- Phone number or email change confirmations
- Payment and payout approval steps in the mobile app
How MATT tests it
The proof runs against the deployed product, on every release, whoever wrote the code.
- 01Start a code flow for a MATT test account and note how long the code stays valid.
- 02Submit a small number of wrong codes to the verify step and watch the responses.
- 03Confirm whether the code is voided or the flow locks, then finish the flow with the real code to show the account is unharmed.
A one-time code must lock after a few wrong attempts.
Executable checkas test user: request a one-time code submit 5 wrong codes to POST /v1/verify-code expect: the code is voided or the flow locks expect: the correct code now fails and a new one must be requested
Every rule MATT holds →What the fix looks like
- 01
Allow a small, fixed number of wrong attempts per code, then void it.
- 02
Track attempts on the server against the code itself, so new sessions cannot reset the count.
- 03
Keep codes short‑lived and limit how often new codes can be requested.
- 04
Use longer codes or app‑based approval for high‑value actions.
A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →