ClassDraft

CWE-674Uncontrolled Recursion

Category: other

Description

The product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack.

Common consequences· 2

  • Availability — DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory)
    Resources including CPU, memory, and stack memory could be rapidly consumed or exhausted, eventually leading to an exit or crash.
  • Confidentiality — Read Application Data
    In some cases, an application's interpreter might kill a process or thread that appears to be consuming too much resources, such as with PHP's memory_limit setting. When the interpreter kills the process/thread, it might report an error containing detailed information such as the application's installation path.

Potential mitigations· 2

  • [Implementation]Ensure that an end condition will be reached under all logic conditions. The end condition may include checking against the depth of recursion and exiting with an error if the recursion goes too deep. The complexity of the end condition contributes to the effectiveness of this action.
  • [Implementation]Increase the stack size.

Related CAPEC attack patterns· 2

CAPEC-230CAPEC-231

References

  1. https://cwe.mitre.org/data/definitions/674.html

Exploits (incoming)2

TypeTargetConfidenceTier
AttackPatternOversized Serialized Data Payloadscapec-231100%live
AttackPatternSerialized Data with Nested Payloadscapec-230100%live

(incoming)4

TypeTargetConfidenceTier
VulnerabilityCVE-2025-5302cve-2025-53020%live
VulnerabilityCVE-2026-25971cve-2026-259710%live
VulnerabilityCVE-2026-40324cve-2026-403240%live
VulnerabilityCVE-2026-43185cve-2026-431850%live

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Excessive Use of Self-Modifying Code
CWE
Improperly Controlled Sequential Memory Allocation
CWE
Unchecked Input for Loop Condition
CWE
Improper Cleanup on Thrown Exception
CWE
Uncontrolled Resource Consumption
CWE
Loop with Unreachable Exit Condition ('Infinite Loop')
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.