How I Found My First CVE — SQL Injection Authentication Bypass
The login form of CodeAstro Simple Attendance Management System 1.0 builds a SQL query by directly inserting user-supplied username and password values, allowing an unauthenticated attacker to bypass authentication and gain full admin access.
My name is Varad AP Mene, an independent security researcher and bug hunter from India. Over the past few years I have been actively hunting vulnerabilities across the web and have successfully secured 100+ organizations including tech giants like NVIDIA, NASA, and many more through responsible disclosure.
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
The application concatenates user input directly into an SQL query without sanitisation or prepared statements.
Impact
An unauthenticated attacker could gain full admin access, exposing and allowing modification of all student attendance records.
What the attacker needed
Access to the login page; no credentials needed
The fix
The application should use prepared statements or parameterised queries instead of concatenating user input into SQL.
How it was found
- Set up a local Docker lab with the vulnerable application.
- Open the login page in a browser.
- Enter a crafted username that closes the string and comments out the rest of the query, any password, and select admin type.
- Submit the form and observe full admin panel access without valid credentials.
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 login page puts whatever you type directly into a database command without checking it. By typing special characters, an attacker can trick the database into ignoring the password check and logging them in as the admin. This is called SQL injection.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.