Skip to content
SQL injection Write-up Beginner

Buggy Buy’s Search Manipulation via NoSQL Injection

The search field on the Buggy Buy product page passes user input straight into a MongoDB query, so a crafted JSON object with a comparison operator is treated as a query rather than a search term. An attacker could use this to bypass the intended price filter and list products above the normal search range.

medium.com

Published on medium.com

During a hands-on exploration of the intentionally vulnerable web app Buggy Buy, I discovered that the application’s search functionality is vulnerable to NoSQL injection, allowing attackers to manipulate search parameters using MongoDB operators. By injecting operators into the search field, attackers can bypass…

Muniza Badar, on 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.

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 search input is passed into a MongoDB query without type checking, so a JSON object is interpreted as a query operator instead of a plain string.

Impact

The author claims this could expose restricted or high-value product listings and allow enumeration of pricing and inventory data beyond a user's permissions, though no evidence of data outside the product catalogue is shown.

What the attacker needed

Access to the Buggy Buy product page; none beyond a browser

The fix

The application should strip or reject NoSQL operators in user input, use safe query builders or an ORM, and restrict search fields to expected values; the text does not say whether this was fixed.

How it was found

  1. Open the product page and find the search bar.
  2. Enter a JSON object containing a price comparison operator into the search field.
  3. Submit the search and observe that products priced above the chosen amount are returned.

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.

A NoSQL database such as MongoDB stores records as JSON-like documents. If a website drops whatever you type into the search box directly into a database query, you can type a small JSON object instead of a word, and the database will follow it as an instruction. Here that let the author ask for products above a chosen price, which the normal search was not meant to allow.

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.