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

目标: 1000 元 · 已筹: 1000

100.0%

CWE-187 部分比较 类漏洞列表 6

CWE-187 部分比较 类弱点 6 条 CVE 漏洞汇总,含 AI 中文分析。

CWE-187 属于字符串比较漏洞,指程序仅比对部分字符串即判定匹配。攻击者常利用此缺陷,通过构造短小但包含正确子串的凭证(如密码片段)绕过身份验证或逻辑校验,从而获取非法访问权限。开发者应避免截断比较,确保对完整字符串进行精确比对,并采用恒定时间比较算法,以消除侧信道攻击风险,保障系统安全。

MITRE CWE 官方描述
CWE:CWE-187 部分字符串比较 (Partial String Comparison) 英文:产品在确定是否存在匹配之前,仅对某个因素的一部分(例如子字符串 (substring))进行检查,从而导致比较不完整,引发相关弱点。 例如,攻击者可能通过提供一个与正确长密码的对应部分相匹配的短密码,从而成功通过身份验证 (authentication)。
常见影响 (1)
Integrity, Access ControlAlter Execution Logic, Bypass Protection Mechanism
缓解措施 (1)
TestingThoroughly test the comparison scheme before deploying code into production. Perform positive testing as well as negative testing.
代码示例 (1)
This example defines a fixed username and password. The AuthenticateUser() function is intended to accept a username and a password from an untrusted user, and check to ensure that it matches the username and password. If the username and password match, AuthenticateUser() is intended to indicate that authentication succeeded.
/* Ignore CWE-259 (hard-coded password) and CWE-309 (use of password system for authentication) for this example. */ char *username = "admin"; char *pass = "password"; int AuthenticateUser(char *inUser, char *inPass) { if (strncmp(username, inUser, strlen(inUser))) { logEvent("Auth failure of username using strlen of inUser"); return(AUTH_FAIL); } if (! strncmp(pass, inPass, strlen(inPass))) { logEvent("Auth success of password using strlen of inUser"); return(AUTH_SUCCESS); } else { logEvent("Auth fail of password using sizeof"); return(AUTH_FAIL); } } int main (int argc, char **argv) { int a
Bad · C
p pa pas pass
Attack
CVE ID标题CVSS风险等级Published
CVE-2026-34785 Rack 信息泄露漏洞 — rack 7.5 High2026-04-02
CVE-2026-30874 OpenWrt 安全漏洞 — openwrt 8.8 -2026-03-19
CVE-2025-23384 Siemens RUGGEDCOM和Siemens SCALANCE 缓冲区错误漏洞 — RUGGEDCOM RM1224 LTE(4G) EU 3.7 Low2025-03-11
CVE-2024-41110 Docker Engine 安全漏洞 — moby 10.0 Critical2024-07-24
CVE-2024-39742 IBM MQ Operator 安全漏洞 — MQ Operator 8.1 High2024-07-08
CVE-2022-31802 CODESYS Gateway Server 安全漏洞 — CODESYS Gateway Server V2 9.8 Critical2022-06-24

CWE-187(部分比较) 是常见的弱点类别,本平台收录该类弱点关联的 6 条 CVE 漏洞。