Katalog CWE

CWE-674 · Słabość

Uncontrolled Recursion

Abstrakcja
Klasa
Status
Szkic
Dodano
11 kwietnia 2008
Ostatnia zmiana
30 kwietnia 2026

Podatności CVE z tą słabościąPełny wpis na cwe.mitre.org ↗

Opis

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

Inne nazwy

Stack Exhaustion

Skutki

  • 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.

Zapobieganie

  • 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.

    Skuteczność: Moderate

  • Implementation

    Increase the stack size.

    Skuteczność: Limited

Przykłady podatności

Słabość nadrzędna

Słabości podrzędne

Kiedy powstaje

Dotyczy

Not Language-Specific

Źródła

  1. Automated Source Code Reliability Measure (ASCRM) — Object Management Group (OMG), ASCRM-CWE-674, 2016

Wpis z katalogu CWE 4.20.