I Hacked an Application… and What I Found Was Worse Than Expected.
A SQL injection vulnerability allowed access to a database where user passwords were stored in plaintext. An attacker could exploit this to read passwords directly and take over user accounts without cracking hashes.
What started as a routine security assessment turned into one of the most eye-opening findings I’ve encountered.
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 the application built database queries by joining user input directly into SQL strings, and it stored passwords without hashing.
Impact
An attacker could read user passwords directly and use them to access accounts, perform credential stuffing, and potentially compromise other services where passwords are reused.
What the attacker needed
Authorised access to the application; a user input that reaches the database
The fix
The application should use parameterised queries, validate input on the server, and store passwords with a strong hashing algorithm such as Argon2id, bcrypt, or scrypt.
How it was found
- Explore the application and map its endpoints and inputs.
- Notice that one input parameter behaves differently and may reach the database without validation.
- Validate the observation with authorised testing and confirm SQL injection.
- Enumerate the database to see what data is exposed.
- Find a user table with usernames, emails, and plaintext passwords.
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 application let a user's input change the meaning of a database query, so the tester could make the database return extra information. When they looked inside, they found that user passwords were saved as readable text instead of being scrambled (hashed) for protection. That means anyone who got into the database could read every password straight away.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.