Skip to content
SQL injection Write-up Intermediate

My First NoSQL Injection Bug | by Burhanu Rasheed

A NoSQL injection vulnerability was found in a URL path of a Red Bull subdomain, where a sleep payload caused a six-second server delay. An attacker could potentially execute arbitrary NoSQL commands, though the report only demonstrates a time delay.

burhanxd.medium.com

Published on burhanxd.medium.com

Bug Bounty

Burhan Chhotaudepur, on burhanxd.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

This is a write-up of a first NoSQL injection finding on a RedBull bug bounty program, submitted through Intigriti. The researcher does not disclose the subdomain and refers to it throughout as redacted.redbull.com. The affected host had little content: a front page and some links, with no obvious parameters to test. The report does not describe the application's purpose beyond that.

Setup

The researcher had been hunting for about three months and had prior front-end web development experience with HTML and JavaScript. The tools used were:

  • A custom bash script for reconnaissance, used to collect live subdomains.
  • Burp Suite, left running in the background while subdomains were reviewed manually.
  • A public MongoDB NoSQL injection wordlist from GitHub (cr0hn/nosqlinjection_wordlists, file mongodb_nosqli.txt).

No accounts, roles or special access are mentioned. The only precondition was a live subdomain that accepted requests and could be reached directly.

Finding it

Reconnaissance started on a Wednesday. The custom bash script produced a list of live subdomains, which the researcher reviewed manually. Two issues turned up along the way, a CORS misconfiguration and a CVE, but neither was exploitable because both domains were described as somewhat dead. Nothing else came out of that day.

Hunting resumed the next morning from where it had stopped. After about an hour of crawling, one subdomain stood out: it looked good, had little content, only a front page and some links. While poking at it, Burp flagged a possible NoSQL injection in the headers and cookies. On reproduction it turned out to be a false positive.

Because the site had no parameters, the next attempt targeted the Referer header and cookies, firing payloads from the GitHub wordlist manually. Half an hour of that produced nothing. After a ten minute break, the researcher tried placing a payload directly after the host in the path, redacted.redbull.com/. The sleep payload was pasted there and the server delayed its response by six seconds.

Exploitation

Step 1: Confirm the delay in the path

The payload was appended to the root path of the host:

The payload itself:

Text
';sleep(6000);

The report does not explain how the payload works internally; it only records that the server delayed its response by six seconds. The trailing semicolon and quote close the injected statement. The server delayed the response by six seconds, which the researcher treated as confirmation of time-based injection.

Step 2: Verify with a second person

The delay was confirmed with a friend before the report was written and submitted on Intigriti.

Step 3: Reproduction fails the next day

The following day the researcher tried to reproduce the issue and could not. The friend's advice was that a strong proof of concept would still be accepted, otherwise the report might be closed as N/A. Over the weekend the triager stated that they were not able to reproduce it and believed it could be a false positive.

Step 4: Escalate to the internal team

The researcher replied asking the triager to forward the report to the internal team, in case the issue had been detected and fixed unintentionally. The triager forwarded it. On Monday evening the program manager asked for the proof-of-concept video that had been mentioned in the report. The video was forwarded, and shortly afterwards the report was accepted as critical and resolved.

Accepted as CRITICAL and resolved xD From the original on burhanxd.medium.com

The screenshot shows the report accepted as critical and resolved.

Root cause

What the behaviour implies is that user-controlled input taken from the URL path was concatenated into a database query without proper handling, so that a quote and a statement separator could break out of the intended query and run a sleep call. The delay disappeared the next day; the researcher asked the triager whether the issue might have been detected and fixed unintentionally.

Impact

The report does not analyse impact beyond the demonstrated time delay. A time-based injection of this kind, if it had remained exploitable, would let an attacker run queries against the backing database through the vulnerable path. The report gives no evidence of data access, and the only observed effect is the six second response delay.

Fix

The status was set to resolved after the video proof of concept was reviewed, and the researcher's own theory is that the issue was fixed on the server side before the second reproduction attempt. The general remedy for this class of bug is to stop building queries by string concatenation and to pass user input as bound parameters, or to validate and reject input that contains query syntax.

Variants to test

  • Headers and cookies. The first automated hit appeared in headers and cookies, though it was a false positive there. Send the same sleep payloads through the Referer header and cookie values and look for a consistent delay.
  • Path segments. As here, append the payload directly after the host and after individual path segments, for example a path that ends in a quote followed by a sleep call. A positive result is a repeatable delay proportional to the sleep value.
  • Wordlist payloads. Run the MongoDB NoSQL injection wordlist against every input that reaches the backend, including ones with no visible parameters. A positive result is a response that differs consistently from the baseline for the same request without the payload.
  • Timing controls. Repeat each candidate payload several times and compare against a clean request, so that a one-off slow response is not mistaken for injection. The report's own experience shows why: the first hit was a false positive and the confirmed one later stopped reproducing.

