CWE-834 过度迭代 类弱点 31 条 CVE 漏洞汇总,含 AI 中文分析。
CWE-834 属于资源消耗型漏洞,指程序执行迭代或循环时未充分限制执行次数。攻击者通常通过构造特定输入诱导循环过度执行,从而耗尽 CPU 或内存资源,导致服务拒绝或系统崩溃。开发者应避免此类问题,需在代码中设置合理的迭代上限,对输入数据进行严格校验,并实施超时机制,确保循环在可控范围内终止,防止资源被恶意滥用。
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; } ... }
| CVE ID | 标题 | CVSS | 风险等级 | Published |
|---|---|---|---|---|
| CVE-2019-3552 | Facebook Thrift 输入验证错误漏洞 — Facebook Thrift | 7.5 | - | 2019-05-06 |
CWE-834(过度迭代) 是常见的弱点类别,本平台收录该类弱点关联的 31 条 CVE 漏洞。