How to check that a separate login API does not bypass mandatory MFA
A second-factor screen alone does not show that mandatory MFA is enforced throughout a web product. If users can log in through a separate API, that route must also be included in testing. We explain how to inventory login handlers and compare actual access after completed MFA and after password verification alone. Every action in this example involves an entirely fictional product, a team-owned test environment and a synthetic account.
Define exactly what must be mandatory
MFA requires verification of at least two different authentication factors. A password and a PIN belong to the same factor type, so combining them does not constitute MFA. Before testing, identify the two different factors used in your test account’s standard login process.
User login is the primary place to apply MFA. If there are multiple authentication methods, each must require MFA or have other protective measures. Here, we examine a specific product requirement: the selected protected data must be accessible to this account only after two factors, regardless of the login route. A separate login API deserves attention: OWASP explicitly identifies it as a route that is often overlooked when implementing MFA.
Inventory the routes and define the trust boundary
Obtain the list of handlers from your own application configuration and documentation. For each, record its purpose, address, applicability to the test account and expected MFA requirement. Include the web form and separate API if your product provides them. This is an inventory of routes you already know about, not a search for addresses on third-party systems.
The boundary being tested lies between verification of a correct password and the state in which the application permits retrieval of protected data after MFA. Session management lets the server retain interaction state and determine how subsequent requests are handled. Testing must therefore cover both the login handler’s response and the access the client receives with the resulting state. The login page and subsequent authenticated pages must exclusively use TLS or another secure transport.
Prepare a fictional example and a positive control
Consider an entirely fictional web product called “Mockup.” Its team-owned test environment has a web form, a separate login API and a synthetic account called “Test Editor.” MFA is mandatory for this account. Prepare a protected record with recognizable content, such as “Training report — sample 42,” and define exactly what will count as retrieving it.
The following checks are acceptance tests devised for this article, not a quotation or an official OWASP procedure. First, complete the standard login with two different factors in a clean client context. Then request the prepared record using the method specified in your application’s documentation. The positive control passes if the client actually receives the expected synthetic data. If the record is unavailable even after a complete login, the comparison is not yet conclusive: first establish the cause and get the control working.
Compare access after a password alone through the API
Create a new, isolated client context. Through the separate API, complete only verification of the correct password for the same synthetic account. Do not complete the second factor. Obtain the handler address and the method for passing state from your own application’s documentation. Use only the state obtained during this attempt; transfer nothing from the positive control.
In this context, request the same protected record. The acceptance criterion is that its contents remain unavailable until MFA is complete. If the client receives “Training report — sample 42” after a password alone, the behavior violates the specified mandatory MFA requirement. If the data is unavailable, save the application’s actual response and record the result specifically for this route and state. An MFA screen, a success message or an individual HTTP status code cannot, on their own, replace checking the response contents.
What to fix and in what order
If a discrepancy is found, the first priority is to bring the separate API into line with the agreed requirement: the state following verification of a password alone must not provide access to the selected protected data. Checks for completed MFA must be consistent across login handlers and subsequent request handling. Evaluate the fix using the same observable result that revealed the discrepancy.
Then repeat the positive and negative tests for every handler in the inventory. For each pair, record the login route, completed factors, isolated context and actual availability of the prepared record. After the fix, a complete login must still allow the data to be retrieved, while an attempt following a password alone must leave it unavailable. A single successful HTTP response proves neither that the required login state was accepted nor that access was denied.
Limits of the result and the next step
This comparison confirms behavior only for the tested routes, states and single test account. It does not prove the absence of all bypasses or provide statistical guarantees of security. This article does not cover OTP implementation, factor replacement and recovery, JWT configuration, session lifetimes or checks for access to other users’ objects. The task here is narrower: to establish consistency in mandatory MFA across login handlers based on actual access to your own synthetic data.
If you need help assessing a web product, you can start with a free website or web-product audit from CheckMyApp. To discuss this check, prepare your inventory of login routes, the expected MFA rule and the comparison results from your own test environment: these will show where the requirement is met and where a discrepancy remains.