Skip to content
SQL injection Write-up Intermediate

I Was Getting 401 Everywhere… Until One Login Field Gave Me Ful

The login form's email field was vulnerable to SQL injection, allowing an attacker to extract database information including user emails, hashed passwords, and internal identifiers. The author confirmed the injection through timing differences and error-based tests, then used UNION queries to dump data.

T4nv1 Follow

Published on medium.com

Every endpoint I touched was locked down properly. APIs needed tokens, panels had rate limits, even error messages were clean.

T4nv1, 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 raw user input was concatenated directly into an SQL query without parameterisation or prepared statements.

Impact

An attacker could access user emails, hashed passwords, and internal identifiers, which the author classifies as high severity, possibly critical depending on scope.

What the attacker needed

Access to the login form; no account needed

The fix

The login form should be fixed by using parameterised queries or prepared statements instead of concatenating user input into SQL.

How it was found

  1. Enter a single quote in the email field and observe a slight delay in the response.
  2. Try a basic OR injection and note that response timing shifts again.
  3. Use ORDER BY with different numbers to find which column count breaks the query.
  4. Use UNION SELECT with NULLs to determine the correct number of columns.
  5. Extract the database version and database name via UNION SELECT.
  6. Enumerate tables and columns from information_schema, then dump user data.

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.

A login form sends what you type into a database query. If the site builds that query by pasting your text directly, you can type special characters that change the query's meaning. Here, the author used a single quote to make the database pause, then crafted queries to read other users' data.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

More by T4nv1

View all

113 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.