Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-344 (在动态变化上下文中使用不变值) — Vulnerability Class 2

2 vulnerabilities classified as CWE-344 (在动态变化上下文中使用不变值). AI Chinese analysis included.

CWE-344 represents a configuration weakness where a product relies on a constant value, name, or reference that fails to adapt across varying environments. This flaw typically arises when developers hardcode assumptions about network addresses, file paths, or system identifiers, assuming a static infrastructure. Attackers exploit this by manipulating the execution context or environment variables to trigger unexpected behavior, such as accessing unintended resources or bypassing security controls. For instance, a service hardcoded to listen on localhost may inadvertently expose itself if the environment changes, allowing remote exploitation. To prevent this, developers must implement dynamic configuration management, ensuring that critical values are derived from environment-specific settings rather than being statically defined. Rigorous testing across diverse deployment scenarios further helps identify and rectify these invariant dependencies before production release.

MITRE CWE Description
The product uses a constant value, name, or reference, but this value can (or should) vary across different environments.
Common Consequences (1)
OtherVaries by Context
Examples (2)
The following code is an example of an internal hard-coded password in the back-end:
int VerifyAdmin(char *password) { if (strcmp(password, "Mew!")) { printf("Incorrect Password!\n"); return(0) } printf("Entering Diagnostic Mode...\n"); return(1); }
Bad · C
int VerifyAdmin(String password) { if (!password.equals("Mew!")) { return(0) } //Diagnostic Mode return(1); }
Bad · Java
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.
int (*pt2Function) (float, char, char)=0x08040000; int result2 = (*pt2Function) (12, 'a', 'b'); // Here we can inject code to execute.
Bad · C

Vulnerabilities classified as CWE-344 (在动态变化上下文中使用不变值) represent 2 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.