CWE-587: Assignment of a Fixed Address to a Pointer
The product sets a pointer to a specific address other than NULL or 0.
How it's found
Assignment of a Fixed Address to a Pointer is a specific, narrowly defined instance of a broader pattern. Testers confirm it with targeted code review and a proof-of-concept input that exercises the exact code path this weakness describes.
Using a fixed address is not portable, because that address will probably not be valid in all environments or platforms.
Consequences
- Execute Unauthorized Code or Commands: If one executes code at a known location, an attacker might be able to inject code there beforehand.
- DoS: 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.
- Read Memory, Modify Memory: The data at a known pointer location can be easily read or influenced by an attacker.
Mitigations
- Implementation: Never set a pointer to a fixed address.
Where this fits in a TurboPentest engagement
This weakness is not covered by the automated black-box pentest. IntegSec pentesters cover it in a manual engagement.
Frequently asked questions
What is CWE-587?
The product sets a pointer to a specific address other than NULL or 0.
How do you find Assignment of a Fixed Address to a Pointer?
Assignment of a Fixed Address to a Pointer is a specific, narrowly defined instance of a broader pattern. Testers confirm it with targeted code review and a proof-of-concept input that exercises the exact code path this weakness describes.
What is the impact of CWE-587?
Execute Unauthorized Code or Commands: If one executes code at a known location, an attacker might be able to inject code there beforehand. DoS: 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. Read Memory, Modify Memory: The data at a known pointer location can be easily read or influenced by an attacker.
Does TurboPentest test for Assignment of a Fixed Address to a Pointer?
This weakness is not covered by the automated black-box pentest. IntegSec pentesters cover it in a manual engagement.
Related CWEs
Written and reviewed by
Michel Chamberland - Founder & CEO, IntegSec
CISSP, OSCP, OSCE, CEH, GIAC, CCSK · 20+ years in offensive security
Michel has spent 20+ years on offensive security teams including IBM X-Force Red and Trustwave SpiderLabs, leading penetration tests, red team engagements, and breach response for Fortune 500 customers. He is the founder of IntegSec and the architect of TurboPentest.
Find these issues before an attacker does
TurboPentest runs an agentic AI pentest against your target and reports findings with proof, from $99 per target.
Start a pentest