---
title: "CWE-587: Assignment of a Fixed Address to a Pointer"
url: https://radicalnotion.ai/cwe/cwe-587
type: cwe
description: "The product sets a pointer to a specific address other than NULL or 0."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-587: Assignment of a Fixed Address to a Pointer

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 1
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## Description

The product sets a pointer to a specific address other than NULL or 0.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Applicable platforms

**Languages:** Memory-Unsafe (Undetermined), C (Undetermined), C++ (Undetermined), C# (Undetermined), Assembly (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity, Confidentiality, Availability | Execute Unauthorized Code or Commands | If one executes code at a known location, an attacker might be able to inject code there beforehand. |
| Availability | 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. |
| Confidentiality, Integrity | Read Memory, Modify Memory | The data at a known pointer location can be easily read or influenced by an attacker. |

## Potential mitigations

### Implementation

Never set a pointer to a fixed address.

## Detection methods

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### Automated Dynamic Analysis

Use tools that are integrated during compilation to insert runtime error-checking mechanisms related to memory safety errors, such as AddressSanitizer (ASan) for C/C++ \[REF-1518\].

Effectiveness: Moderate. Crafted inputs are necessary to reach the code containing the error, such as generated by fuzzers. Also, these tools may reduce performance, and they only report the error condition - not the original mistake that led to the error.

## Demonstrative examples

### Example 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.

Bad code:

```c
int (*pt2Function) (float, char, char)=0x08040000;
int result2 = (*pt2Function) (12, 'a', 'b');
// Here we can inject code to execute.
```

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.

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2021-28216 | - | high | 7.8 | - | No | 2021-08-05 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-344](https://radicalnotion.ai/cwe/cwe-344) | Use of Invariant Value in Dynamically Changing Context |
| Parent | [CWE-758](https://radicalnotion.ai/cwe/cwe-758) | Reliance on Undefined, Unspecified, or Implementation-Defined Behavior |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| CERT C Secure Coding | Converting a pointer to integer or integer to pointer | INT36-C | Imprecise |
| Software Fault Patterns | Glitch in computation | SFP1 | - |

## Frequently asked questions

### What is CWE-587?

The product sets a pointer to a specific address other than NULL or 0.

### What CVEs are caused by CWE-587?

1 recorded CVE is attributed to CWE-587: CVE-2021-28216.

### How do you prevent CWE-587?

Never set a pointer to a fixed address.

### How is CWE-587 detected?

Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-587?

Exploiting CWE-587 can lead to: Execute Unauthorized Code or Commands, DoS: Crash, Exit, or Restart, Reduce Maintainability, Reduce Reliability, Read Memory, Modify Memory.

### Is CWE-587 actively exploited?

1 recorded CVE is caused by CWE-587; it is not currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/587.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-587). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
