This flaw occurs when a developer accidentally uses the assignment operator (=) instead of the comparison operator (== or ===). The code assigns a value when it was meant to check for equality, which fundamentally changes the program's logic.
This error is a common typo because assignment and comparison operators look nearly identical in many programming languages (like using '=' instead of '=='). In a conditional statement like an 'if' check, the code will evaluate the assigned value itself, often leading to unexpected behavior where the condition always passes as 'true' or always fails. The result is typically a clear bug in program execution flow, such as skipping security checks or executing incorrect branches of code. While modern linters and compilers often warn about this pattern, it remains a frequent mistake during rapid development or code reviews, emphasizing the need for defensive coding practices and proper tooling.
Impact: Alter Execution Logic
cc#cjavajavajavacLow