Skip to content
Access control Write-up Intermediate

“Day 18: The Invisible Backdoor — How a Typo in a Config File Neutralized Multi-Factor Authentication”

A configuration file contained a setting that bypassed multi-factor authentication for requests from internal IP addresses, and the application trusted the X-Forwarded-For header to determine the client IP. An attacker could add a spoofed X-Forwarded-For header to a login request and obtain a valid session without providing a second factor.

Aman Sharma Follow

Published on amannsharmaa.medium.com

During a penetration test for a financial institution last quarter, I hit a wall. Their login portal had robust MFA, hardware security keys, and impeccable audit logs.

Aman Sharma, on amannsharmaa.medium.com

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

Impact

An attacker with valid credentials could bypass MFA and obtain a session, but the text does not state whether this was actually exploited in production.

What the attacker needed

Valid user credentials; ability to intercept and modify requests; access to the login endpoint

The fix

The application should not trust the X-Forwarded-For header for security decisions; client IP should be validated at the network edge, and MFA bypass settings should be removed from production.

How it was found

  1. Send a normal login request and intercept it.
  2. Add an X-Forwarded-For header with a value from the trusted internal range.
  3. Observe that the server issues a valid session cookie instead of redirecting to the MFA page.

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.

Multi-factor authentication (MFA) asks for a second proof of identity, like a code from a phone. The application had a hidden rule: if a login came from an internal network address, skip MFA. Because the application believed a header that anyone can set, an attacker could pretend to be on the internal network and log in without the second code.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Aman Sharma

View all

34 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.