AWS Query Injection
Description
Constructing SimpleDB queries containing user input can allow an attacker to view unauthorized records. This is due to the improper neutralization of special elements in data query logic.
Examples
Insecure Code
scala
val query = "select * from domain where name = '" + userInput + "'"
val selectRequest = new SelectRequest(query)Secure Code
scala
val query = "select * from domain where name = ?"
val selectRequest = new SelectRequest(query)
selectRequest.setNextToken(null)
val response = simpleDB.select(selectRequest)Remediation
Validate and sanitize user input before using it to construct SimpleDB queries.
Rule Details
| Field | Value |
|---|---|
| ID | CODE-0039 |
| Category | Injection |
| Severity | HIGH |
| CWE | CWE-943 |
| Confidence | HIGH |
| Impact | HIGH |
| Likelihood | MEDIUM |
| Exploitability | EASY |
| Tags | query injection, aws, simpledb |
| OWASP | N/A |