CWE-670: Always-Incorrect Control Flow Implementation

What is CWE-670?

CWE-670 is Always-Incorrect Control Flow Implementation. The flaw arises when the code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated. The database currently holds 31 vulnerabilities mapped to CWE-670 and none of them are in the CISA Known Exploited Vulnerabilities catalog.

OWASP Top 10 Rank-
Related CVES (365 days)31
AbstractionClass
Likelihood of exploit-

Vulnerabilities mapped to CWE-670

31 vulnerabilities417% increase year over year

No data

No vulnerability data in CISA KEV for CWE-670

Official definition

ByMitre CWE

The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.

This weakness captures cases in which a particular code segment is always incorrect with respect to the algorithm that it is implementing. For example, if a C programmer intends to include multiple statements in a single block but does not include the enclosing braces (CWE-483), then the logic is always incorrect. This issue is in contrast to most weaknesses in which the code usually behaves correctly, except when it is externally manipulated in malicious ways.

Characteristics

Modes of introduction

  • Implementation: This issue typically appears in rarely-tested code, since the "always-incorrect" nature will be detected as a bug during normal usage.

Common consequences

ImpactScopeExplanation
Other, Alter Execution LogicOther-

Representative vulnerabilities

Sources (2)

CWE™ Program, operated by The MITRE Corporation. Copyright © 2006–2026, The MITRE Corporation. The MITRE Corporation hereby grants you a non-exclusive, royalty-free license to use CWE for research, development, and commercial purposes. CWE Terms of Use.

Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.