CWE-595: Comparison of Object References Instead of Object Contents
The product compares object references instead of the contents of the objects themselves, preventing it from detecting equivalent objects.
Last updated
Overview
For example, in Java, comparing objects using == usually produces deceptive results, since the == operator compares object references rather than values; often, this means that using == for strings is actually comparing the strings' references, not their values.
Common consequences
What can happen when CWE-595 is exploited.
Varies by Context
Affects: Other
This weakness can lead to erroneous results that can cause unexpected application behaviors.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Languages
How to prevent it
Practical mitigations for CWE-595, grouped by where in the lifecycle they apply.