Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-674 (未经控制的递归) — Vulnerability Class 147

147 vulnerabilities classified as CWE-674 (未经控制的递归). AI Chinese analysis included.

CWE-674 represents a resource management weakness where software fails to properly limit recursive function calls, leading to excessive consumption of system resources like memory or the program stack. This flaw is typically exploited by attackers who craft specific inputs that trigger deep or infinite recursion, causing the application to crash or become unresponsive. Such exploitation results in a denial-of-service condition, effectively disrupting service availability for legitimate users without requiring authentication or complex privilege escalation. To mitigate this risk, developers must implement robust safeguards, such as setting explicit maximum recursion depth limits or converting recursive algorithms into iterative ones using explicit data structures. Additionally, rigorous code reviews and static analysis tools can help identify potential infinite loops, ensuring that all recursive paths have clear termination conditions and adequate resource controls.

MITRE CWE 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 (2)
AvailabilityDoS: 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.
ConfidentialityRead 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 insta…
Mitigations (2)
ImplementationEnsure 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.
Effectiveness: Moderate
ImplementationIncrease the stack size.
Effectiveness: Limited
Examples (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.
void do_something_recursive (int flg) { ... // Do some real work here, but the value of flg is unmodified if (flg) { do_something_recursive (flg); }    // flg is never modified so it is always TRUE - this call will continue until the stack explodes } int flag = 1; // Set to TRUE do_something_recursive (flag);
Bad · C
void do_something_recursive (int flg) { ... // Do some real work here // Modify value of flg on done condition if (flg) { do_something_recursive (flg); }    // returns when flg changes to 0 } int flag = 1; // Set to TRUE do_something_recursive (flag);
Good · C
CVE IDTitleCVSSSeverityPublished
CVE-2023-29001 Uncontrolled recursion due to insufficient validation of the IPv6 source routing header in Contiki-NG — contiki-ng 7.5AIHighAI2024-11-27
CVE-2024-47831 Next.js image optimization has Denial of Service condition — next.js 5.9 Medium2024-10-14
CVE-2024-31228 Denial-of-service due to unbounded pattern matching in Redis — redis 5.5 Medium2024-10-07
CVE-2024-43414 Apollo Query Planner and Apollo Gateway may infinitely loop on sufficiently complex queries — federation 7.5 High2024-08-27
CVE-2024-42369 A room with itself as a its predecessor will freeze matrix-js-sdk — matrix-js-sdk 4.1 Medium2024-08-20
CVE-2024-7866 Stack overflow in Xpdf 4.05 due to object loop in PDF pattern — Xpdf 5.5AIMediumAI2024-08-15
CVE-2024-37973 Secure Boot Security Feature Bypass Vulnerability — Windows 10 Version 1809 8.8 High2024-07-09
CVE-2024-5971 Undertow: response write hangs in case of java 17 tlsv1.3 newsessionticket 7.5 High2024-07-08
CVE-2024-2965 Denial-of-Service in LangChain SitemapLoader in langchain-ai/langchain — langchain-ai/langchain 7.5AIHighAI2024-06-06
CVE-2024-4568 Stack overflow in Xpdf 4.05 due to object loop in PDF resources — Xpdf 2.9 Low2024-05-06
CVE-2024-4340 Passing a heavily nested list to sqlparse.parse() leads to a Denial of Service due to RecursionError. 7.5 High2024-04-30
CVE-2024-3248 Stack overflow in Xpdf 4.05 due to object loop in attachments — Xpdf 2.9 Low2024-04-02
CVE-2024-3247 Stack overflow in Xpdf 4.05 due to object loop in PDF object stream — Xpdf 2.9 Low2024-04-02
CVE-2024-20311 Cisco IOS 和 IOS XE Software 安全漏洞 — IOS 8.6 High2024-03-27
CVE-2024-28244 KaTeX's maxExpand bypassed by Unicode sub/superscripts — KaTeX 6.5 Medium2024-03-25
CVE-2024-28243 KaTeX's maxExpand bypassed by \edef — KaTeX 6.5 Medium2024-03-25
CVE-2024-25111 SQUID-2024:1 Denial of Service in HTTP Chunked Decoding — squid 8.6 High2024-03-06
CVE-2024-0210 Uncontrolled Recursion in Wireshark — Wireshark 7.8 High2024-01-03
CVE-2023-52079 Conversion of property names to strings can trigger infinite recursion — msgpackr 6.8 Medium2023-12-28
CVE-2023-50269 SQUID-2023:10 Denial of Service in HTTP Request parsing — squid 8.6 High2023-12-14
CVE-2023-50251 php-svg-lib possible DoS caused by infinite recursion when parsing SVG document — php-svg-lib 5.3 Medium2023-12-12
CVE-2022-47374 编号已被CVE保留 — SIMATIC PC-Station Plus 7.5 High2023-12-12
CVE-2023-49800 Denial of service by abusing `fetchOptions.retry` in nuxt-api-party — nuxt-api-party 7.5 High2023-12-08
CVE-2023-4512 Uncontrolled Recursion in Wireshark — Wireshark 5.3 Medium2023-08-24
CVE-2023-2664 Stack overflow in Xpdf 4.04 due to object loop in PDF embedded file tree — Xpdf 2.9 Low2023-05-11
CVE-2023-2663 Stack overflow in Xpdf 4.04 due to object loop in PDF page label tree — Xpdf 2.9 Low2023-05-11
CVE-2023-24472 OpenImageIO 安全漏洞 — OpenImageIO 7.5 High2023-03-30
CVE-2023-1436 Infinite recursion in Jettison leads to denial of service when creating a crafted JSONArray — jettison 5.9 Medium2023-03-16
CVE-2023-1370 Stack exhaustion in json-smart leads to denial of service when parsing malformed JSON — json-smart 7.5 High2023-03-13
CVE-2022-23516 Uncontrolled Recursion in Loofah — loofah 7.5 High2022-12-14

Vulnerabilities classified as CWE-674 (未经控制的递归) represent 147 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.