Description
The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack.
Modes of Introduction:
– Implementation
Related Weaknesses
Consequences
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
Phase: Implementation
Effectiveness: Moderate
Description:
Ensure an end condition will be reached under all logic conditions. The end condition may include testing 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.
Phase: Implementation
Effectiveness: Limited
Description:
Increase the stack size.
Increasing the stack size might only be a temporary measure, since the stack typically is still not very large, and it might remain easy for attackers to cause an out-of-stack fault.
CVE References
- CVE-2007-1285
- Deeply nested arrays trigger stack exhaustion.
- CVE-2007-3409
- Self-referencing pointers create infinite loop and resultant stack exhaustion.
- CVE-2016-10707
- Javascript application accidentally changes input in a way that prevents a recursive call from detecting an exit condition.
- CVE-2016-3627
- An attempt to recover a corrupted XML file infinite recursion protection counter was not always incremented missing the exit condition.
- CVE-2019-15118
- USB-audio driver’s descriptor code parsing allows unlimited recursion leading to stack exhaustion.
More Stories
The Most Dangerous Vulnerabilities in Apache Tomcat and How to Protect Against Them
Apache Tomcat is an open-source web server and servlet container that is widely used in enterprise environments to run Java...
ZDI-CAN-18333: A Critical Zero-Day Vulnerability in Microsoft Windows
Zero-day vulnerabilities are a serious threat to cybersecurity, as they can be exploited by malicious actors to gain unauthorized access...
CWE-669 – Incorrect Resource Transfer Between Spheres
Description The product does not properly transfer a resource/behavior to another sphere, or improperly imports a resource/behavior from another sphere,...
CWE-67 – Improper Handling of Windows Device Names
Description The software constructs pathnames from user input, but it does not handle or incorrectly handles a pathname containing a...
CWE-670 – Always-Incorrect Control Flow Implementation
Description The code contains a control flow path that does not reflect the algorithm that the path is intended to...
CWE-671 – Lack of Administrator Control over Security
Description The product uses security features in a way that prevents the product's administrator from tailoring security settings to reflect...