Skip to content
SQL injection Disclosed report Intermediate

Blind SQL Injection on █████ via URI Path

A time-based blind SQL injection existed in the URI path of a web application, allowing an attacker to infer database contents from response delays. The report text only describes the general technique and does not give reproduction details or specific impact.

stuux Follow

Originally disclosed on HackerOne

Critical 9.6 View original
  • Triaged in 3 hours
  • Fixed in 6 days
  • Disclosed after 3 months

Summary by the program

Time-based SQL injection is a hacking technique that capitalizes on vulnerabilities in systems interacting with databases. Unlike traditional SQL injection methods that directly manipulate data, this approach leverages delays in database processing to extract information. Attackers insert malicious SQL statements into input fields of web applications lacking sufficient security measures. If successful, these statements execute against the database, and by intentionally causing delays in processing, the attacker can infer information about the database structure or obtain sensitive data based on the application's response time to specific queries.

The original report as published on HackerOne, by stuux. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What the report shows

The target is the asset *.miroyalcanin.cl, and the weakness is classified as SQL injection with a critical severity and a CVSS score of 9.6. The report was disclosed on 14 February 2024 under the Mars program on HackerOne, credited to the researcher stuux. No bounty amount is recorded.

The disclosed text is short. It consists of a summary written by the program rather than a step-by-step account from the researcher, and it does not include the affected endpoint, the vulnerable parameter, the requests sent, the payloads used, the delays observed or the fix applied. What it does describe is the class of attack: time-based SQL injection.

The program's summary explains the technique as follows. Time-based SQL injection exploits vulnerabilities in systems that interact with databases. Unlike traditional SQL injection methods that directly manipulate data, this approach uses delays in database processing to extract information. An attacker inserts malicious SQL statements into input fields of web applications that lack sufficient security measures. If the statements execute against the database, the attacker can infer information about the database structure or obtain sensitive data by intentionally causing delays in processing and observing how long the application takes to respond to specific queries.

The title refers to the URI path, but the report gives no reproduction detail confirming where the vulnerable input sits. Beyond that, the report gives no reproduction detail.

Root cause

The report does not analyse the code behind the vulnerability. The summary frames the underlying condition as an application lacking sufficient security measures around the input it passes to the database.

Impact

The report rates the issue critical at 9.6. The summary states that a successful attacker can infer information about the database structure or obtain sensitive data, using response timing as the channel. It does not state which data was reachable, whether the researcher demonstrated extraction, or what the practical limits were on the target. Those specifics are not in the disclosed text.

How this kind of bug works

In a time-based blind SQL injection, the application does not reflect query results or error messages back to the attacker, so the attacker cannot read data directly. Instead, the injected SQL is crafted so that its truth value controls whether the database pauses before answering. A conditional expression is combined with a delay primitive: if the condition is true, the database sleeps for a fixed interval; if false, it returns immediately. The attacker measures the response time and treats a long response as a binary one, a short response as a zero. By asking many such yes/no questions, character by character, the attacker reconstructs schema names, table names and row contents.

The delay primitive is database-specific: MySQL and MariaDB offer SLEEP(), PostgreSQL offers pg_sleep(), Microsoft SQL Server uses WAITFOR DELAY, and Oracle uses DBMS_LOCK.SLEEP. The condition is usually built with subqueries and string functions so that a single character of a single value can be tested per request.

The bug happens when user input is concatenated into SQL text rather than bound as a parameter. It applies equally to values in the path, query string, headers, cookies and request bodies, and to any second-order path where stored input is later used in a query. Defences are parameterised queries or prepared statements, strict allow-listing of values that cannot be parameterised (such as sort columns and table names), least-privilege database accounts, and removal of verbose database errors from responses. Time-based injection is harder to detect than error-based injection precisely because the application gives nothing away except latency, so monitoring for unusual response-time patterns and for delay functions in query logs also helps.

How to test for it

  1. Map every input that reaches the application, including path segments, query parameters, cookies, headers and JSON or form fields. Path-based inputs are easy to overlook because tooling often focuses on parameters.
  2. Establish a baseline: send the request unchanged several times and record the typical response time and its variance. A stable baseline is essential, because the whole technique rests on timing differences.
  3. Send a benign delay probe that does not depend on any condition, for example a database-specific sleep function appended in a syntactically valid way for the suspected backend. If the response is consistently delayed by roughly the requested interval, the input reaches the database unsanitised.
  4. Confirm with a conditional probe: a true condition paired with the delay and a false condition without it. The true case should be slow and the false case fast, repeatably. Swap the conditions to rule out coincidence.
  5. Only then move to extraction, testing one bit or character at a time with conditional delays, and keep the request rate low enough that the timing signal stays clean.

A positive result is a reproducible, condition-dependent difference in response time that matches the injected interval and disappears when the injection is removed or escaped. Common false positives include network jitter and server load, caching layers that answer some requests faster, rate limiting or WAF behaviour that adds latency, and application logic that is simply slow for certain inputs. Repeat each probe several times, compare medians rather than single samples, and prefer larger delays over small ones to separate signal from noise. Also check whether the delay appears with a syntactically invalid payload, which would suggest the timing comes from error handling rather than from executed SQL.

