CWE-482: Comparing instead of Assigning
The code uses an operator for comparison when the intention was to perform an assignment.
Last updated
Overview
CWE-482 (Comparing instead of Assigning) is a variant-level software weakness catalogued by MITRE in the Common Weakness Enumeration (CWE). It describes a recurring type of mistake that can lead to exploitable security vulnerabilities.
Common consequences
What can happen when CWE-482 is exploited.
Unexpected State
Affects: Availability, Integrity
The assignment will not take place, which should cause obvious program execution problems.
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-482, grouped by where in the lifecycle they apply.