bypass two-factor authentication in Android apps and web
A random timeout issue on a Two-Step Verification endpoint could allow an attacker to bypass authentication if multiple incorrect attempts are entered in quick succession. The program states this requires access to the user's email/password or phone number/code and multiple bruteforcing attempts.
- Triaged in 8 days
- Fixed in 59 days
- Paid in 10 days
- Disclosed after 3 months
Summary by the program
A vulnerability was found where a random timeout issue on a Two-Step Verification endpoint could have resulted in a potential bypass of authentication if multiple incorrect attempts were entered in quick succession. It was found that this vulnerability required access to the user's email/password or phone number/code associated with the account and multiple bruteforcing attempts to bypass would be needed.
Summary by the researcher
"The video POC is posted in the links below"
https://twitter.com/lu3ky13 https://www.linkedin.com/in/lu3ky13/ https://www.youtube.com/@cybershieldteam/videos [Ahmad A Abdulla – Medium][NY Times]. [ny times]: https://medium.com/@ahmadaabdulla
Thanks. .
What the report shows
The target is the TikTok Android application, package com.ss.android.ugc.now, and the feature involved is Two-Step Verification. The weakness is classified as an authentication bypass using an alternate path or channel, and the report was disclosed on 9 January 2023 with a medium severity rating.
The program's summary describes the finding as a random timeout issue on a Two-Step Verification endpoint. Under certain timing conditions, that timeout could have resulted in a potential bypass of authentication when multiple incorrect attempts were entered in quick succession. The program also states the preconditions plainly: the vulnerability required access to the user's email and password, or to the phone number and code associated with the account, and bypassing it would have needed multiple bruteforcing attempts.
No request, response, endpoint path, parameter name, header, payload or version string appears in the report text, so there is nothing to reproduce here at the protocol level. The report does not give a bounty amount, a CVSS score, or a description of the fix that was applied.
Step by step, as far as the text goes:
- The researcher identified a Two-Step Verification endpoint whose timeout behaviour was not deterministic.
- By submitting multiple incorrect verification attempts in quick succession, the timeout could be reached in a state that allowed authentication to be bypassed.
- The program assessed the finding as requiring prior knowledge of the account's email and password, or of the phone number and its code, plus repeated bruteforcing.
- The report was disclosed on 9 January 2023.
Root cause
The report points to a timing problem in how the Two-Step Verification endpoint handles its timeout. The report describes a random timeout issue on the endpoint but does not explain the mechanism. The report does not name the endpoint, the parameter carrying the code, or the exact condition that triggers the bypass.
Impact
In the program's own framing, the impact is a potential bypass of Two-Step Verification. The hedges matter: it is described as potential, it depends on a random timeout condition, and it requires the attacker to already hold the account's email and password or the phone number and code. The program describes the bypass as potential and dependent on a random timeout condition. The program notes that multiple bruteforcing attempts would be needed.
How this kind of bug works
Two-factor flows are state machines. A session moves from "password verified" to "second factor pending" to "authenticated", and each transition should be gated by a server-side check that cannot be skipped. Bugs appear when that state is stored or evaluated in a way that can be confused: a timeout that expires the pending state but leaves the session authenticated, a counter that resets on a race, a check that runs before an asynchronous write completes, or a failure path that returns success by default.
Concurrency is the usual lever. When several requests hit the verification endpoint at once, the server may process them in an order the developer did not anticipate: the attempt counter may be read before it is incremented, the lockout may be applied after the response is sent, or the timeout may be refreshed by one request while another is still in flight. The result is that the number of attempts the attacker actually gets is larger than the configured limit, or that a request arriving at the boundary of the timeout is treated as valid.
Defences are straightforward in principle: keep the second-factor state server-side and keyed to the session, make the transition to authenticated atomic and dependent on a successful verification, enforce attempt limits and lockouts in the same transaction that records the attempt, and treat any timeout or error as a failure rather than a pass. Rate limiting at the edge helps but is not a substitute for correct state handling.
How to test for it
- Map the flow. Walk through login with two-factor enabled and record every request between the password step and the final authenticated session, including any polling or status-check endpoints.
- Identify the verification request and the parameters that carry the code, the session identifier and any attempt counter or timestamp.
- Send a single incorrect code and observe the response, the status code, any cookies or tokens set, and whether the session state changes.
- Send a burst of incorrect codes concurrently, using a tool that fires requests in parallel rather than sequentially, and watch for any response that differs from the expected rejection.
- Repeat the burst around the timeout boundary: wait close to the expiry window, then send the burst so that some requests land before and some after it.
- After each burst, check whether the session can now reach authenticated-only resources without a correct code.
A positive result is a response that grants an authenticated session, or a status endpoint that reports verification complete, without a valid code. Common false positives are client-side redirects that look like success but leave the server session unauthenticated, cached responses from a proxy, and rate-limit pages that return a 200 status. Always confirm against a server-side resource that requires the second factor.
How it is fixed
Standard fixes are to make the verification state server-side and atomic, so that only a successful code check moves the session to authenticated; to treat timeouts and errors as failures; to enforce attempt limits and lockouts within the same transaction that records each attempt; and to add server-side rate limiting on the verification endpoint. Idempotency keys or per-session locks around the verification handler prevent concurrent requests from racing the counter.
Hunting notes
This class of bug hides in flows with more than one step and more than one state: two-factor verification, password reset, email or phone confirmation, step-up authentication for sensitive actions, and any endpoint that polls for completion. Recon signals worth watching are endpoints that return different bodies for pending versus complete states, parameters named like attempt counters or expiry timestamps, and mobile APIs where the client is trusted to enforce limits. To make a report land, demonstrate the bypass against a server-side resource, show the precondition honestly (for example that the first factor is required), and quantify how many attempts the burst actually yields compared with the intended limit.
What happened, in plain words
TikTok's Android app, package com.ss.android.ugc.now, offers a feature called Two-Step Verification. When you log in, you first enter your password (or your phone number and the code sent to it), and then you enter a second code. That second code is the extra lock: even if someone steals your password, they still cannot get in without it.
The researcher found a problem in the part of TikTok's servers that checks that second code. The program's summary calls it a "random timeout issue" on a Two-Step Verification endpoint. An endpoint is simply a specific address on a server that the app talks to, like a particular counter in a bank rather than the whole building. A timeout is a time limit: after a certain period the server gives up waiting and moves on. Here, the time limit did not always behave the same way, and when several wrong codes were sent in quick succession, the program says this could potentially have bypassed authentication.
The program was careful about what this means in practice. To exploit it, an attacker would already need the account's email and password, or the phone number and the code associated with the account. They would also need many repeated guessing attempts, known as bruteforcing. So the program describes it as a potential bypass that would need the first factor plus repeated guessing. The report was disclosed on 9 January 2023.
The report text contains no request, response, endpoint path, parameter name, header, payload or version string, so there is no traffic to copy and explain here. It also does not give a bounty amount, a CVSS score, or a description of the fix.
Step by step, as far as the text goes:
- The researcher found a Two-Step Verification endpoint whose timeout behaviour was not consistent.
- By sending multiple incorrect verification attempts in quick succession, the timeout could be reached in a state that allowed authentication to be bypassed.
- The program assessed that the finding required the account's email and password, or the phone number and its code, plus repeated bruteforcing.
- The report was disclosed.
In general, how this kind of bug works
A login with two steps is a sequence of states, like a queue at an airport: check-in, security, gate. A session, which is the server's memory of your visit, moves from "password verified" to "second factor pending" to "authenticated". Each move should be decided by the server, and the last move should only happen after a correct code. Bugs appear when that sequence can be confused. A timeout might expire the pending state but leave the session logged in. An attempt counter might be reset by two requests arriving at once. A check might run before the result is saved. Or an error path might return success by default.
Timing and concurrency are the usual levers. When several requests hit the verification endpoint at the same moment, the server may handle them in an order the developer did not expect: the counter is read before it is increased, the lockout is applied after the reply is sent, or one request refreshes the timeout while another is still in progress. The attacker then gets more attempts than the configured limit, or a request landing right at the timeout boundary is accepted.
In general, the defences are simple in principle. Keep the second-factor state on the server and tied to the session. Make the move to authenticated a single, all-or-nothing step that depends on a correct code. Enforce attempt limits and lockouts in the same operation that records the attempt. Treat any timeout or error as a failure, never as a pass. Rate limiting at the network edge helps but does not replace correct state handling.
In general, testing looks like this:
- Map the flow. Log in with two-factor enabled and record every request between the password step and the final logged-in session, including any status-check requests.
- Identify the verification request and the fields carrying the code, the session identifier, and any attempt counter or timestamp.
- Send one wrong code and note the reply, the status code, any cookies or tokens set, and whether the session state changes.
- Send a burst of wrong codes in parallel rather than one after another, and look for any reply that differs from the expected rejection.
- Repeat the burst around the timeout boundary, so some requests land before it and some after.
- After each burst, check whether the session can reach pages that require login without a correct code.
A positive result is a reply that grants a logged-in session, or a status check that says verification is complete, without a valid code. Common false positives are browser redirects that look like success while the server session is still unauthenticated, cached replies from a proxy, and rate-limit pages that return a 200 status. Always confirm against a server-side resource that genuinely requires the second factor.
In general, the fix is to make the verification state server-side and all-or-nothing, so only a correct code moves the session to authenticated; to treat timeouts and errors as failures; to enforce attempt limits and lockouts together with recording each attempt; and to add server-side rate limiting. Locks around the verification handler, or idempotency keys that stop the same action being processed twice, prevent concurrent requests from racing the counter.
This class of bug hides in flows with more than one step and more than one state: two-factor checks, password resets, email or phone confirmation, extra checks before sensitive actions, and any endpoint that reports completion. Signals worth watching are endpoints that return different content for pending and complete states, fields named like attempt counters or expiry timestamps, and mobile APIs that trust the app to enforce limits. To make a report land, show the bypass against a server-side resource, state the precondition honestly (for example that the first factor is required), and say how many attempts the burst actually yields compared with the intended limit.
Glossary
- Endpoint: a specific address on a server that an app or browser sends requests to.
- Two-Step Verification: a login feature that asks for a second code after the password, so a stolen password alone is not enough.
- Authentication: the process of proving who you are when logging in.
- Authentication bypass: getting past a login or verification step without completing it properly.
- Timeout: a time limit after which the server stops waiting and changes state.
- Session: the server's memory of your visit, usually linked to a cookie or token.
- Cookie: a small piece of data a site stores in your browser to recognise your session.
- Token: a value used in place of a password to prove a session or identity.
- Request: a message a browser or app sends to a server asking for something.
- Response: the server's reply to a request.
- Parameter: a named value sent with a request, such as a code or a counter.
- Header: extra information attached to a request or response, such as content type.
- Payload: the body of a request or response, the actual data being sent.
- Bruteforcing: trying many guesses automatically until one works.
- Concurrency: several requests being handled at the same time.
- Race condition: a bug where the result depends on the order in which simultaneous actions are processed.
- State machine: a system that moves through defined states, such as pending then authenticated.
- Rate limiting: restricting how many requests can be made in a period.
- Lockout: blocking further attempts after too many failures.
- CVSS: a standard scoring system for the severity of a vulnerability.
- Severity: a rating of how serious a vulnerability is.
- Proof of concept (POC): a demonstration that a vulnerability can actually be exploited.
- False positive: a result that looks like a bug but is not one.