COMMON WEAKNESS ENUMERATIONIncomplete

CWE-407

Inefficient Algorithmic Complexity

An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.

Abstraction

Class

Structure

Simple

Likelihood of Exploit

Low

Understand the problem

What is the problem?

An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.

Terminology

Alternate terms and usages

Quadratic Complexity

Used when the algorithmic complexity is related to the square of the number of inputs (N^2)

Root cause

How and when does the problem arise?

Lifecycle phase

Architecture and Design

Lifecycle phase

Implementation

Risk

What does successful exploitation lead to?

DoS: Resource Consumption (CPU)DoS: Resource Consumption (Memory)DoS: Resource Consumption (Other)

Affected security scopes: Availability

The typical consequence is CPU consumption, but memory consumption and consumption of other resources can also occur.

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.