Data Validation & Encoding (VEX)
Darío میتواند از اعتمادی که برنامه به یک منبع داده دارد سوءاستفاده کند (مثلاً دادههای قابل تعریف توسط کاربر، دستکاری دادههای ذخیرهشده محلی، تغییر دادههای وضعیت روی دستگاه کلاینت، نبود یا اعمال نادرست کنترلهای سمت کلاینت، نبود تأیید هویت هنگام اعتبارسنجی داده، مانند اینکه Darío میتواند خود را 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
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
| Code | Title | ASVS |
|---|---|---|
| 22 | CAPEC 22 | 2.2.2,4.1.3,10.4.1 |
| 39 | CAPEC 39 | 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 | CAPEC 51 | 1.3.6 |
| 62 | CAPEC 62 | 3.5.1,3.5.2,3.5.3,3.5.4,3.5.5 |
| 111 | CAPEC 111 | 3.4.3,3.4.6,3.4.7 |
| 145 | CAPEC 145 | 2.2.1,2.2.2,4.1.5 |
| 194 | CAPEC 194 | 4.1.3 |
| 218 | CAPEC 218 | 2.2.1,2.2.2,4.1.5 |
| 220 | CAPEC 220 | 3.1.1,3.4.1,3.7.4 |
| 466 | CAPEC 466 | 3.1.1,3.4.1,3.4.8,3.4.2,3.7.4 |
| 475 | CAPEC 475 | 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 | CAPEC 543 | 3.4.8 |
| 690 | CAPEC 690 | 3.4.4,4.1.3 |