Skip to content
SQL injection Write-up Advanced

InfluxDB NoSQL Injection

A web application concatenated user input directly into an InfluxDB query, allowing an attacker to inject malicious query syntax. This enabled leaking bucket names, field names, and sensitive values, and also led to SSRF and reflected XSS.

Rafael da Costa Santos Follow

Published on rafa.hashnode.dev

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 (@rafabyte_), on rafa.hashnode.dev

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 send requests to the vulnerable endpoint

How it was found

  1. Send a double quote character in a query parameter to trigger an error and confirm injection.
  2. Inject a payload that uses the buckets() function and die() to leak bucket names via error messages.
  3. Inject a payload that uses from() and die() to leak the data structure of a bucket.
  4. Inject a payload that uses regex and die() to leak field names.
  5. Inject a payload that uses die() with string conversion to leak field values.
  6. Inject a payload that uses the host parameter in from() to make the server send an HTTP request to an attacker-controlled server.

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 built database queries by gluing together text from the user, so an attacker could add their own database commands. This let them read data they should not see and even make the server send requests to other places or run scripts in a victim's browser.

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 Rafael da Costa Santos

View all

2 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.