# Improper Neutralization of Special Elements in Data Query Logic (CWE-943) The product generates a query intended to access or manipulate data in a data store, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended logic of the query. **Stack:** Go - Prevalence: Alta Frecuentemente explotada - Impact: Alto 3 reglas de severidad alta - Prevention: Documentada 3 ejemplos de corrección **OWASP:** Injection (A03:2021-Injection) - #3 ## Description This covers injection attacks against NoSQL databases, ORM frameworks, and other data query mechanisms that differ from traditional SQL injection. ## Prevention Estrategias de prevención para NoSQL Injection basadas en 1 reglas de detección de Shoulder. ### Go Use typed structs or explicit operators, validate all user input ## Warning Signs - [HIGH] user input flowing to MongoDB or Redis queries without proper validation ## Consequences - Leer datos de la aplicación - Modificar datos de la aplicación - Eludir mecanismo de protección ## Mitigations - Usa consultas parametrizadas para todos los almacenes de datos - Valida y sanea la entrada antes de usarla en consultas - Aplica el principio de mínimo privilegio a las cuentas de base de datos ## Detection - Total rules: 3 - Languages: go, javascript, typescript, python ## Rules by Language ### Go (1 rules) - **NoSQL Injection** [HIGH]: Detects user input flowing to MongoDB or Redis queries without proper validation. - Remediation: Use typed structs or explicit $eq operators for MongoDB, validate Redis keys with regex. ```go filter := bson.M{"username": bson.M{"$eq": username}} ``` Learn more: https://shoulder.dev/learn/go/cwe-943/nosql-injection