# 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: उच्च बार-बार शोषित - Impact: उच्च 3 उच्च गंभीरता वाले नियम - Prevention: प्रलेखित 3 फिक्स उदाहरण **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 1 Shoulder डिटेक्शन नियमों पर आधारित NoSQL Injection के लिए रोकथाम रणनीतियाँ। ### 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 - एप्लिकेशन डेटा पढ़ना - एप्लिकेशन डेटा संशोधित करना - सुरक्षा तंत्र को बायपास करना ## Mitigations - सभी डेटा स्टोर्स के लिए पैरामीटराइज़्ड क्वेरीज़ का उपयोग करें - क्वेरीज़ में उपयोग से पहले इनपुट को सत्यापित और सैनिटाइज़ करें - डेटाबेस खातों पर न्यूनतम विशेषाधिकार के सिद्धांत को लागू करें ## 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