CWE-464

Addition of Data Structure Sentinel

High

Description

The accidental addition of a data-structure sentinel can cause serious programming logic problems.

Potential Impact

How to Fix

Implementation

Encapsulate the user from interacting with data sentinels. Validate user input to verify that sentinels are not present.

Implementation

Proper error checking can reduce the risk of inadvertently introducing sentinel values into data. For example, if a parsing function fails or encounters an error, it might return a value that is the same as the sentinel.

Architecture and Design

Use an abstraction library to abstract away risky APIs. This is not a complete solution.

Operation

Use OS-level preventative functionality. This is not a complete solution.

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-464 vulnerabilities in your codebase.

Get Security Assessment