Assignment of a Fixed Address to a Pointer |
Weakness ID: 587 (Weakness Base) | Status: Draft |
Description Summary
The software sets a pointer to a specific address other than NULL or 0.
Extended Description
Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.
Scope | Effect |
---|---|
Integrity | If one executes code at a known location, an attacker might be able to inject code there beforehand. |
Availability | If the code is ported to another platform or environment, the pointer is likely to be invalid and cause a crash. |
Confidentiality | The data at a known pointer location can be easily read or influenced by an attacker. |
Example 1
(Bad Code)
Example Language: C
int (*pt2Function) (float, char, char)=0x08040000;
int result2 = (*pt2Function) (12, 'a', 'b');
// Here we can inject code to execute.
Ordinality | Description |
---|---|
Primary | (where the weakness exists independent of other weaknesses) |
Nature | Type | ID | Name | View(s) this relationship pertains to![]() |
---|---|---|---|---|
ChildOf | ![]() | 344 | Use of Invariant Value in Dynamically Changing Context | Research Concepts (primary)1000 |
ChildOf | ![]() | 465 | Pointer Issues | Development Concepts (primary)699 |
ChildOf | ![]() | 738 | CERT C Secure Coding Section 04 - Integers (INT) | Weaknesses Addressed by the CERT C Secure Coding Standard (primary)734 |
ChildOf | ![]() | 758 | Reliance on Undefined, Unspecified, or Implementation-Defined Behavior | Research Concepts1000 |
Mapped Taxonomy Name | Node ID | Fit | Mapped Node Name |
---|---|---|---|
CERT C Secure Coding | INT11-C | Take care when converting from pointer to integer or integer to pointer |
A weakness where code path has: 1. end statement that assigns an address to a pointer 2. start statement that defines the address and the address is a literal value |
Modifications | ||||
---|---|---|---|---|
Modification Date | Modifier | Organization | Source | |
2008-07-01 | Eric Dalci | Cigital | External | |
updated Time of Introduction | ||||
2008-08-01 | KDM Analytics | External | ||
added/updated white box definitions | ||||
2008-09-08 | CWE Content Team | MITRE | Internal | |
updated Applicable Platforms, Description, Relationships, Other Notes, Weakness Ordinalities | ||||
2008-11-24 | CWE Content Team | MITRE | Internal | |
updated Relationships, Taxonomy Mappings | ||||
2009-03-10 | CWE Content Team | MITRE | Internal | |
updated Relationships | ||||
2009-07-27 | CWE Content Team | MITRE | Internal | |
updated Common Consequences, Description, Other Notes |