| Impact | Details |
|---|---|
|
DoS: Resource Consumption (CPU); DoS: Resource Consumption (Memory) |
Scope: Availability
Resources including CPU, memory, and stack memory could be rapidly consumed or exhausted, eventually leading to an exit or crash.
|
|
Read Application Data |
Scope: Confidentiality
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.
|
| Phase(s) | Mitigation |
|---|---|
|
Implementation |
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.
Effectiveness: Moderate |
|
Implementation |
Increase the stack size.
Effectiveness: Limited Note:
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.
|
| Nature | Type | ID | Name |
|---|---|---|---|
| ChildOf | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 834 | Excessive Iteration |
| ParentOf | Base Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource. | 776 | Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion') |
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | View View - a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). | 1003 | Weaknesses for Simplified Mapping of Published Vulnerabilities |
| ParentOf | Base Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource. | 776 | Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion') |
| Phase | Note |
|---|---|
| Implementation | The uncontrolled recursion is often due to an improper or missing conditional |
Class: Not Language-Specific (Undetermined Prevalence)
Example 1
In this example a mistake exists in the code where the exit condition contained in flg is never called. This results in the function calling itself over and over again until the stack is exhausted.
Note that the only difference between the Good and Bad examples is that the recursion flag will change value and cause the recursive call to return.
Note: this is a curated list of examples for users to understand the variety of ways in which this weakness can be introduced. It is not a complete list of all CVEs that are related to this CWE entry.
| Reference | Description |
|---|---|
|
Deeply nested arrays trigger stack exhaustion.
|
|
|
Self-referencing pointers create infinite loop and resultant stack exhaustion.
|
|
|
Javascript application accidentally changes input in a way that prevents a recursive call from detecting an exit condition.
|
|
|
An attempt to recover a corrupted XML file infinite recursion protection counter was not always incremented missing the exit condition.
|
|
|
USB-audio driver's descriptor code parsing allows unlimited recursion leading to stack exhaustion.
|
| Method | Details |
|---|---|
|
Automated Static Analysis |
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Effectiveness: High |
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 730 | OWASP Top Ten 2004 Category A9 - Denial of Service |
| MemberOf | ViewView - a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). | 884 | CWE Cross-section |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 985 | SFP Secondary Cluster: Unrestricted Consumption |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1129 | CISQ Quality Measures (2016) - Reliability |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1410 | Comprehensive Categorization: Insufficient Control Flow Management |
Rationale
This CWE entry is a Class and might have Base-level children that would be more appropriateComments
Examine children of this entry to see if there is a better fit| Mapped Taxonomy Name | Node ID | Fit | Mapped Node Name |
|---|---|---|---|
| OWASP Top Ten 2004 | A9 | CWE More Specific | Denial of Service |
| Software Fault Patterns | SFP13 | Unrestricted Consumption | |
| OMG ASCRM | ASCRM-CWE-674 |
| Submissions | ||
|---|---|---|
| Submission Date | Submitter | Organization |
|
2008年04月11日
(CWE Draft 9, 2008年04月11日) |
CWE Content Team | MITRE |
| Modifications | ||
| Modification Date | Modifier | Organization |
|
2024年02月29日
(CWE 4.14, 2024年02月29日) |
CWE Content Team | MITRE |
| updated Demonstrative_Examples | ||
| 2023年06月29日 | CWE Content Team | MITRE |
| updated Mapping_Notes | ||
| 2023年04月27日 | CWE Content Team | MITRE |
| updated Detection_Factors, Relationships | ||
| 2023年01月31日 | CWE Content Team | MITRE |
| updated Description, Relationships | ||
| 2022年10月13日 | CWE Content Team | MITRE |
| updated Demonstrative_Examples | ||
| 2021年03月15日 | CWE Content Team | MITRE |
| updated Potential_Mitigations | ||
| 2020年12月10日 | CWE Content Team | MITRE |
| updated Demonstrative_Examples, Description, Modes_of_Introduction, Observed_Examples, Potential_Mitigations, Time_of_Introduction | ||
| 2020年02月24日 | CWE Content Team | MITRE |
| updated Related_Attack_Patterns, Relationships | ||
| 2019年06月20日 | CWE Content Team | MITRE |
| updated Related_Attack_Patterns, Relationships, Type | ||
| 2019年01月03日 | CWE Content Team | MITRE |
| updated References, Related_Attack_Patterns, Relationships, Taxonomy_Mappings | ||
| 2017年11月08日 | CWE Content Team | MITRE |
| updated Applicable_Platforms, Relationships | ||
| 2014年07月30日 | CWE Content Team | MITRE |
| updated Relationships, Taxonomy_Mappings | ||
| 2014年02月18日 | CWE Content Team | MITRE |
| updated Related_Attack_Patterns | ||
| 2013年02月21日 | CWE Content Team | MITRE |
| updated Relationships | ||
| 2012年10月30日 | CWE Content Team | MITRE |
| updated Potential_Mitigations | ||
| 2012年05月11日 | CWE Content Team | MITRE |
| updated Relationships | ||
| 2011年06月01日 | CWE Content Team | MITRE |
| updated Common_Consequences | ||
| 2011年03月29日 | CWE Content Team | MITRE |
| updated Relationships | ||
| 2009年03月10日 | CWE Content Team | MITRE |
| updated Related_Attack_Patterns | ||
| 2008年09月08日 | CWE Content Team | MITRE |
| updated Common_Consequences, Relationships, Taxonomy_Mappings | ||
| 2008年07月01日 | Eric Dalci | Cigital |
| updated Potential_Mitigations, Time_of_Introduction | ||
Use of the Common Weakness Enumeration (CWE™) and the associated references from this website are subject to the Terms of Use. CWE is sponsored by the U.S. Department of Homeland Security (DHS) Cybersecurity and Infrastructure Security Agency (CISA) and managed by the Homeland Security Systems Engineering and Development Institute (HSSEDI) which is operated by The MITRE Corporation (MITRE). Copyright © 2006–2025, The MITRE Corporation. CWE, CWSS, CWRAF, and the CWE logo are trademarks of The MITRE Corporation.