Skip to content
SQL injection Write-up Beginner

How I hacked India’s top company database.

An API endpoint used when placing an order was vulnerable to SQL injection, as shown by a database error in the response. The author used a tool to enumerate the database and dump data from an admin table.

sritharcyber Follow

Published on medium.com

This is my first write-up about a critical vulnerability I recently discovered in a live web application.

Srithar Cyber, 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 into SQL queries without parameterisation, and also returned detailed database errors to the client.

Impact

The author could dump sensitive data from the production database, including an admin table.

What the attacker needed

Access to the order API; none

The fix

The company patched the issue; the write-up also recommends input validation and avoiding detailed error messages in production.

How it was found

  1. Capture the order-placement API request and note its parameters.
  2. Send SQL injection payloads to each parameter one by one.
  3. Observe a database error in the response from one parameter.
  4. Save the full POST request to a file and run a SQL injection tool against it.
  5. Enumerate databases, tables and columns, then dump the admin table.

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.

When you type something into a website, it often goes into a database. If the website builds its database commands by gluing your text straight in, a cleverly crafted input can change the command. Here, an error message showed that the input was reaching the database unsafely, and the author then used a tool to read data out.

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.