Skip to content
SQL injection Write-up Advanced

InfluxDB NoSQL Injection

A web application concatenated user input directly into an InfluxDB query, allowing NoSQL injection. An attacker could leak bucket names, field names, and field values, and also perform SSRF and reflected XSS.

Rafael da Costa Santos Follow

Published on blog.bugport.net

In this post, I'll share my experience of discovering a NoSQL Injection vulnerability in a Bug Bounty program in a non-popular database within the hacking community.

Rafael da Costa Santos, on blog.bugport.net

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

Impact

An attacker could read arbitrary data from other buckets, make the server send requests to internal or external hosts (SSRF), and execute JavaScript in a victim's browser (XSS).

What the attacker needed

Victim clicks a link for XSS; attacker can reach the vulnerable endpoint

How it was found

  1. Send a double quote character in a query parameter and observe an InfluxDB error.
  2. Inject a payload that uses the yield function and a newline to start a new query, then use the buckets function with a regex filter and the die function to leak bucket names character by character.
  3. Use a similar payload with the from function to fetch a bucket and call die with the result object to leak the bucket's field structure.
  4. Use a regex filter on the field name and die to leak field names.
  5. Use a filter on a specific field and die with string conversion to leak field values.
  6. Use the host parameter in the from function to make the server send an HTTP request to an attacker-controlled URL (SSRF).

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 web app took a value from the URL and pasted it straight into a database query without cleaning it. By sending special characters, an attacker could change the query to make the database reveal secret data or even make the server fetch other websites. This is called injection because the attacker injects their own commands into the query.

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.