Skip to content

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

FieldValue
IDCODE-0039
CategoryInjection
SeverityHIGH
CWECWE-943
ConfidenceHIGH
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityEASY
Tagsquery injection, aws, simpledb
OWASPN/A