Timeline

Event Date
Reported 25 February
Status changed to pending 27 February
Accepted and closed as resolved 1 March

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

A security researcher found a bug in a RedBull website that let him make the server wait on purpose. He could put a special string in the URL path, and the server would pause for six seconds before answering. That pause is a sign that the command reached the database behind the website. He reported it through a bug bounty platform called Intigriti. The next day he could not make it happen again, and he asked whether the company might have fixed it without realising. He sent a video showing the delay, and the report was accepted as critical and marked resolved.

This article walks through the same steps for someone who has never done security testing. You only need a browser and a computer to follow along. We will explain every term the first time it appears.

The setup

The researcher had been doing bug bounty hunting for about three months. Bug bounty is a scheme where companies invite people to test their systems and pay for valid reports. Before that he had built websites, so he knew some HTML and JavaScript. HTML is the language that describes what a web page contains, and JavaScript is the language that makes pages interactive in the browser.

He used three tools:

  1. A custom bash script. Bash is a command-line shell on Linux and macOS. A script is a text file with a list of commands. His script collected live subdomains. A subdomain is a name like shop.example.com that sits under a main domain like example.com.
  2. Burp Suite. This is a program that sits between your browser and a website and lets you see and change every request and response. A request is the message your browser sends to a server asking for a page or data; a response is the server's reply.
  3. A public wordlist from GitHub. A wordlist is a file full of test strings. This one, from cr0hn/nosqlinjection_wordlists, file mongodb_nosqli.txt, contains strings designed to test for NoSQL injection. NoSQL is a family of databases that do not use the traditional table-and-row model; MongoDB is one popular NoSQL database. Injection means slipping extra commands into input so the database runs them.

No accounts or special access were needed. The only precondition was a live subdomain that answered requests.

Finding it

Reconnaissance started on a Wednesday. Reconnaissance, or recon, means gathering information about a target: which subdomains exist, which are alive, what they run. The bash script produced a list of live subdomains, and the researcher looked at them one by one in his browser.

Two issues turned up along the way. One was a CORS misconfiguration. CORS stands for Cross-Origin Resource Sharing; it is a set of rules that decides which other websites are allowed to read data from a site. A misconfiguration means those rules are too loose. The other was a CVE. CVE is a public catalogue number for a known vulnerability, like a reference number for a security flaw. Neither was exploitable because both domains were described as somewhat dead, meaning they did not really work.

Hunting resumed the next morning. After about an hour of crawling, one subdomain stood out. Crawling means following links automatically to discover pages. This subdomain looked good, had little content, only a front page and some links. While poking at it, Burp flagged a possible NoSQL injection in the headers and cookies. Headers are extra lines of information sent with every request, such as the Referer header, which tells the server which page you came from. A cookie is a small piece of data a website stores in your browser and sends back with each request, often used to remember who you are. When he tried to reproduce it, it turned out to be a false positive: a result that looks like a bug but is not.

Because the site had no parameters, the next attempt targeted the Referer header and cookies. Parameters are the parts of a URL after a question mark, like ?id=5, which pass values to the server. He fired payloads from the GitHub wordlist manually. A payload is the actual string you send to try to trigger a bug. Half an hour of that produced nothing.

After a ten minute break, he tried placing a payload directly after the host in the path. The path is the part of the URL after the domain name, like /about in example.com/about. He pasted a sleep payload there, and the server delayed its response by six seconds. A sleep payload asks the database to pause for a set time. If the response is delayed, it means the database ran your command.

Exploitation

Step 1: Confirm the delay in the path

The payload was appended to the root path of the host:

This is the full URL. redacted.redbull.com is the host, and the part after the slash is the path. The path contains the payload.

The payload itself:

Text
';sleep(6000);

Line by line:

  • The report does not explain how the payload works internally; it only records the six second delay.
  • The semicolon ; terminates that statement. In many databases, a semicolon separates one command from the next.
  • sleep(6000) asks the database to pause for 6000 milliseconds, which is six seconds.

The server delayed its response by six seconds, which the researcher treated as confirmation of time-based injection. Time-based injection means you cannot see the data, but you can infer that your command ran because the response time changes.

Step 2: Verify with a second person

The delay was confirmed with a friend before the report was written and submitted on Intigriti. A second pair of eyes helps rule out a fluke, such as a slow network.

Step 3: Reproduction fails the next day

The following day the researcher tried to reproduce the issue and could not. The friend's advice was that a strong proof of concept would still be accepted, otherwise the report might be closed as N/A. N/A means not applicable, a status meaning the report is rejected. A proof of concept, or PoC, is evidence that the bug is real, such as a video or a set of steps.

Over the weekend the triager stated that they were not able to reproduce it and believed it could be a false positive. A triager is the person at the bug bounty platform who first reviews reports and decides whether to pass them to the company.

