Join our Newsletter — 33% off our NHI Course

Modification of Assumed-Immutable Data (MAID)

Modification of Assumed-Immutable Data (MAID) is a flaw where data treated as constant is later changed by another thread, process, or code path. Security decisions made on the original value can become invalid, leading to race conditions or policy bypass. Recheck shared state before use.

What Modification of Assumed-Immutable Data Means in Practice

MAID is not about data being mutable in the abstract, but about code relying on data as if it cannot change. That assumption becomes dangerous when another thread, process, callback, or code path can alter the value after the security decision has already been made.

This matters because the vulnerability is often created by a gap between decision time and use time. A value may be validated, authorised, or classified correctly at first, then become stale before it is acted on. The problem is therefore about trust in shared state, not just about the data itself.

How MAID Breaks Security Assumptions

MAID commonly appears when software reads a shared object, checks a property, and later uses that same object without revalidating it. If the underlying state changes between those steps, the second operation can run under an assumption that is no longer true.

The security consequence is that access decisions, file operations, permission checks, or policy enforcement may be based on an outdated snapshot. A race window does not need to be large to matter, especially when the affected logic controls authentication, authorisation, or sensitive workflow transitions. The CWE Top 25 Guide is a useful reference for understanding how race conditions and related weaknesses are treated as recurring root causes in secure coding.

Why MAID Is Dangerous

MAID is dangerous because it can invalidate a security check without obvious failure symptoms. The code may look correct, tests may pass, and the dangerous behaviour may only appear under concurrency, load, or unusual timing. That makes it hard to detect with ordinary functional testing.

In practice, MAID can lead to policy bypass, privilege misuse, or inconsistent handling of objects that were expected to remain stable. It is closely related to time-of-check, time-of-use problems, and it can become exploitable when attackers can influence timing, trigger repeated requests, or cause concurrent modification. For a broader catalogue of weakness patterns and related race-condition classes, the MITRE CWE program remains the canonical taxonomy, while MITRE ATT&CK Enterprise Matrix is useful when the issue is part of a larger exploitation chain.

How Engineers Prevent and Detect MAID

Defence starts with treating shared state as untrusted until the moment it is consumed. Code that depends on a value for a security decision should minimise the gap between check and use, avoid mutable shared objects where possible, and prefer designs that work on immutable copies or revalidated state.

Detection is harder than prevention, so review should focus on concurrency-sensitive code paths, especially those that gate access, file handling, or trust decisions. Static analysis, targeted race testing, and code review for shared-state assumptions are all important, and developers should look for places where a value is checked once but reused later without verification. Secure coding guidance such as the OWASP Application Security Verification Standard and the NIST Cybersecurity Framework 2.0 help frame the broader control expectations around software integrity and secure change management.

Risk and Threat Considerations

MAID creates a timing-dependent exposure that attackers can exploit when a security decision and the later action are separated by even a short window. The most serious failures occur when a changed value affects authorisation, object ownership, or a safety check that the program assumes is still valid.

Failure mechanism: A value is validated, then modified elsewhere before the dependent operation executes, so the program acts on stale trust.

Impact: The result can be policy bypass, privilege abuse, incorrect access to data or resources, or inconsistent enforcement under concurrency.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while CIS Controls v8, OWASP ASVS, NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
CIS Controls v8 CIS-16 — Application Software Security MAID is a software weakness that secure coding and review controls should catch.
Recommendation — Review concurrency-sensitive code for stale-security-check patterns and race-prone shared state.
OWASP ASVS V15 — Secure Coding and Architecture MAID is an architectural and coding flaw that ASVS secure design guidance helps prevent.
Recommendation — Design shared-state logic so security decisions are revalidated immediately before use.
MITRE ATT&CK T1078 — Valid Accounts MAID can enable misuse of trusted access paths when stale checks permit unauthorized actions.
Recommendation — Correlate suspicious access with race-prone code paths and verify authorization at use time.
NIST SP 800-53 Rev 5 SI-10 — Information Input Validation MAID often survives when code trusts previously checked state instead of validating at use time.
Recommendation — Validate security-relevant state at the point of use, not only at the point of receipt.
NIST CSF 2.0 PR.DS-01 — Data-at-Rest Is Protected MAID concerns integrity of data assumptions that underpin safe protection and use of information.
Recommendation — Preserve integrity by preventing untrusted state changes from affecting protected workflows.

Practitioner Guidance

What to watch for: Focus review on code that stores shared mutable state, especially when a later operation depends on the earlier result of a check. If the state can change between those steps, assume the security decision is fragile until the design proves otherwise.

Practitioner takeaway: The safest pattern is to re-read or revalidate the exact state you are about to use, not the state you checked earlier.