Description
The product initializes critical internal variables or data stores using inputs that can be modified by untrusted actors.
A product system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. The variables may have been initialized incorrectly. If an attacker can initialize the variable, then they can influence what the vulnerable system will do.
Potential Impact
Integrity
Modify Application Data
Demonstrative Examples
int debugLevel = Integer.getInteger("com.domain.application.debugLevel").intValue();$debugEnabled = false;if ($_POST["debug"] == "true"){$debugEnabled = true;}
/.../
function login($username, $password){if($debugEnabled){echo 'Debug Activated';phpinfo();$isAdmin = True;return True;}}Mitigations & Prevention
A product system should be reluctant to trust variables that have been initialized outside of its trust boundary. Ensure adequate checking (e.g. input validation) is performed when relying on input from outside a trust boundary.
Avoid any external control of variables. If necessary, restrict the variables that can be modified using an allowlist, and use a different namespace or naming convention if possible.
Detection Methods
- Automated Static Analysis — Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then sea
Real-World CVE Examples
| CVE ID | Description |
|---|---|
| CVE-2022-43468 | WordPress module sets internal variables based on external inputs, allowing false reporting of the number of views |
| CVE-2000-0959 | Does not clear dangerous environment variables, enabling symlink attack. |
| CVE-2001-0033 | Specify alternate configuration directory in environment variable, enabling untrusted path. |
| CVE-2001-0872 | Dangerous environment variable not cleansed. |
| CVE-2001-0084 | Specify arbitrary modules using environment variable. |
Related Weaknesses
Taxonomy Mappings
- PLOVER: — External initialization of trusted variables or values
- Software Fault Patterns: SFP25 — Tainted input to variable
Frequently Asked Questions
What is CWE-454?
CWE-454 (External Initialization of Trusted Variables or Data Stores) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. The product initializes critical internal variables or data stores using inputs that can be modified by untrusted actors.
How can CWE-454 be exploited?
Attackers can exploit CWE-454 (External Initialization of Trusted Variables or Data Stores) to modify application data. This weakness is typically introduced during the Architecture and Design, Implementation phase of software development.
How do I prevent CWE-454?
Key mitigations include: A product system should be reluctant to trust variables that have been initialized outside of its trust boundary. Ensure adequate checking (e.g. input validation) is performed when relying on input fr
What is the severity of CWE-454?
CWE-454 is classified as a Base-level weakness (Medium abstraction). It has been observed in 5 real-world CVEs.