CAPEC-39

Manipulating Opaque Client-based Data Tokens
High
Medium
Draft
2014-06-23
00h00 +00:00
2020-07-30
00h00 +00:00
Alerte pour un CAPEC
Stay informed of any changes for a specific CAPEC.
Notifications manage

Descriptions CAPEC

In circumstances where an application holds important data client-side in tokens (cookies, URLs, data files, and so forth) that data can be manipulated. If client or server-side application components reinterpret that data as authentication tokens or data (such as store item pricing or wallet information) then even opaquely manipulating that data may bear fruit for an Attacker. In this pattern an attacker undermines the assumption that client side tokens have been adequately protected from tampering through use of encryption or obfuscation.

Informations CAPEC

Execution Flow

1) Explore

[Enumerate information passed to client side] The attacker identifies the parameters used as part of tokens to take business or security decisions

Technique
  • Use WebScarab to reveal hidden fields while browsing.
  • Use a sniffer to capture packets
  • View source of web page to find hidden fields
  • Examine URL to see if any opaque tokens are in it
  • Disassemble or decompile client-side application
  • Use debugging tools such as File Monitor, Registry Monitor, Debuggers, etc.
2) Explore

[Determine protection mechanism for opaque token] The attacker determines the protection mechanism used to protect the confidentiality and integrity of these data tokens. They may be obfuscated or a full blown encryption may be used.

Technique
  • Look for signs of well-known character encodings
  • Look for cryptographic signatures
  • Look for delimiters or other indicators of structure
3) Experiment

[Modify parameter/token values] Trying each parameter in turn, the attacker modifies the values

Technique
  • Modify tokens logically
  • Modify tokens arithmetically
  • Modify tokens bitwise
  • Modify structural components of tokens
  • Modify order of parameters/tokens
4) Experiment

[Cycle through values for each parameter.] Depending on the nature of the application, the attacker now cycles through values of each parameter and observes the effects of this modification in the data returned by the server

Technique
  • Use network-level packet injection tools such as netcat
  • Use application-level data modification tools such as Tamper Data, WebScarab, TamperIE, etc.
  • Use modified client (modified by reverse engineering)
  • Use debugging tools to modify data in client

Prerequisites

An attacker already has some access to the system or can steal the client based data tokens from another user who has access to the system.
For an Attacker to viably execute this attack, some data (later interpreted by the application) must be held client-side in a way that can be manipulated without detection. This means that the data or tokens are not CRCd as part of their value or through a separate meta-data store elsewhere.

Skills Required

If the client site token is obfuscated.
If the client site token is encrypted.

Resources Required

The Attacker needs no special hardware-based resources in order to conduct this attack. Software plugins, such as Tamper Data for Firefox, may help in manipulating URL- or cookie-based data.

Mitigations

One solution to this problem is to protect encrypted data with a CRC of some sort. If knowing who last manipulated the data is important, then using a cryptographic "message authentication code" (or hMAC) is prescribed. However, this guidance is not a panacea. In particular, any value created by (and therefore encrypted by) the client, which itself is a "malicious" value, all the protective cryptography in the world can't make the value 'correct' again. Put simply, if the client has control over the whole process of generating and encoding the value, then simply protecting its integrity doesn't help.
Make sure to protect client side authentication tokens for confidentiality (encryption) and integrity (signed hash)
Make sure that all session tokens use a good source of randomness
Perform validation on the server side to make sure that client side data tokens are consistent with what is expected.

Related Weaknesses

CWE-ID Weakness Name

CWE-353

Missing Support for Integrity Check
The product uses a transmission protocol that does not include a mechanism for verifying the integrity of the data during transmission, such as a checksum.

CWE-285

Improper Authorization
The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.

CWE-302

Authentication Bypass by Assumed-Immutable Data
The authentication scheme or implementation uses key data elements that are assumed to be immutable, but can be controlled or modified by the attacker.

CWE-472

External Control of Assumed-Immutable Web Parameter
The web application does not sufficiently verify inputs that are assumed to be immutable but are actually externally controllable, such as hidden form fields.

CWE-565

Reliance on Cookies without Validation and Integrity Checking
The product relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user.

CWE-315

Cleartext Storage of Sensitive Information in a Cookie
The product stores sensitive information in cleartext in a cookie.

CWE-539

Use of Persistent Cookies Containing Sensitive Information
The web application uses persistent cookies, but the cookies contain sensitive information.

CWE-384

Session Fixation
Authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions.

CWE-233

Improper Handling of Parameters
The product does not properly handle when the expected number of parameters, fields, or arguments is not provided in input, or if those parameters are undefined.

Submission

Name Organization Date Date release
CAPEC Content Team The MITRE Corporation 2014-06-23 +00:00

Modifications

Name Organization Date Comment
CAPEC Content Team The MITRE Corporation 2017-01-09 +00:00 Updated Related_Attack_Patterns
CAPEC Content Team The MITRE Corporation 2019-04-04 +00:00 Updated Related_Attack_Patterns
CAPEC Content Team The MITRE Corporation 2020-07-30 +00:00 Updated Example_Instances