Skip to content
Account takeover Write-up Intermediate

From Source Code Disclosure to a Hardcoded Backdoor: How I Achieved Full Authentication Bypass

An exposed backup archive allowed download of the full source code, which revealed a hardcoded password string that bypasses normal password verification. An attacker could log in as any active user, including administrators, by supplying that string as the password.

m.bafy10 Follow

Published on medium.com

During a authorized security assessment of a target web application, a multi-stage critical vulnerability chain was discovered. First, an unauthenticated remote attacker could discover and download a publicly accessible compressed archive containing the application’s complete source code.

M0stafaX404, on 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

Root cause

Likely a hardcoded fallback password check combined with a publicly accessible source code archive.

Impact

An attacker could gain full administrative access to any active account without knowing the real password, leading to data leakage and integrity loss.

What the attacker needed

Publicly accessible backup archive; knowledge of a valid username

The fix

The hardcoded backdoor should be removed and the exposed archive should be moved out of the public web root.

How it was found

  1. Find the publicly accessible backup archive at the web root.
  2. Download and extract the archive to obtain the source code.
  3. Review the authentication model and identify the hardcoded password bypass.
  4. Intercept the login request and replace the password with the hardcoded string.
  5. Submit the request and gain access to the administrative dashboard.

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.

The website left a backup file of its own code where anyone could download it. Inside that code was a secret password that always works, no matter what the real password is. So anyone who found the file could log in as any user, even an administrator.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More by m.bafy10

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.