COMMON WEAKNESS ENUMERATIONDraft

CWE-480

Use of Incorrect Operator

The product accidentally uses the wrong operator, which changes the logic in security-relevant ways.

Abstraction

Base

Structure

Simple

Likelihood of Exploit

Low

Understand the problem

What is the problem?

The product accidentally uses the wrong operator, which changes the logic in security-relevant ways.

Extended description

These types of errors are generally the result of a typo by the programmer.

Root cause

How and when does the problem arise?

Lifecycle phase

Implementation

Risk

What does successful exploitation lead to?

Alter Execution Logic

Affected security scopes: Other

This weakness can cause unintended logic to be executed and other unexpected application behavior.

Defence

How is it prevented and fixed?

  • Follow secure coding guidelines for input handling and boundary checking.
  • Enforce strict security reviews and automated static analysis (SAST) checks.

Verification

How is it detected?

Automated Static Analysis

This weakness can be found easily using static analysis. However in some cases an operator might appear to be incorrect, but is actually correct and reflects unusual logic within the program.

Manual Static Analysis

This weakness can be found easily using static analysis. However in some cases an operator might appear to be incorrect, but is actually correct and reflects unusual logic within the program.