CWE-674
Uncontrolled Recursion
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.
Parent Weaknesses (ChildOf)
Common Consequences
Scope
Impact
DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory)
Scope
Impact
Read Application Data
Potential Mitigations
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.
Increase the stack size.
CVE-2007-1285Deeply nested arrays trigger stack exhaustion.
CVE-2007-3409Self-referencing pointers create infinite loop and resultant stack exhaustion.
CVE-2016-10707Javascript application accidentally changes input in a way that prevents a recursive call from detecting an exit condition.
CVE-2016-3627An attempt to recover a corrupted XML file infinite recursion protection counter was not always incremented missing the exit condition.
CVE-2019-15118USB-audio driver's descriptor code parsing allows unlimited recursion leading to stack exhaustion.
Applicable Platforms
Security Training
Train your team to recognize and prevent security threats with our comprehensive security awareness program.
Start TrainingVulnerability Scanning
Discover vulnerabilities in your applications and infrastructure before attackers do.
Scan Now