Nosql injection

From zakirkun/ice-tea · View interactive version

Nosql injection is an AI agent skill from the GitHub repository zakirkun/ice-tea. Detects NoSQL query injection vulnerabilities in MongoDB, Redis, and other NoSQL databases.

How to use this skill

Skill file

NoSQL Injection

Overview

NoSQL databases like MongoDB are vulnerable to injection attacks that exploit the query language structure. Unlike SQL injection, NoSQL injection often exploits JSON/object operators:

Detection Strategy

Remediation

Vulnerable (Node.js):

const user = await User.findOne({ username: req.body.username, password: req.body.password });
// Attacker sends: {"username": {"$gt": ""}, "password": {"$gt": ""}}

Safe (Node.js):

const mongoSanitize = require('express-mongo-sanitize');
app.use(mongoSanitize());
// OR manually: ensure fields are strings
const user = await User.findOne({ username: String(req.body.username) });
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.