Skip to content
SQL injection Write-up Intermediate

Sql İnjection Nedir &Karşılaştığım Vaka

A store-locator endpoint on an ecommerce platform passed a store identifier into a SQL query, and the author found that changing the request body format to JSON and sending an arithmetic expression on the identifier returned a different store's data. Using a UNION-based query the author could then read table and column names from the database schema.

akostak Follow

Published on medium.com

https://www.linkedin.com/in/ali-kostak-83356b217/

Ali, 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 store identifier from the JSON request body was concatenated into a SQL query instead of being sent as a bound parameter.

Impact

An attacker could read store records and database schema details through the store-locator response, and potentially other data the query could reach.

What the attacker needed

Access to the store-locator feature; ability to send a modified POST request

How it was found

  1. Find the store-locator feature that loads stores for a city via a POST request.
  2. Send an arithmetic expression on the store identifier in the JSON body and observe that a different store's data comes back.
  3. Work out the number of columns so a UNION query matches the original SELECT.
  4. Read data from the response and pull table and column names from the schema information.

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 website often builds database questions by gluing together text, including whatever the user typed. If that text is not treated as plain data, a user can add extra database instructions and make the site return information it never meant to show. Here the store number field allowed exactly that, so the author could read other records and the list of tables in the database.

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 akostak

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.