Modification of Assumed-Immutable Data (MAID)

Draft Base
Structure: Simple
Description

This vulnerability occurs when an application fails to protect data it assumes cannot be changed, allowing an attacker to alter it.

Extended Description

Many applications rely on specific pieces of data remaining constant for correct and secure operation. When developers mistakenly treat certain inputs as read-only—like hidden form fields, session cookies, or DNS records—they create a weak spot. Attackers can then modify this assumed-immutable data to bypass security checks, escalate privileges, or corrupt application logic. This flaw often stems from misplaced trust in client-side controls or external systems. To prevent it, developers must validate all critical data on the server side, regardless of its perceived source or intended immutability. Never rely on client-side mechanisms like hidden fields or cookies to store security-sensitive values without verification.

Common Consequences 2
Scope: Integrity

Impact: Modify Application Data

Common data types that are attacked are environment variables, web application parameters, and HTTP headers.

Scope: Integrity

Impact: Unexpected State

Potential Mitigations 1
Phase: Architecture and DesignOperationImplementation
When the data is stored or transmitted through untrusted sources that could modify the data, implement integrity checks to detect unauthorized modification, or store/transmit the data in a trusted location that is free from external influence.
Demonstrative Examples 1
In the code excerpt below, an array returned by a Java method is modified despite the fact that arrays are mutable.

Code Example:

Bad
Java
java
Observed Examples 2
CVE-2002-1757Relies on $PHP_SELF variable for authentication.
CVE-2005-1905Gain privileges by modifying assumed-immutable code addresses that are accessed by a driver.
Applicable Platforms
Languages:
Not Language-Specific : Undetermined
Modes of Introduction
Implementation
Architecture and Design
Taxonomy Mapping
  • PLOVER
Notes
RelationshipMAID issues can be primary to many other weaknesses, and they are a major factor in languages that provide easy access to internal program constructs, such as PHP's register_globals and similar features. However, MAID issues can also be resultant from weaknesses that modify internal state; for example, a program might validate some data and store it in memory, but a buffer overflow could overwrite that validated data, leading to a change in program logic.
TheoreticalThere are many examples where the MUTABILITY property is a major factor in a vulnerability.