Data Validation & Encoding (VEX)
Darío kan utnytte tilliten applikasjonen har til en datakilde (f.eks. brukerdefinerbare data, manipulering av lokalt lagrede data, endring av tilstandsdata på en klientenhet, manglende og/eller feil håndheving av kontroller på klientsiden, manglende verifisering av identitet under datavalidering slik at Darío kan utgi seg for å være Colin)
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:
- Exploiting User-Defined Data: The application overly trusts data input by users.
- Tampering with Client-Side Data: The application fails to validate data altered on a client device.
- 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.
- 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:
- Reflection attack
- Principal Spoof
- JSON Hijacking
- Registry Poisoning
- MITM
- 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:
- Sniffing
- Data tampering
- Code Injection
- 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?
- Implement strict validation of user-defined and client-side data.
- Ensure strong verification of user identity and the integrity of state data stored on client devices.
- 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
STRIDE: Spoofing
OWASP ASVS: 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
CAPEC: 22,39,51,62,111,145,194,200,218,220,466,475,502,543,690
OWASP DevGuide: COE1,SSV1,VSD1,FV1,SM22
SAFECode: 14
CAPEC™ Map
| Code | Title | ASVS |
|---|---|---|
| 22 | Exploiting Trust in Client | 2.2.2,4.1.3,10.4.1 |
| 39 | Manipulating Opaque Client-based Data Tokens | 3.3.1,3.3.2,3.3.3,3.3.4,3.3.5,4.1.3,9.1.3,9.2.2,9.2.3,9.2.4,10.4.1 |
| 51 | Poison Web Service Registry | 1.3.6 |
| 62 | Cross Site Request Forgery | 3.5.1,3.5.2,3.5.3,3.5.4,3.5.5 |
| 111 | JSON Hijacking (aka JavaScript Hijacking) | 3.4.3,3.4.6,3.4.7 |
| 145 | Checksum Spoofing | 2.2.1,2.2.2,4.1.5 |
| 194 | Fake the Source of Data | 4.1.3 |
| 218 | Spoofing of UDDI/ebXML Messages | 2.2.1,2.2.2,4.1.5 |
| 220 | Client-Server Protocol Manipulation | 3.1.1,3.4.1,3.7.4 |
| 466 | Leveraging Active Adversary in the Middle Attacks to Bypass Same Origin Policy | 3.1.1,3.4.1,3.4.8,3.4.2,3.7.4 |
| 475 | Signature Spoofing by Improper Validation | 2.2.1,2.2.2,3.6.1,4.1.5,6.8.2,9.1.1,9.1.2,9.1.3 |
| 543 | Counterfeit Websites | 3.4.8 |
| 690 | Metadata Spoofing | 3.4.4,4.1.3 |