CWEweakness

CWE-674 Uncontrolled Recursion

Official page ↗
Alternate terms
Stack Exhaustion
Abstraction
Class
Structure
Simple
Status
Draft
Languages
Not Language-Specific
CWE version
5.0

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

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

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

Detection methods

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

Observed examples

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

Related

Attack pattern · CAPEC (2)

  • CAPEC-230 Serialized Data with Nested Payloads attack pattern
  • CAPEC-231 Oversized Serialized Data Payloads attack pattern

Observed example · CVE (5)

  • CVE-2019-15118 check_input_term in sound/usb/mixer.c in the Linux kernel through 5.2.9 mishandles recursion, leading to kernel stack exhaustion. vulnerability
  • CVE-2016-10707 jQuery 3.0.0-rc.1 is vulnerable to Denial of Service (DoS) due to removing a logic that lowercased attribute names. vulnerability
  • CVE-2016-3627 The xmlStringGetNodeList function in tree.c in libxml2 2.9.3 and earlier, when used in recovery mode, allows context-dependent attackers to… vulnerability
  • CVE-2007-3409 Net::DNS before 0.60, a Perl module, allows remote attackers to cause a denial of service (stack consumption) via a malformed compressed… vulnerability
  • CVE-2007-1285 The Zend Engine in PHP 4.x before 4.4.7, and 5.x before 5.2.2, allows remote attackers to cause a denial of service (stack exhaustion and… vulnerability

Child of · CWE (1)

  • CWE-834 Excessive Iteration weakness

Referenced by CAPEC · weakness (2)

  • CAPEC-230 Serialized Data with Nested Payloads attack pattern
  • CAPEC-231 Oversized Serialized Data Payloads attack pattern

Referenced by CVE · weakness (642)

  • CVE-2026-105042 A message body that is deeply nested and decoded by pn_message_body() could overflow the stack and cause a crash. vulnerability
  • CVE-2026-119123 ImageMagick before 7.1.2-34 contains a stack overflow vulnerability in the TIFF decoder that occurs when the DNG decoder is disabled. vulnerability
  • CVE-2026-119137 Wasmtime 42.0.0 before 48.0.6 and 49.0.0 before 49.0.3 contains a stack overflow vulnerability that allows guests to crash the host through… vulnerability
  • CVE-2026-118035 In Progress® Telerik® Document Processing Libraries prior to version 2026.3.1027, uncontrolled recursion, inefficient algorithmic… vulnerability
  • CVE-2026-118036 In Progress® Telerik® Document Processing Libraries prior to version 2026.3.1027, uncontrolled recursion, infinite loop, inefficient… vulnerability
  • CVE-2026-118037 In Progress® Telerik® Document Processing Libraries prior to version 2026.3.1027, uncontrolled recursion, infinite loop, unchecked loop… vulnerability
  • CVE-2026-88858 A user with the Viewer role in Grafana can crash the server by submitting a crafted server-side math expression (uncontrolled recursion). vulnerability
  • CVE-2026-108331 Tanium addressed an infinite loop vulnerability in Threat Response Client Extension. vulnerability
  • CVE-2026-116871 Semantic MediaWiki 3.0.0 before 7.3.1 contains an uncontrolled recursion vulnerability in LegacyParser::getSubqueryDescription() that… vulnerability
  • CVE-2026-116586 Go JOSE provides an implementation of the Javascript Object Signing and Encryption set of standards in Go, including support for JSON Web… vulnerability
  • CVE-2026-65628 jose_jwk:shared_secret/2 (exposed in Elixir as JOSE.JWK.shared_secret/2) derives an ECDH shared secret from two JWKs. vulnerability
  • CVE-2026-116144 ImageMagick before 6.9.13-58 and 7.x before 7.1.2-33 contains uncontrolled recursion in the MVG decoder that can lead to a stack overflow. vulnerability
  • CVE-2026-116011 Crow before 1.3.4 contains an uncontrolled recursion vulnerability in crow::json::load() that allows remote unauthenticated attackers to… vulnerability
  • CVE-2026-110974 The org.json parser in com.vaadin.external.google:android-json recurses once per nesting level with no depth limit: JSONTokener.nextValue()… vulnerability
  • CVE-2026-114605 dnspython is a DNS toolkit for Python. vulnerability
  • CVE-2026-66282 In EmberZNet 9.1.1 and earlier, a malformed Publish Billing Period command can result in a recursive function call that will never reach… vulnerability
  • CVE-2026-54425 Uncontrolled recursion in the HTTP/2 HPACK decoder in Apache bRPC before 1.18.0 allows remote attackers to cause denial of service by… vulnerability
  • CVE-2026-54426 Uncontrolled recursion in the Redis reply parser in Apache bRPC < 1.18.0 allows a remote Redis server peer to crash a bRPC Redis client… vulnerability
  • CVE-2026-54427 Uncontrolled recursion in the AMF parser in Apache bRPC < 1.18.0 allows a remote RTMP peer to crash a bRPC process by sending deeply nested… vulnerability
  • CVE-2026-82230 Uncontrolled recursion in the mcpack2pb component in Apache bRPC (version < 1.18.0) on all platforms allows remote attackers to make the… vulnerability
  • CVE-2026-92822 A flaw was found in libmodulemd. vulnerability
  • CVE-2026-113650 ApostropheCMS is an open-source Node.js content management system. vulnerability
  • CVE-2026-110673 Cpanel::JSON::XS versions before 4.80 for Perl allow stack exhaustion via nested tagged values under allow_tags in decode_tag. vulnerability
  • CVE-2026-112368 An uncontrolled recursion weakness in the BSON decoding logic of the MongoDB PHP driver may allow an unauthenticated party who can supply… vulnerability
  • CVE-2026-112895 Pillow is a Python imaging library. vulnerability
  • CVE-2026-8168 Uncontrolled recursion in the SVG parser and renderer of the Qt SVG module (QtSvg) in Qt Group Qt allows attackers to cause a denial of… vulnerability
  • CVE-2026-111923 Fleet before 4.89.0 contains an unbounded recursion vulnerability in Apple MDM enrollment property list parsing that allows unauthenticated… vulnerability
  • CVE-2026-55862 pupnp is an SDK for development of UPnP device and control point applications. vulnerability
  • CVE-2026-100354 kin-openapi is a Go project for handling OpenAPI files. vulnerability
  • CVE-2026-109413 In Symfony YAML prior to versions 5.4.54, 6.4.45, 7.4.18, and 8.1.6, Yaml\Parser::lexInlineStructure() recursed through lexInlineMapping()… vulnerability
Show all 642 ›

Referenced by CWE · child of (1)

  • CWE-776 Improper Restriction of Recursive Entity References in DTDs weakness

Referenced by CWE · has member (2)

  • CWE-1003 Weaknesses for Simplified Mapping of Published Vulnerabilities view
  • CWE-884 CWE Cross-section view