Skip to content
SQL injection Write-up Intermediate

When SQL Injection Hides Behind Encoding — A Blind SQLi That Automation Missed

A backend API endpoint was vulnerable to time-based blind SQL injection in a parameter that was Base64- and URL-encoded before reaching the database. An attacker could inject SQL that caused measurable delays and, by observing response times, extract database contents such as database and table names.

Xp10it Follow

Published on medium.com

During an authorized security assessment, I identified a time-based blind SQL injection vulnerability in a backend API endpoint. Automated tooling missed it entirely on the first pass — not because the vulnerability was sophisticated, but because the application processed input in a way the tool didn’t account for.

Xp10it, 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 backend decoded the parameter and concatenated it into a SQL query without using parameterised queries or prepared statements, while treating the encoding step as a form of validation.

Impact

An attacker could extract database schema information, including database and table names, through timing alone; the text does not claim access to actual data rows.

What the attacker needed

Network access to the API endpoint; ability to send crafted requests

How it was found

  1. Send a baseline request to the API endpoint and note the normal response time.
  2. Inject a delay-based payload into the u parameter and observe a much longer response time.
  3. Recognise that the parameter is Base64-encoded then URL-encoded before reaching the backend.
  4. Configure sqlmap with an eval expression to apply the same encoding to each payload.
  5. Run sqlmap with time-based technique to confirm the injection and enumerate databases.
  6. Run sqlmap again against the target database to list its tables.

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 application took a value from the URL, decoded it twice, and then put it directly into a database query without separating code from data. Because no error or data came back, the tester measured how long the server took to respond to guess information one character at a time. This is called blind SQL injection: the attacker cannot see query results but can still infer them from timing.

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 Xp10it

View all

5 more disclosed reports, 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.