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-2023-0437 MongoDB client C Driver may infinitely loop when validating certain BSON input data — MongoDB C Driver 5.3 Medium2024-01-12
CVE-2024-0211 Loop with Unreachable Exit Condition ('Infinite Loop') in Wireshark — Wireshark 7.8 High2024-01-03
CVE-2023-43511 Loop with Unreachable Exit Condition (Infinite Loop) in WLAN Firmware — Snapdragon 7.5 High2024-01-02
CVE-2023-6245 Infinite decoding loop through specially crafted payload — Candid 7.5 High2023-12-08
CVE-2023-40458 AceManager DOS Vulnerability — ALEOS 7.5 High2023-11-29
CVE-2023-42814 Denial of service from malicious image manifest in kyverno — kyverno 3.1 Low2023-11-13
CVE-2023-42815 Denial of service from malicious image manifest in kyverno — kyverno 3.1 Low2023-11-13
CVE-2023-5825 Loop with Unreachable Exit Condition ('Infinite Loop') in GitLab — GitLab 6.5 Medium2023-11-06
CVE-2023-20083 Cisco Firepower Threat Defense 安全漏洞 — Cisco Firepower Threat Defense Software 8.6 High2023-11-01
CVE-2023-1718 Bitrix24 Denial-of-Service (DoS) via Improper File Stream Access — Bitrix24 7.5 High2023-11-01
CVE-2023-46250 pypdf possible Infinite Loop when PdfWriter(clone_from) is used with a PDF — pypdf 5.1 Medium2023-10-31
CVE-2023-22325 SoftEther VPN 安全漏洞 — SoftEther VPN 5.9 Medium2023-10-12
CVE-2023-43645 Denial of service from circular relationship definitions in OpenFGA — openfga 5.9 Medium2023-09-26
CVE-2023-1108 Undertow: infinite loop in sslconduit during close 7.5 High2023-09-14
CVE-2023-3255 Qemu: vnc: infinite loop in inflate_buffer() leads to denial of service — Red Hat Enterprise Linux 8 6.5 Medium2023-09-13
CVE-2023-4511 Loop with Unreachable Exit Condition ('Infinite Loop') in Wireshark — Wireshark 5.3 Medium2023-08-24
CVE-2023-20200 Cisco 多款产品安全漏洞 — Cisco Unified Computing System (Managed) 7.7 High2023-08-23
CVE-2023-20197 ClamAV 安全漏洞 — Cisco Secure Endpoint 7.5 High2023-08-16
CVE-2023-4010 Kernel: usb: hcd: malformed usb descriptor leads to infinite loop in usb_giveback_urb() — Red Hat Enterprise Linux 6 4.6 Medium2023-07-31
CVE-2023-3748 Inifinite loop in babld message parsing may cause dos — frr 3.5 Low2023-07-24
CVE-2023-34966 Samba: infinite loop in mdssvc rpc service for spotlight — Red Hat Enterprise Linux 8 7.5 High2023-07-20
CVE-2023-36807 Infinite Loop when reading malformed objects in pypdf — pypdf 6.2 Medium2023-06-30
CVE-2023-20116 Cisco Unified Communications Manager 安全漏洞 — Cisco Unified Communications Manager 6.8 Medium2023-06-28
CVE-2023-36464 Infinite Loop when a comment isn't followed by a character in pypdf — pypdf 6.2 Medium2023-06-27
CVE-2023-35933 OpenFGA denial of service die to circular relationship — openfga 5.9 Medium2023-06-26
CVE-2023-33305 Fortinet FortiOS 安全漏洞 — FortiWeb 4.9 Medium2023-06-13
CVE-2015-10103 InternalError503 Forget It settings.js infinite loop — Forget It 2.8 Low2023-04-17
CVE-2022-37013 Unified Automation OPC UA C++ Demo Server 安全漏洞 — OPC UA C++ Demo Server 7.5 -2023-03-29
CVE-2023-25824 mod_gnutls contains Infinite Loop on request read timeout — mod_gnutls 7.5 High2023-02-23
CVE-2023-25653 Improper calculations in ECC implementation can trigger a Denial-of-Service (DoS) — node-jose 7.5 High2023-02-16

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