Data Validation & Encoding (VEK)

DATA VALIDATION & ENCODING
K

Gabe can inject data into a server-side interpreter (e.g. SQL, OS commands, Xpath, Server JavaScript, SMTP) because a strongly typed parameterised interface is not being used, not implemented correctly, or properly configured

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: 1.1.1,1.1.2,1.2.2,1.2.4,1.2.5,1.2.6,1.2.7,1.2.8,1.2.9,1.2.10,1.3.2,1.3.3,1.3.4,1.3.5,1.3.8,1.3.9,1.3.10,1.3.11,1.5.1,1.5.2,1.5.3,2.1.1,2.1.2,2.1.3,2.2.1,2.2.2,2.2.3,5.1.1,5.2.1,5.2.2,5.2.3,5.2.4,5.2.5,5.2.6,5.3.1,5.3.2,5.3.3,5.4.1,5.4.2,5.4.3,15.3.1,15.3.2,15.3.3,15.3.5,15.3.6,15.3.7,16.4.1,16.5.1

CAPEC: 19,23,28,66,83,88,93,126,136,137,153,160,175,183,250,253,261,664,676

OWASP DevGuide: SFL4,SFL9,SFL10,SFL11,SQ2,CEC6,CEC7,COE1,COE2,LF4,LF5,LF6,FV1

SAFECode: 2,19,20

CAPEC™ Map

CodeTitleASVS
19Embedding Scripts within Scripts
23File Content Injection
28Fuzzing
66SQL Injection
83XPath Injection
88OS Command Injection
93Log Injection-Tampering-Forging
126Path Traversal
136LDAP Injection
137Parameter Injection
153Input Data Manipulation
160Exploit Script-Based APIs
175Code Inclusion
183IMAP/SMTP Command Injection
201Serialized Data External Linking
250XML Injection
253Remote Code Inclusion
261Fuzzing for garnering other adjacent user/sensitive data
664Server Side Request Forgery
676NoSQL Injection

ASVS (5.0) 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.