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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-835 (不可达退出条件的循环(无限循环)) — Vulnerability Class 212

212 vulnerabilities classified as CWE-835 (不可达退出条件的循环(无限循环)). AI Chinese analysis included.

CWE-835 represents a logic error where a software loop lacks a reachable termination condition, resulting in an infinite execution cycle. This weakness typically manifests when developers fail to update loop variables correctly or rely on floating-point comparisons prone to precision errors. Attackers exploit this vulnerability to trigger Denial of Service (DoS) attacks by consuming excessive CPU resources, effectively freezing the application or system. To mitigate this risk, developers must ensure loop counters are properly incremented or decremented within the iteration body. Implementing strict boundary checks, avoiding direct equality comparisons with floating-point numbers, and utilizing static analysis tools can help detect unreachable exit conditions early. Additionally, incorporating timeout mechanisms or maximum iteration limits provides a safety net, ensuring that even if logic errors occur, the process terminates gracefully without exhausting system resources.

MITRE CWE Description
The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.
Common Consequences (1)
AvailabilityDoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory), DoS: Amplification
An infinite loop will cause unexpected consumption of resources, such as CPU cycles or memory. The software's operation may slow down, or cause a long time to respond.
Examples (2)
In the following code the method processMessagesFromServer attempts to establish a connection to a server and read and process messages from the server. The method uses a do/while loop to continue trying to establish the connection to the server when an attempt fails.
int processMessagesFromServer(char *hostaddr, int port) { ... int servsock; int connected; struct sockaddr_in servaddr; // create socket to connect to server servsock = socket( AF_INET, SOCK_STREAM, 0); memset( &servaddr, 0, sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_port = htons(port); servaddr.sin_addr.s_addr = inet_addr(hostaddr); do { // establish connection to server connected = connect(servsock, (struct sockaddr *)&servaddr, sizeof(servaddr)); // if connected then read and process messages from server if (connected > -1) { // read and process messages ... } // keep tr
Bad · C
int processMessagesFromServer(char *hostaddr, int port) { ... // initialize number of attempts counter int count = 0; do { // establish connection to server connected = connect(servsock, (struct sockaddr *)&servaddr, sizeof(servaddr)); // increment counter count++; // if connected then read and process messages from server if (connected > -1) { // read and process messages ... } // keep trying to establish connection to the server // up to a maximum number of attempts } while (connected < 0 && count < MAX_ATTEMPTS); // close socket and return success or failure ... }
Good · C
For this example, the method isReorderNeeded is part of a bookstore application that determines if a particular book needs to be reordered based on the current inventory count and the rate at which the book is being sold.
public boolean isReorderNeeded(String bookISBN, int rateSold) { boolean isReorder = false; int minimumCount = 10; int days = 0; // get inventory count for book int inventoryCount = inventory.getIventoryCount(bookISBN); // find number of days until inventory count reaches minimum while (inventoryCount > minimumCount) { inventoryCount = inventoryCount - rateSold; days++; } // if number of days within reorder timeframe // set reorder return boolean to true if (days > 0 && days < 5) { isReorder = true; } return isReorder; }
Bad · Java
public boolean isReorderNeeded(String bookISBN, int rateSold) { ... // validate rateSold variable if (rateSold < 1) { return isReorder; } ... }
Good · Java
CVE IDTitleCVSSSeverityPublished
CVE-2025-8194 Tarfile infinite loop during parsing with negative member offset — CPython 7.5 High2025-07-28
CVE-2024-58261 sequoia-openpgp 安全漏洞 — sequoia 2.9 Low2025-07-27
CVE-2025-53015 ImageMagick has XMP profile write that triggers hang due to unbounded loop — ImageMagick 7.5 High2025-07-14
CVE-2025-53628 cpp-httplib does not limit the length of a line — cpp-httplib 7.5AIHighAI2025-07-10
CVE-2025-42954 Denial of service (DOS) in SAP NetWeaver Business Warehouse (CCAW application) — SAP NetWeaver Business Warehouse (CCAW application) 2.7 Low2025-07-08
CVE-2025-2962 Infinite loop in dns_copy_qname — Zephyr 8.2 High2025-06-24
CVE-2025-0673 Loop with Unreachable Exit Condition ('Infinite Loop') in GitLab — GitLab 7.5 High2025-06-12
CVE-2025-30145 GeoServer has an Infinite Loop Vulnerability in Jiffle process — geoserver 7.5 High2025-06-10
CVE-2025-3857 Infinite loop condition in Amazon.IonDotnet — Amazon Ion Dotnet 7.5 High2025-04-21
CVE-2025-32947 PeerTube ActivityPub Crawl Infinite Loop DoS 7.5 High2025-04-15
CVE-2025-29918 Suricata pcre: negated pcr can cause infinite loop — suricata 6.2 Medium2025-04-10
CVE-2025-32029 ts-asn1-der has Incorrect DER Encoding of Numbers Leading to Denial of Service and Incorrect Value Representation — ts-asn1-der 7.5AIHighAI2025-04-07
CVE-2025-2838 Silicon Labs Gecko OS DNS Response Processing Infinite Loop Denial-of-Service Vulnerability — Gecko OS 6.5AIMediumAI2025-03-26
CVE-2024-10907 Denial of Service (DoS) via Multipart Boundary in lm-sys/fastchat — lm-sys/fastchat 7.5 -2025-03-20
CVE-2024-10829 Denial of Service (DoS) via Multipart Boundary in eosphoros-ai/db-gpt — eosphoros-ai/db-gpt 7.5 -2025-03-20
CVE-2024-10821 Denial of Service (DoS) in invoke-ai/invokeai — invoke-ai/invokeai 7.5 -2025-03-20
CVE-2024-12704 Denial of Service (DoS) in run-llama/llama_index — run-llama/llama_index 7.5 -2025-03-20
CVE-2024-9340 Denial of Service (DoS) via Multipart Boundary in zenml-io/zenml — zenml-io/zenml 7.5 -2025-03-20
CVE-2025-29776 Azle calling `setTimer` causes infinite loop of timers — azle 7.5 -2025-03-14
CVE-2025-27497 OpenDJ Denial of Service (Dos) using alias loop — OpenDJ 7.5 -2025-03-05
CVE-2025-1695 NGINX Unit Java Vulnerability — NGINX Unit 5.3 Medium2025-03-04
CVE-2024-6790 Mali GPU Kernel Driver can cause the whole system to become unresponsive — Bifrost GPU Kernel Driver 6.5 -2025-02-03
CVE-2025-0290 Loop with Unreachable Exit Condition ('Infinite Loop') in GitLab — GitLab 4.3 Medium2025-01-28
CVE-2025-23221 Fedify has an Infinite loop and Blind SSRF found inside the Webfinger mechanism — fedify 5.4 Medium2025-01-20
CVE-2024-11941 Drupal core - Moderately critical - Denial of Service - SA-CORE-2024-001 — Drupal Core 7.5 -2024-12-05
CVE-2024-53980 Spoofed length byte traps CC2538 in endless loop — RIOT 6.5 -2024-11-29
CVE-2024-11612 7-Zip CopyCoder Infinite Loop Denial-of-Service Vulnerability — 7-Zip 7.5 -2024-11-22
CVE-2024-11595 Loop with Unreachable Exit Condition ('Infinite Loop') in Wireshark — Wireshark 7.8 High2024-11-21
CVE-2024-50321 Ivanti Avalanche 安全漏洞 — Avalanche 7.5 High2024-11-12
CVE-2024-50320 Ivanti Avalanche 安全漏洞 — Avalanche 7.5 High2024-11-12

Vulnerabilities classified as CWE-835 (不可达退出条件的循环(无限循环)) represent 212 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.