How it is fixed

The standard fix is to stop building SQL by string concatenation. Use parameterised queries or prepared statements so that user input is bound as data and can never be parsed as SQL syntax. Where a value cannot be bound, such as a column name in an ORDER BY clause, validate it against a fixed allow-list. Run the application's database account with the minimum privileges it needs, so that even a successful injection cannot read or modify unrelated data. Suppress detailed database error messages from responses, and add server-side timeouts and query monitoring so that injected delay functions are visible in logs.

Hunting notes

Time-based injection hides wherever input reaches a query but the response reveals nothing: search endpoints, filters, sorting and pagination parameters, report exports, and API paths where an identifier is part of the URI. Path-based injection in particular is worth testing on applications that route on segments such as identifiers or slugs, because these values are frequently concatenated into queries by hand.

Recon signals include parameters that accept numeric or structured values, endpoints that behave differently for valid and invalid identifiers, and stack traces or database error pages that reveal the backend engine, which tells you which delay primitive to use. Frameworks that encourage raw query building, or legacy code paths alongside a modern ORM, are worth a closer look.

To make a report accepted, demonstrate the timing difference reproducibly with paired true and false conditions, include the exact requests and the measured response times, and show that removing the payload restores normal timing. Where possible, extract a small, non-sensitive proof such as the database version or the current user rather than dumping user data, and state clearly what an attacker could reach. Keep the evidence tight: a clear conditional delay is far more convincing than a single slow response.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 8 min read.

What happened, in plain words

This report is about a website belonging to the Mars program, on a domain matching *.miroyalcanin.cl. A security researcher named stuux found a serious flaw in it and reported it through HackerOne, a platform where researchers send bugs to companies. The report was made public on 14 February 2024. The flaw is classified as SQL injection, rated critical, with a CVSS score of 9.6. CVSS is a standard scoring system: 9.6 out of 10 means the problem is severe. No bounty amount is recorded.

The title of the report is "Blind SQL Injection on █████ via URI Path". The title contains a redacted part. The important words are "blind", "SQL injection" and "URI path".

To understand those, start with two ideas. A database is the organised store where a website keeps its information: user accounts, products, orders, page content. A query is a question the website asks that database, written in a language called SQL, for example "give me the product with this identifier". Normally the website builds the query itself and the database answers it.

SQL injection happens when a website lets a visitor's input become part of that query instead of staying plain data. Imagine a form where you write your name and the website pastes it straight into a sentence it sends to the database. If you write something clever instead of a name, the database may treat your words as instructions. That is the essence of the bug.

Blind means the website does not show you the database's answer. You ask a question, but you never see the reply directly. Time-based is the trick used to get around that: the attacker makes the database pause on purpose when a condition is true, and answer immediately when it is false. By timing how long the page takes to load, the attacker learns the answer, one yes/no question at a time. It is like asking a locked room "is the first letter of the password an A?" and getting only a knock on the wall, slow for yes, fast for no.

The title also says URI path. A web address has parts. In https://example.com/shop/product/42, the part after the domain, /shop/product/42, is the path. The title refers to the URI path, though the report does not confirm where the vulnerable input sits. That matters because people often test forms and forget the address itself.

What the report actually contains is a short summary written by the program, not a step-by-step account from the researcher. It does not include the exact endpoint, the parameter, the requests sent, the payloads used, the delays measured or the fix applied. So there is nothing to copy and explain line by line here. What it does explain is the technique itself, and that explanation is worth reading closely.

The summary says time-based SQL injection exploits systems that interact with databases. Unlike traditional SQL injection, which directly manipulates data, this approach uses delays in database processing to extract information. An attacker inserts malicious SQL statements into input fields of web applications that lack sufficient security measures. If those statements run against the database, the attacker can infer information about the database structure or obtain sensitive data by intentionally causing delays and watching how long the application takes to respond to specific queries.

In plain terms: the attacker cannot see the data, so they ask the database questions whose answers change how long it takes to reply. A slow reply means yes, a quick reply means no. Enough yes/no answers rebuild names of tables, names of columns and eventually the contents of rows. The report rates this critical at 9.6, but it does not say which data was reachable or whether extraction was actually demonstrated.

In general, how this kind of bug works

A time-based blind injection works because the application gives nothing away except speed. The attacker writes a condition into the query and pairs it with a delay command. If the condition is true, the database waits a fixed interval before answering. If it is false, it answers at once. The attacker measures the response time and treats a long wait as a one and a short wait as a zero. Many such questions, character by character, reconstruct the database.

The delay command depends on which database is running. MySQL and MariaDB offer SLEEP(), PostgreSQL offers pg_sleep(), Microsoft SQL Server uses WAITFOR DELAY, and Oracle uses DBMS_LOCK.SLEEP. The condition is usually built with subqueries and string functions so that one character of one value can be tested per request.

