Skip to content
SQL injection Write-up Beginner

From Critical to Low: 6 Vulnerabilities That Exposed a Web Applic

A search parameter was vulnerable to SQL injection, allowing an attacker to dump all database records. The same error also leaked server details, file paths, and an API token.

Seafeldeenwael Follow

Published on medium.com

I recently started my journey into bug hunting. Initially, when I looked for targets on popular platforms like HackerOne, Bugcrowd, and YesWeHack, I struggled to find suitable websites to test.

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

Likely the application concatenated user input directly into SQL queries without proper sanitisation or parameterisation.

Impact

An attacker could retrieve all database records and also obtain sensitive information such as server version, file paths, and an API token.

What the attacker needed

None

How it was found

  1. Enter a single quote as the search keyword.
  2. Observe the verbose error message and leaked information.
  3. Modify the payload to inject a true condition.
  4. See all database records displayed on the search results page.

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 search box on a website was not handling special characters safely. When a tester typed a single quote, the site showed a big error and then, with a slightly different input, it showed all the data stored in its database. This happens when the website mixes user input directly into database commands.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

More by Seafeldeenwael

View all

1 more disclosed report, best first.

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.