CWE-344: Use of Invariant Value in Dynamically Changing Context
The product uses a constant value, name, or reference, but this value can (or should) vary across different environments.
Last updated
Overview
CWE-344 (Use of Invariant Value in Dynamically Changing Context) is a base-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
Real-world CVEs
2 recorded CVEs are caused by CWE-344 (Use of Invariant Value in Dynamically Changing Context). The highest-severity and most recent are shown first. 1 new CWE-344 CVE has been recorded so far in 2026.
Common consequences
What can happen when CWE-344 is exploited.
Varies by Context
Affects: Other
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Code examples
Illustrative examples from MITRE showing how the weakness appears in code.
The following code is an example of an internal hard-coded password in the back-end:
Vulnerable example
int VerifyAdmin(char *password) {Vulnerable example
int VerifyAdmin(String password) {Every instance of this program can be placed into diagnostic mode with the same password. Even worse is the fact that if this program is distributed as a binary-only distribution, it is very difficult to change that password or disable this "functionality."
This code assumes a particular function will always be found at a particular address. It assigns a pointer to that address and calls the function.
Vulnerable example
// Here we can inject code to execute.
int (*pt2Function) (float, char, char)=0x08040000;The same function may not always be found at the same memory address. This could lead to a crash, or an attacker may alter the memory at the expected address, leading to arbitrary code execution.
Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2002-0980 — Component for web browser writes an error message to a known location, which can then be referenced by attackers to process HTML/script in a less restrictive context
Terminology & mappings
Mapped taxonomies
- PLOVER: Static Value in Unpredictable Context
Frequently asked questions
Common questions about CWE-344.
- What is CWE-344?
- The product uses a constant value, name, or reference, but this value can (or should) vary across different environments.
- What CVEs are caused by CWE-344?
- 2 recorded CVEs are attributed to CWE-344, including CVE-2022-36022, CVE-2026-42961.
- What are the consequences of CWE-344?
- Exploiting CWE-344 can lead to: Varies by Context.
- Is CWE-344 actively exploited?
- 2 recorded CVEs are caused by CWE-344; none are currently in CISA's KEV catalog of actively exploited flaws.
References
- MITRE CWE definition (CWE-344) (opens in a new tab)
- CWE-344 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Stay ahead of CWE-344
Get alerted the moment a new CWE-344 vulnerability affects your stack, with AI-written analysis, severity context, and remediation guidance.