Skip to content
SQL injection Write-up Beginner

How a Simple URL Parameter Exposed Hidden Database Records

The product filtering feature inserted user input directly into a SQL query, allowing an attacker to inject a boolean condition that bypassed the released=1 filter and displayed hidden products.

anoop-ambrose Follow

Published on anoop-ambrose.medium.com

While learning web application security, one of the first vulnerabilities that completely changed the way I looked at websites was SQL Injection. At first, it felt like magic — a simple input changing the behavior of an entire database query.

Anoop Ambrose, on anoop-ambrose.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

Impact

An attacker could retrieve hidden or unreleased products, and in real-world applications this could lead to authentication bypass, exposure of confidential records, or admin account takeover.

What the attacker needed

Access to the product filter page

The fix

The proper fix is to use parameterized queries so user input is treated as data, not executable SQL.

How it was found

  1. Notice the category parameter in the URL changes when selecting a category.
  2. Test with a single quote to see if it breaks the SQL syntax.
  3. Inject a boolean condition to confirm the injection.
  4. Use a comment operator to bypass the released=1 filter and retrieve hidden products.

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 website took whatever you typed in the category filter and pasted it straight into a database command. By adding extra SQL code, the attacker could change the command so it ignored the rule that only shows released products, revealing hidden items.

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.