The Prefix, The Suffix, and the SQL Injection That Almost Got Away
A parameter on a search page was vulnerable to time-based SQL injection, confirmed by controlled delays in the response. An attacker could use this to extract data from the database.
I always tell my sons, “You learn something every day.” But let’s be honest — that’s not always true. However, once in a while, you do learn something valuable, and this was one of those times.
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 sortBy parameter was concatenated directly into a SQL query without parameterisation or validation.
Impact
An attacker could extract arbitrary data from the database, as demonstrated by dumping tables.
What the attacker needed
Access to the search page; none
How it was found
- Send a request to the search page with a time-delay payload in the sortBy parameter.
- Measure the response time and observe the delay matching the requested seconds.
- Repeat with different delay values to confirm the timing is controlled.
- Use an automated tool with a prefix and suffix so the payload is formed correctly.
- Dump the database contents.
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 was building a database query using text taken straight from a URL parameter, without treating it as data. By sending a special value that tells the database to wait, the tester proved they could run their own database commands and read stored information.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.