目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1336

100%

CWE-606 循环条件输入未经检查 类漏洞列表 33

CWE-606 循环条件输入未经检查 类弱点 33 条 CVE 漏洞汇总,含 AI 中文分析。

CWE-606 属于输入验证缺陷,指程序未对用于循环条件的输入进行充分检查。攻击者通常通过构造恶意输入,触发无限循环或过度迭代,从而导致系统资源耗尽,引发拒绝服务攻击。开发者应避免直接使用不可信数据控制循环,需在循环前验证输入范围,或设置最大迭代次数上限,以确保程序逻辑的安全性与稳定性。

MITRE CWE 官方描述
CWE:CWE-606 循环条件未检查输入 英文:产品未对用于循环条件的输入进行适当检查,可能由于过度循环导致拒绝服务(Denial of Service, DoS)或其他后果。
常见影响 (1)
Availability DoS: Resource Consumption (CPU)
缓解措施 (2)
Implementation Do not use user-controlled data for loop conditions.
Implementation Perform input validation.
代码示例 (2)
The following example demonstrates the weakness.
void iterate(int n){ int i; for (i = 0; i < n; i++){ foo(); } } void iterateFoo() { unsigned int num; scanf("%u",&num); iterate(num); }
Bad · C
In the following C/C++ example the method processMessageFromSocket() will get a message from a socket, placed into a buffer, and will parse the contents of the buffer into a structure that contains the message length and the message body. A for loop is used to copy the message body into a local character string which will be passed to another method for processing.
int processMessageFromSocket(int socket) { int success; char buffer[BUFFER_SIZE]; char message[MESSAGE_SIZE]; // get message from socket and store into buffer //Ignoring possibliity that buffer > BUFFER_SIZE if (getMessage(socket, buffer, BUFFER_SIZE) > 0) { // place contents of the buffer into message structure ExMessage *msg = recastBuffer(buffer); // copy message body into string for processing int index; for (index = 0; index < msg->msgLength; index++) { message[index] = msg->msgBody[index]; } message[index] = '\0'; // process message success = processMessage(message); } return success; }
Bad · C
CVE ID 标题 CVSS 风险等级 Published
CVE-2023-3817 OpenSSL 安全漏洞 — OpenSSL 7.5 - 2023-07-31
CVE-2023-3446 OpenSSL 安全漏洞 — OpenSSL 7.5 - 2023-07-19
CVE-2022-3252 Apple SwiftNIO Extras 安全漏洞 — SwiftNIO Extras 7.5 - 2022-09-21

CWE-606(循环条件输入未经检查) 是常见的弱点类别,本平台收录该类弱点关联的 33 条 CVE 漏洞。