The root cause is the same as for any SQL injection: user input is glued into the SQL text instead of being passed as a separate value. This can happen in the path, the query string, headers, cookies and request bodies, and also when stored input is used in a query later. The defences are parameterised queries (also called prepared statements), where input is bound as data and can never be read as SQL; strict allow-lists for values that cannot be bound, such as column names; database accounts with the least privilege they need; and removal of detailed database errors from responses. Because time-based injection reveals itself only through latency, watching for unusual response-time patterns and for delay functions in query logs also helps.

How to test for it

  1. Map every input that reaches the application: path segments, query parameters, cookies, headers, and JSON or form fields. Path inputs are easy to miss because tools often focus on parameters.
  2. Establish a baseline. Send the request unchanged several times and record the typical response time and how much it varies. A stable baseline is essential, because the whole technique rests on timing differences.
  3. Send a delay probe that does not depend on any condition, using the sleep function for the suspected database, written so the query stays syntactically valid. If the response is consistently delayed by roughly the requested interval, the input reaches the database unsanitised.
  4. Confirm with a conditional probe: a true condition with the delay, and a false condition without it. The true case should be slow and the false case fast, repeatably. Swap the conditions to rule out coincidence.
  5. Only then extract data, one bit or character at a time, keeping the request rate low enough that the timing signal stays clean.

A positive result is a reproducible, condition-dependent difference in response time that matches the injected interval and disappears when the injection is removed or escaped. Common false positives include network jitter and server load, caching layers that answer some requests faster, rate limiting or a web application firewall adding latency, and application logic that is simply slow for certain inputs. Repeat each probe several times, compare medians rather than single samples, and prefer larger delays to separate signal from noise. Also check whether the delay appears with a syntactically invalid payload, which would suggest the timing comes from error handling rather than from executed SQL.

How it is fixed

The standard fix is to stop building SQL by string concatenation. Use parameterised queries or prepared statements so that user input is bound as data and can never be parsed as SQL syntax. Where a value cannot be bound, such as a column name in an ORDER BY clause, validate it against a fixed allow-list. Run the application's database account with the minimum privileges it needs, so that even a successful injection cannot read or modify unrelated data. Suppress detailed database error messages from responses, and add server-side timeouts and query monitoring so that injected delay functions are visible in logs.

Where to look

Time-based injection hides wherever input reaches a query but the response reveals nothing: search endpoints, filters, sorting and pagination parameters, report exports, and API paths where an identifier is part of the address. Path-based injection is worth testing on applications that route on segments such as identifiers or slugs, because these values are often concatenated into queries by hand. Signals worth noting during reconnaissance include parameters that accept numeric or structured values, endpoints that behave differently for valid and invalid identifiers, and stack traces or database error pages that reveal the backend engine, which tells you which delay function to use. Frameworks that encourage raw query building, or legacy code paths alongside a modern ORM, deserve a closer look.

To get a report accepted, show the timing difference reproducibly with paired true and false conditions, include the exact requests and the measured response times, and show that removing the payload restores normal timing. Where possible, extract a small, non-sensitive proof such as the database version or the current user rather than dumping user data, and state clearly what an attacker could reach. A clear conditional delay is far more convincing than a single slow response.

Glossary

  • SQL: the language websites use to ask questions of a database.
  • Database: the organised store where a website keeps its data.
  • Query: a question sent to the database in SQL.
  • SQL injection: a flaw where visitor input becomes part of a query instead of staying plain data.
  • Blind injection: an injection where the application does not show the database's answer directly.
  • Time-based injection: a blind technique that learns answers by measuring how long the application takes to respond.
  • URI path: the part of a web address after the domain, such as /shop/product/42.
  • Endpoint: a specific address on a website that accepts requests.
  • Parameter: a named value sent with a request, in the address, the body, a cookie or a header.
  • Payload: the crafted input an attacker sends to trigger a flaw.
  • CVSS: a standard scoring system for the severity of a security flaw, from 0 to 10.
  • Severity: how serious a flaw is judged to be.
  • HackerOne: a platform where researchers report bugs to companies.
  • Bounty: a reward, usually money, paid for a valid report.
  • Disclosure: making a report public.
  • Delay primitive: the database command that makes a query pause, such as SLEEP().
  • Conditional probe: a test where a true condition triggers a delay and a false one does not.
  • Baseline: the normal response time recorded before testing, used for comparison.
  • False positive: a result that looks like a finding but is caused by something else.
  • Parameterised query: a query where input is bound as data and cannot be read as SQL.
  • Prepared statement: another name for a parameterised query.
  • Allow-list: a fixed list of permitted values, used when a value cannot be bound.
  • Least privilege: giving an account only the access it actually needs.
  • ORM: a tool that maps database tables to code objects and can reduce hand-built queries.
  • WAF: a web application firewall, which filters requests before they reach the application.
  • Rate limiting: restricting how many requests a client may send in a period.
  • Reconnaissance: the information-gathering stage before testing.

More from Mars

View all

The newest disclosed reports for this program.

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.