CWE-486: Comparison of Classes by Name
The product compares classes by name, which can cause it to use the wrong class when multiple classes can have the same name.
Last updated
Overview
If the decision to trust the methods and data of an object is based on the name of a class, it is possible for malicious users to send objects of the same name as trusted classes and thereby gain the trust afforded to known classes and types.
Common consequences
What can happen when CWE-486 is exploited.
Execute Unauthorized Code or Commands
Affects: Integrity, Confidentiality, Availability
If a product relies solely on the name of an object to determine identity, it may execute the incorrect or unintended code.
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-486, grouped by where in the lifecycle they apply.