Skip to content
SQL injection Write-up Beginner

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.

Menevarad Follow

Published on medium.com

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.

Menevarad, 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

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

  1. Set up a local Docker lab with the vulnerable application.
  2. Open the login page in a browser.
  3. Enter a crafted username that closes the string and comments out the rest of the query, any password, and select admin type.
  4. 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.

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.