AVOIDING INFORMATION DISCLOSURE THROUGH LOGIC FLAWS (Python)
The login form concatenated user input directly into an SQL query and printed the resulting database error to the user. An attacker could use the leaked query structure and database type to refine an SQL injection attack.
medium.com
Published on medium.com
Hi Everyone! My name is Abdulkarim, a 3rd year Software Student of Nanchang University, security enthusiast, and emerging Bug Bounty Hunter.
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 used string concatenation to build SQL queries and displayed raw exception messages to the user.
Impact
An attacker could learn the database type and query structure, which may help refine an SQL injection attack.
What the attacker needed
Access to the login form
The fix
The login should use parameterized queries and show only a generic error message while logging details internally.
How it was found
- Open the login form and enter a crafted username containing SQL syntax.
- Leave the password empty and submit.
- Observe the database error message displayed by the application.
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 app built a database command by gluing together whatever the user typed. When the command was malformed, the app showed the database's error message, which revealed how the command was built. That helps an attacker craft a better attack.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.