SQL Injection
A login form on a private bug bounty program returned a database error when a single quote was submitted in both the email and password fields, showing the input reached a SQL query unsafely. A further attempt with a comment-based payload did not bypass the login but caused the server to disclose the password variable, and a WAF blocked deeper exploitation.
Published on medium.com
{{media:0}}
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 login query was built by concatenating user input into SQL instead of using parameterised queries, so quote characters broke the statement and error details were shown to the user.
Impact
The error message confirmed the injection point, and a further payload could disclose a password value, though a WAF blocked deeper exploitation and login was not bypassed.
What the attacker needed
Access to the private program's login page; no account needed to reach the form
How it was found
- Visit the login page of the private program's admin panel and turn on request interception.
- Try basic login bypass attempts such as common credentials and a simple quote-based condition, which did not work.
- Put a single quote in the email parameter alone, which produced no visible change.
- Put a quote in both the email and password parameters, which returned a MySQL syntax error.
- Try a comment-based bypass payload, which did not grant access but disclosed the password variable.
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 to a database to check your details. If the site builds that database question by gluing your text straight in, a stray quote character can break the question and make the database complain out loud. Here the error message revealed the site was vulnerable, and a later attempt leaked a stored password value.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.