Data Validation & Encoding (VEK)

DATA VALIDATION & ENCODING
K

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

How to play?

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:

  1. 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?

  1. Implement and rigorously enforce the use of strongly typed parameterized interfaces for all server-side data processing.
  2. 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

SAFECode: 2,19,20

ASVS (4.0.3) Cheat Sheet Series Index

Attacks

SQL Injection

Command Injection

OWASP Cornucopia

OWASP Cornucopia is a mechanism in the form of a card game to assist software development teams identify security requirements in Agile, conventional and formal development processes. It is language, platform and technology-agnostic, and is free to use. OWASP Cornucopia is licensed under the Creative Commons Attribution-ShareAlike 4.0 license, so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar licence to this one.

© 2012-2025 OWASP Foundation. The Open Worldwide Application Security Project (OWASP) is a nonprofit foundation that works to improve the security of software.