CWE-783

Operator Precedence Logic Error
AI Translation Available

The product uses an expression in which operator precedence causes incorrect logic to be used.

Status
draft
Abstraction
base
Likelihood
low
C C++ Not Language-Specific

While often just a bug, operator precedence logic errors can have serious consequences if they are used in security-critical code, such as making an authentication decision.

Common Consequences

confidentiality integrity availability
Impacts
varies by context unexpected state

Detection Methods

automated static analysis

Potential Mitigations

Phases:
implementation
Descriptions:
• Regularly wrap sub-expressions in parentheses, especially in security-critical code.