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-2024-29904 CodeIgniter4 Language class DoS Vulnerability — CodeIgniter4 7.5 High 2024-03-29
CVE-2024-21408 Windows Hyper-V Denial of Service Vulnerability — Windows 10 Version 1809 5.5 Medium 2024-03-12
CVE-2024-1931 Denial of service when trimming EDE text on positive replies — Unbound 7.5 High 2024-03-07
CVE-2024-25710 Apache Commons Compress: Denial of service caused by an infinite loop for a corrupted DUMP file — Apache Commons Compress 8.1 High 2024-02-19
CVE-2024-25144 Liferay Portal和Liferay DXP 安全漏洞 — Portal 4.1 Medium 2024-02-08
CVE-2023-45233 Infinite loop in EDK II Network Package — edk2 7.5 High 2024-01-16
CVE-2023-45232 Infinite loop in EDK II Network Package — edk2 7.5 High 2024-01-16
CVE-2023-0437 MongoDB client C Driver may infinitely loop when validating certain BSON input data — MongoDB C Driver 5.3 Medium 2024-01-12
CVE-2024-0211 Loop with Unreachable Exit Condition ('Infinite Loop') in Wireshark — Wireshark 7.8 High 2024-01-03
CVE-2023-43511 Loop with Unreachable Exit Condition (Infinite Loop) in WLAN Firmware — Snapdragon 7.5 High 2024-01-02
CVE-2023-6245 Infinite decoding loop through specially crafted payload — Candid 7.5 High 2023-12-08
CVE-2023-40458 AceManager DOS Vulnerability — ALEOS 7.5 High 2023-11-29
CVE-2023-42814 Denial of service from malicious image manifest in kyverno — kyverno 3.1 Low 2023-11-13
CVE-2023-42815 Denial of service from malicious image manifest in kyverno — kyverno 3.1 Low 2023-11-13
CVE-2023-5825 Loop with Unreachable Exit Condition ('Infinite Loop') in GitLab — GitLab 6.5 Medium 2023-11-06
CVE-2023-20083 Cisco Firepower Threat Defense 安全漏洞 — Cisco Firepower Threat Defense Software 8.6 High 2023-11-01
CVE-2023-1718 Bitrix24 Denial-of-Service (DoS) via Improper File Stream Access — Bitrix24 7.5 High 2023-11-01
CVE-2023-46250 pypdf possible Infinite Loop when PdfWriter(clone_from) is used with a PDF — pypdf 5.1 Medium 2023-10-31
CVE-2023-22325 SoftEther VPN 安全漏洞 — SoftEther VPN 5.9 Medium 2023-10-12
CVE-2023-43645 Denial of service from circular relationship definitions in OpenFGA — openfga 5.9 Medium 2023-09-26
CVE-2023-1108 Undertow: infinite loop in sslconduit during close 7.5 High 2023-09-14
CVE-2023-3255 Qemu: vnc: infinite loop in inflate_buffer() leads to denial of service — Red Hat Enterprise Linux 8 6.5 Medium 2023-09-13
CVE-2023-4511 Loop with Unreachable Exit Condition ('Infinite Loop') in Wireshark — Wireshark 5.3 Medium 2023-08-24
CVE-2023-20200 Cisco 多款产品安全漏洞 — Cisco Unified Computing System (Managed) 7.7 High 2023-08-23
CVE-2023-20197 ClamAV 安全漏洞 — Cisco Secure Endpoint 7.5 High 2023-08-16
CVE-2023-3748 Inifinite loop in babld message parsing may cause dos — frr 3.5 Low 2023-07-24
CVE-2023-34966 Samba: infinite loop in mdssvc rpc service for spotlight — Red Hat Enterprise Linux 8 7.5 High 2023-07-20
CVE-2023-36807 Infinite Loop when reading malformed objects in pypdf — pypdf 6.2 Medium 2023-06-30
CVE-2023-20116 Cisco Unified Communications Manager 安全漏洞 — Cisco Unified Communications Manager 6.8 Medium 2023-06-28
CVE-2023-36464 Infinite Loop when a comment isn't followed by a character in pypdf — pypdf 6.2 Medium 2023-06-27

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