Skip to content
SQL injection Write-up Intermediate

Blind SQL Injection Found! In Tirreno : Security Analytics

A blind SQL injection in the admin API's loadUsers endpoint allows an attacker to infer and extract arbitrary database data by injecting SQL expressions into the ORDER BY clause. The attacker can enumerate database metadata, user accounts, roles, and permissions, and potentially steal or modify sensitive data.

medium.com

Published on medium.com

In my latest security audit of v0.9.5, I discovered a Blind SQL Injection that allows attackers to infer — and eventually extract — arbitrary data from the database. This blog post walks through:

CyberDucky, 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 directly interpolates user-supplied sorting parameters into the SQL query without validation or sanitisation.

Impact

An attacker could extract database metadata, enumerate user accounts, roles, and permissions, steal or modify sensitive application data, and pivot to further attacks; the text notes that although it does not immediately leak data, it provides a reliable mechanism to retrieve any information stored in the database.

What the attacker needed

Admin token; access to admin API endpoint

The fix

The fix should parameterise all queries, whitelist allowable columns and directions, use query escaping helpers, and adopt security middleware.

How it was found

  1. Send a request to the admin loadUsers endpoint with a valid admin token.
  2. Inject a time-based SQL expression into the columns parameter that causes a delay when a condition is true.
  3. Observe the response time: a normal response is about 200 ms, while the injected payload causes a 5-second delay.
  4. Iterate the technique character by character to enumerate database version, table names, user names, and other data.

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 blind SQL injection is a way to ask the database questions and learn the answers from how the website behaves, even when it does not show error messages. Here, the sorting option in an admin request is placed directly into the database command, so an attacker can add their own database instructions. By making the database wait when a guess is correct, they can slowly read out information one character at a time.

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.