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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-587 (将一个固定地址复制给指针) — Vulnerability Class 1

1 vulnerabilities classified as CWE-587 (将一个固定地址复制给指针). AI Chinese analysis included.

CWE-587 represents a critical programming weakness where developers explicitly assign a fixed memory address to a pointer, bypassing standard dynamic allocation mechanisms. This practice severely compromises portability, as specific memory locations are rarely valid across different operating systems, hardware architectures, or runtime environments. Exploitation typically occurs when an attacker leverages this hardcoded reference to overwrite critical data structures or execute arbitrary code, particularly if the fixed address falls within a predictable or accessible memory region. To mitigate this risk, developers must avoid hardcoding addresses entirely. Instead, they should utilize dynamic memory allocation functions like malloc or rely on language-specific abstractions that manage memory safely. By ensuring pointers reference valid, dynamically assigned memory, applications maintain robustness and compatibility across diverse platforms, eliminating the vulnerabilities associated with static memory assumptions.

MITRE CWE Description
The product sets a pointer to a specific address other than NULL or 0. Using a fixed address is not portable, because that address will probably not be valid in all environments or platforms.
Common Consequences (3)
Integrity, Confidentiality, AvailabilityExecute Unauthorized Code or Commands
If one executes code at a known location, an attacker might be able to inject code there beforehand.
AvailabilityDoS: Crash, Exit, or Restart, Reduce Maintainability, Reduce Reliability
If the code is ported to another platform or environment, the pointer is likely to be invalid and cause a crash.
Confidentiality, IntegrityRead Memory, Modify Memory
The data at a known pointer location can be easily read or influenced by an attacker.
Mitigations (1)
ImplementationNever set a pointer to a fixed address.
Examples (1)
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
CVE IDTitleCVSSSeverityPublished
CVE-2021-28216 Tianocore Edk2 安全漏洞 — EDK II 7.7 -2021-08-05

Vulnerabilities classified as CWE-587 (将一个固定地址复制给指针) represent 1 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.