Variable Manipulation
Attack Pattern ID: 171 (Standard Attack Pattern Completeness: Stub)Typical Severity: MediumStatus: Draft
+ Description


An attacker manipulates variables used by an application to perform a variet of possible attacks. This can either be performed through the manipulation of function call parameters or by manipulating external variables, such as environment variables, that are used by an application. Changing variable values is usually undertaken as part of another attack; for example, a path traversal (inserting relative path modifiers) or buffer overflow (enlarging a variable value beyond an application's ability to store it).

+ Attack Prerequisites

The targeted application must rely on external variables (e.g. environment variables) or user-controlled variables (e.g. call parameters) in such a way that malicious manipulation of them can subvert functionality.

+ Resources Required

The attacker must be able to manipulate the targeted variable. For some variables, such as URL-encoded parameters in a web call, this is very simple. For others, such as a system's environment variables, this can require additional resources or capabilities.

+ Solutions and Mitigations

Design: Range, size and value and consistency verification for any arguments supplied to application from external sources and devise appropriate error response.

Design: Ensure that variables that should not be manipulated by a user are not accessible to them.

+ Related Weaknesses
CWE-IDWeakness NameWeakness Relationship Type
471Modification of Assumed-Immutable Data (MAID)Targeted
20Improper Input ValidationTargeted
+ Related Attack Patterns
NatureTypeIDNameDescriptionView(s) this relationship pertains toView\(s\)
ChildOfCategoryCategory262Resource Manipulation 
Mechanism of Attack (primary)1000
ParentOfAttack PatternAttack Pattern76Manipulating Input to File System Calls 
Mechanism of Attack (primary)1000
ParentOfAttack PatternAttack Pattern166Force the System to Reset Values 
Mechanism of Attack (primary)1000
ParentOfAttack PatternAttack Pattern264Environment variable manipulation 
Mechanism of Attack (primary)1000
ParentOfAttack PatternAttack Pattern265Global variable manipulation 
Mechanism of Attack (primary)1000