Skip to content
SQL injection Write-up Intermediate

Delving Into The Depths Of Nosql Injection A Research Odyssey

The write-up explains NoSQL injection, showing how unsanitised input in MongoDB queries can allow authentication bypass and data extraction. It demonstrates syntax injection, operator injection, and blind timing attacks using PortSwigger labs.

7h3h4ckv157 Follow

Published on infosecwriteups.com

Hey Hackers, I am back again with my another write-up. Today, we’re going on an adventure about a sneaky bug that can cause some serious trouble in the online world.

7h3h4ckv157, on infosecwriteups.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 application fails to sanitise or validate user input before using it in a NoSQL query, allowing query operators or JavaScript to be injected.

Impact

An attacker could bypass authentication, extract sensitive data, cause denial of service, or potentially execute code on the server.

What the attacker needed

Vulnerable NoSQL query; unsanitised user input

The fix

Input should be validated and sanitised, using an allow-list of accepted characters and keys, and applying least privilege.

How it was found

  1. Send a single quote in a parameter to trigger a syntax error, confirming injection.
  2. Inject a query operator like $ne or $regex in a login request to bypass authentication.
  3. Use logical injections to determine the length of the administrator password.
  4. Extract the password character by character using conditional injections.
  5. Use $where with a sleep function to cause a time delay, confirming blind injection.

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.

NoSQL databases store data differently from traditional tables. If a website puts user input directly into a database query without checking it, an attacker can sneak in special commands. This can let them log in without a password or read data they should not see.

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 7h3h4ckv157

View all

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