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

Goal: 1000 CNY · Raised: 1359 CNY

100%

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

338 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)
Availability DoS: 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 ID Title CVSS Severity Published
CVE-2025-30187 Denial of service via crafted DoH exchange in PowerDNS DNSdist — DNSdist 3.7 Low 2025-09-18
CVE-2025-20253 Cisco IOS, IOS XE, Secure Firewall Adaptive Security Appliance, and Secure Firewall Threat Defense Software IKEv2 Denial of Service Vulnerability — Cisco Adaptive Security Appliance (ASA) Software 8.6 High 2025-08-14
CVE-2025-20243 Cisco Secure Firewall Adaptive Security Appliance and Secure Firewall Threat Defense Software Remote Access SSL VPN Denial of Service Vulnerability — Cisco Adaptive Security Appliance (ASA) Software 8.6 High 2025-08-14
CVE-2025-20217 Cisco Firepower Threat Defense Intrusion Detection Denial of Service Vulnerability — Cisco Firepower Threat Defense Software 8.6 High 2025-08-14
CVE-2025-20136 Cisco Adaptive Security Appliance and Firepower Threat Defense Software Network Address Translation DNS Inspection Denial of Service Vulnerability — Cisco Adaptive Security Appliance (ASA) Software 8.6 High 2025-08-14
CVE-2025-7054 Infinite loop triggered by connection ID retirement — quiche 6.5AI Medium AI 2025-08-07
CVE-2023-2593 Kernel: ksmbd memory exhaustion denial-of-service vulnerability 5.9 Medium 2025-07-30
CVE-2025-8194 Tarfile infinite loop during parsing with negative member offset — CPython 7.5 High 2025-07-28
CVE-2024-58261 sequoia-openpgp 安全漏洞 — sequoia 2.9 Low 2025-07-27
CVE-2025-53015 ImageMagick has XMP profile write that triggers hang due to unbounded loop — ImageMagick 7.5 High 2025-07-14
CVE-2025-53628 cpp-httplib does not limit the length of a line — cpp-httplib 7.5AI High AI 2025-07-10
CVE-2025-42954 Denial of service (DOS) in SAP NetWeaver Business Warehouse (CCAW application) — SAP NetWeaver Business Warehouse (CCAW application) 2.7 Low 2025-07-08
CVE-2025-2962 Infinite loop in dns_copy_qname — Zephyr 8.2 High 2025-06-24
CVE-2025-0673 Loop with Unreachable Exit Condition ('Infinite Loop') in GitLab — GitLab 7.5 High 2025-06-12
CVE-2025-30145 GeoServer has an Infinite Loop Vulnerability in Jiffle process — geoserver 7.5 High 2025-06-10
CVE-2025-3857 Infinite loop condition in Amazon.IonDotnet — Amazon Ion Dotnet 7.5 High 2025-04-21
CVE-2025-32947 PeerTube ActivityPub Crawl Infinite Loop DoS 7.5 High 2025-04-15
CVE-2025-29918 Suricata pcre: negated pcr can cause infinite loop — suricata 6.2 Medium 2025-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.5AI High AI 2025-04-07
CVE-2025-2838 Silicon Labs Gecko OS DNS Response Processing Infinite Loop Denial-of-Service Vulnerability — Gecko OS 6.5AI Medium AI 2025-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 Medium 2025-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 Medium 2025-01-28

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