How an Unsanitized “Filter” Input Nuked a SaaS Unicorn’s Da
The employee search endpoint passed user-supplied JSON directly into a MongoDB query, so an attacker could use query operators to bypass filters and tenant isolation. Using the $where operator, the attacker could read employee records, contract details and SSNs from every company on the platform.
If there’s one phrase that should instantly trigger a bug hunter’s spider-sense, it’s this: “Dynamic Search Filter.”
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 employee records, contract details and SSNs across all tenants on the platform, breaking tenant isolation entirely.
What the attacker needed
Access to the employee search feature; ability to send crafted JSON requests
The fix
The report recommends disabling $where execution and sanitising input parameters, and the text says an emergency patch was deployed.
How it was found
- Intercept the JSON payload sent when applying a multi-tag filter on the Advanced Employee Search modal.
- Replace a string filter value with a MongoDB not-equal operator and observe that all records in the organisation are returned.
- Note that a tenant_id is appended server-side, keeping results within the tester's own organisation.
- Send a $where operator containing a JavaScript expression that always evaluates true.
- Observe that records from every company on the platform 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 search box normally treats what you type as plain text. Here the server accepted structured data and put it straight into a database query, so special database instructions could be slipped in. That let the tester read records belonging to other companies, not just their own.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.