Step 4: Escalate to the internal team

The researcher replied asking the triager to forward the report to the internal team, in case the issue had been detected and fixed unintentionally. The triager forwarded it. On Monday evening the program manager asked for the proof-of-concept video that had been mentioned in the report. The video was forwarded, and shortly afterwards the report was accepted as critical and resolved.

Accepted as CRITICAL and resolved xD From the original on burhanxd.medium.com

The screenshot shows the report accepted as critical and resolved.

Root cause

The report does not describe the server-side code. What the behaviour implies is that user-controlled input taken from the URL path was concatenated into a database query without proper handling. Concatenation means joining strings together, like query + input. If the input contains a quote and a statement separator, it can break out of the intended query and run a sleep call. The fact that the delay disappeared the next day suggests the issue was fixed on the server side between the report and the reproduction attempt, which is consistent with the researcher's own suggestion that it had been fixed unintentionally.

Impact

The report does not analyse impact beyond the demonstrated time delay. A time-based injection of this kind, if it had remained exploitable, would let an attacker run queries against the backing database through the vulnerable path. The report gives no evidence of data access, and the only observed effect is the six second response delay.

Fix

The status was set to resolved after the video proof of concept was reviewed, and the researcher's own theory is that the issue was fixed on the server side before the second reproduction attempt. The general remedy for this class of bug is to stop building queries by string concatenation and to pass user input as bound parameters, or to validate and reject input that contains query syntax. Bound parameters mean the database treats your input as data, never as code, so quotes and semicolons cannot change the query.

Variants to test

  • Headers and cookies. The first automated hit appeared in headers and cookies, though it was a false positive there. Send the same sleep payloads through the Referer header and cookie values and look for a consistent delay. User-Agent is a header that identifies your browser.
  • Path segments. As here, append the payload directly after the host and after individual path segments, for example a path that ends in a quote followed by a sleep call. A positive result is a repeatable delay proportional to the sleep value.
  • Wordlist payloads. Run the MongoDB NoSQL injection wordlist against every input that reaches the backend, including ones with no visible parameters. A positive result is a response that differs consistently from the baseline for the same request without the payload. Baseline means the normal response when you send no payload.
  • Timing controls. Repeat each candidate payload several times and compare against a clean request, so that a one-off slow response is not mistaken for injection. The report's own experience shows why: the first hit was a false positive and the confirmed one later stopped reproducing.

Timeline

Event Date
Reported 25 February
Status changed to pending 27 February
Accepted and closed as resolved 1 March

Glossary

  • API: A set of rules that lets one program talk to another, like a waiter taking your order to the kitchen.
  • Baseline: The normal response when you send a request without any payload, used for comparison.
  • Bash: A command-line shell on Linux and macOS where you type commands as text.
  • Bound parameters: A way of sending input to a database so it is treated as data, never as code.
  • Bug bounty: A programme where companies invite people to test their systems and pay for valid reports.
  • Burp Suite: A tool that sits between your browser and a website and lets you see and change requests and responses.
  • Concatenation: Joining strings together, like query + input.
  • Cookie: A small piece of data a website stores in your browser and sends back with each request.
  • CORS: Cross-Origin Resource Sharing, rules that decide which other websites can read data from a site.
  • Crawling: Following links automatically to discover pages.
  • CVE: A public catalogue number for a known vulnerability.
  • False positive: A result that looks like a bug but is not.
  • Header: Extra lines of information sent with every request, such as Referer or User-Agent.
  • HTML: The language that describes what a web page contains.
  • Injection: Slipping extra commands into input so the database runs them.
  • Intigriti: A bug bounty platform where researchers submit reports.
  • JavaScript: The language that makes web pages interactive in the browser.
  • MongoDB: A popular NoSQL database.
  • N/A: Not applicable, a status meaning a report is rejected.
  • NoSQL: A family of databases that do not use the traditional table-and-row model.
  • Parameter: The part of a URL after a question mark, like ?id=5, which passes values to the server.
  • Path: The part of a URL after the domain name, like /about in example.com/about.
  • Payload: The actual string you send to try to trigger a bug.
  • Proof of concept (PoC): Evidence that a bug is real, such as a video or a set of steps.
  • Reconnaissance (recon): Gathering information about a target, such as which subdomains exist.
  • Request: The message your browser sends to a server asking for a page or data.
  • Response: The server's reply to a request.
  • Script: A text file with a list of commands.
  • Sleep payload: A string that asks the database to pause for a set time, used to detect injection by the delay.
  • Subdomain: A name like shop.example.com that sits under a main domain like example.com.
  • Time-based injection: An injection where you cannot see data, but you infer that your command ran because the response time changes.
  • Triager: The person at the bug bounty platform who first reviews reports.
  • User-Agent: A header that identifies your browser.
  • Wordlist: A file full of test strings.

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.