Data Validation & Encoding (VEX)

DATA VALIDATION & ENCODING
10

Darío can exploit the trust the application places in a source of data (e.g. user-definable data, manipulation of locally stored data, alteration to state data on a client device, lacking and/or improper enforcement of client-side controls, lack of verification of identity during data validation such as Darío can pretend to be Colin)

How to play?

The key concept is that trusting unverified user-defined or client-side data lets attackers tamper with state information to impersonate other users and gain unauthorized access.

Scenario: Darío’s Deceptive Data Manipulation

Imagine a scenario where Darío takes advantage of the application's trust in its data sources. He manipulates the system in several ways:

  1. Exploiting User-Defined Data: The application overly trusts data input by users.
  2. Tampering with Client-Side Data: The application fails to validate data altered on a client device.
  3. Altering State Data on Client Devices: The application doesn't verify the integrity of state data, like session tokens or JWTs stored on client devices.
  4. Lack of Identity Verification: The system inadequately verifies the identity of a user during data validation.

Example

Darío attacks by altering a session token stored in his browser's local storage. He changes the token's value to mimic that of another user, say, Colin. Since the application trusts this client-side data without additional verification, Darío gains access to Colin's account and privileges. This breach occurs because the system assumes the integrity and authenticity of locally stored data without adequately verifying it.

Threat Modeling

STRIDE

Darío is pretending to be Colin by taking advantage of the application's trust in its data sources. STRIDE’s Spoofing covers threats where an attacker assumes another identity or credentials to gain access. This is a textbook spoofing/impersonation attack: the system trusted the presented identity without adequate verification, but the consequences or secondary impacts can include any of the other categories depending on the context.

What can go wrong?

This kind of vulnerability can lead to identity theft, unauthorized access, and potentially severe data breaches.

Trust management is a popular technique for implementing information security, and specifically for access control policies. All data sources of an application are be classified into groups with varying degrees of trust. When doing this, it is imperative to ensure that trusted sources cannot be spoofed. This spoofing can be done in many ways:

  1. Reflection attack
  2. Principal Spoof
  3. JSON Hijacking
  4. Registry Poisoning
  5. MITM
  6. XSS

Attackers that are identified as trusted users or that are in a trusted zone with bad authentication techniques can do all sorts of things, depending on the services, such as:

  1. Sniffing
  2. Data tampering
  3. Code Injection
  4. DoS

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 strict validation of user-defined and client-side data.
  2. Ensure strong verification of user identity and the integrity of state data stored on client devices.
  3. Regularly review and strengthen security measures to guard against data manipulation.

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

OWASP ASVS (v5.0): 1.3.6,2.2.1,2.2.2,3.2.1,3.1.1,3.3.1,3.3.2,3.3.3,3.3.4,3.3.5,3.4.3,3.4.4,3.4.6,3.4.7,3.5.1,3.5.2,3.5.3,3.5.4,3.5.5,3.6.1,3.7.4,4.1.3,4.1.5,6.8.2,9.1.1,9.1.2,9.1.3,9.2.2,9.2.3,9.2.4,10.4.1

OWASP DevGuide: COE1,SSV1,VSD1,FV1,SM22

STRIDE: Spoofing

CAPEC™: 22,39,51,62,111,145,194,200,218,220,466,475,502,543,690

SAFECode™: 14

CAPEC Map

CodeTitleASVS
22Exploiting Trust in Client
39Manipulating Opaque Client-based Data Tokens
51Poison Web Service Registry
62Cross Site Request Forgery
111JSON Hijacking (aka JavaScript Hijacking)
145Checksum Spoofing
194Fake the Source of Data
218Spoofing of UDDI/ebXML Messages
220Client-Server Protocol Manipulation
466Leveraging Active Adversary in the Middle Attacks to Bypass Same Origin Policy
475Signature Spoofing by Improper Validation
543Counterfeit Websites
690Metadata Spoofing

ASVS (5.0) Cheat Sheet Series Index

Cross-Site Scripting (XSS)

Data tampering

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.