22 vulnerabilities classified as CWE-834 (过度迭代). AI Chinese analysis included.
CWE-834, Excessive Iteration, is a software weakness where a program executes a loop without adequately restricting the number of iterations. This flaw typically arises when input values directly control loop counters, allowing attackers to manipulate the iteration count. By supplying excessively large or maliciously crafted inputs, adversaries can force the application into prolonged execution, leading to severe resource exhaustion. This exploitation consumes critical CPU cycles and memory, potentially causing denial-of-service conditions that degrade system performance or crash the host entirely. To mitigate this risk, developers must implement strict input validation and enforce upper bounds on loop counters. Additionally, incorporating timeout mechanisms and monitoring resource usage during execution ensures that runaway loops are terminated before they can impact system stability, thereby preserving availability and integrity.
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);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);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; }public boolean isReorderNeeded(String bookISBN, int rateSold) { ... // validate rateSold variable if (rateSold < 1) { return isReorder; } ... }Vulnerabilities classified as CWE-834 (过度迭代) represent 22 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.