Data Validation & Encoding (VEK)
Gabe kan injisere data inn i en tolk på serversiden (f.eks. SQL, OS-kommandoer, Xpath, Server JavaScript, SMTP) fordi et parameterisert grensesnitt med sterke typer ikke brukes eller ikke er implementert riktig
This relates to actual exploitation of an injection vulnerability on the server-side. See Data Validation & Encoding Q (VEQ) for the same attack client-side, and other cards in this suit for individual data validation and encoding issues (e.g. missing/by-passable/badly-implemented input/output validation, encoding or sanitization).
Scenario: Gabe’s Server-Side Interpreter Exploits
Imagine a scenario where Gabe takes advantage of weaknesses in server-side data processing. He injects malicious data into server-side interpreters like SQL, OS commands, XPath, Server JavaScript, SMTP, etc. This occurs because:
- Lack of Strongly Typed Parameterized Interfaces: The system either doesn’t use strongly typed parameterized interfaces, or they are implemented incorrectly.
Example
Gabe targets a web application's database interaction. He enters a specially crafted input into a search field, such as ' OR '1'='1. Due to the lack of a strongly typed parameterized query interface, this input is directly included in a SQL query. This results in a SQL injection, where Gabe manipulates the query to return all records or even modify database contents.
Threat Modeling
STRIDE
Gabe is injecting data that changes how the server processes queries/commands — turning data into action. That is an integrity attack: unauthorized modification of application behavior or data, which maps to Tampering in STRIDE. The injection itself modifies the server-side processing pipeline (SQL engine, OS shell, XPath processor, etc.), so the root threat is tampering with inputs/processing, but all of the other STRIDE categories can be used for the secondary impact depending on the context.
What can go wrong?
Such vulnerabilities can lead to severe consequences, including unauthorized data access, manipulation of server-side operations, and potentially full system compromise.
Due a failure of server-side input or output validation, encoding or sanitization, malicious code can be injected and treated as code rather than data, leading to code execution in the server application.
For more things that can go wrong, see the Common Attack Patterns related to this card in the table below.
What are we going to do about it?
- Implement and rigorously enforce the use of strongly typed parameterized interfaces for all server-side data processing.
- Regularly review and test these implementations to ensure they handle data inputs securely and prevent injection attacks.
For detailed advice on how to mitigate threats related to the card, see the ASVS and OWASP Developer Guide requirements in the table below.
Mappings
STRIDE: Tampering
OWASP ASVS: 5.2.1,5.2.2,5.3.4,5.3.7,5.3.8,5.3.9,5.3.10
CAPEC: 19,23,28,66,83,88,93,126,136,137,153,160,183,201,250,253,261,664,676
OWASP DevGuide: SFL4,SFL9,SFL10,SFL11,SQ2,CEC6,CEC7,COE1,COE2,LF4,LF5,LF6,FV1
OWASP AppSensor: CIE1,CIE2