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

目标: 1000 元 · 已筹: 1000

100.0%

CWE-768 不正确的快捷方式验证 类漏洞列表 1

CWE-768 不正确的快捷方式验证 类弱点 1 条 CVE 漏洞汇总,含 AI 中文分析。

CWE-768 属于逻辑错误类漏洞,源于对短路求值机制的误用。当条件语句中非前置表达式包含副作用时,短路逻辑可能跳过该部分执行,导致程序状态异常或资源未正确释放。攻击者可利用此缺陷引发拒绝服务或状态不一致。开发者应避免在条件判断中依赖具有副作用的表达式,确保所有逻辑分支均被完整执行,以维持程序状态的确定性。

MITRE CWE 官方描述
CWE:CWE-768 错误的短路求值(Incorrect Short Circuit Evaluation) 英文:该产品包含一个具有多个逻辑表达式的条件语句,其中某个非前置表达式可能会产生副作用。这可能导致在条件语句执行后程序出现意外状态,因为短路求值逻辑可能会阻止这些副作用的发生。 尽管短路求值在 C 标准中已有明确定义,但其使用可能会以引入难以检测的逻辑错误的方式改变控制流,从而可能在产品执行期间的后续阶段导致错误。如果攻击者能够发现此类不一致之处,则可能利用它来获得对系统的任意控制权。如果“或”语句的第一个条件在正常情况下被假定为真,或者“与”语句的第一个条件被假定为假,那么任何后续的条件语句都可能包含在代码审查或测试期间未被检测到的自身逻辑错误。最后,短路求值的使用可能会降低代码的可维护性。
常见影响 (1)
Confidentiality, Integrity, AvailabilityVaries by Context
Widely varied consequences are possible if an attacker is aware of an unexpected state in the product after a conditional. It may lead to information exposure, a system crash, or even complete attacker control of the system.
缓解措施 (1)
ImplementationMinimizing the number of statements in a conditional that produce side effects will help to prevent the likelihood of short circuit evaluation to alter control flow in an unexpected way.
代码示例 (1)
The following function attempts to take a size value from a user and allocate an array of that size (we ignore bounds checking for simplicity). The function tries to initialize each spot with the value of its index, that is, A[len-1] = len - 1; A[len-2] = len - 2; ... A[1] = 1; A[0] = 0; However, since the programmer uses the prefix decrement operator, when the conditional is evaluated with i == 1…
#define PRIV_ADMIN 0 #define PRIV_REGULAR 1 typedef struct{ int privileges; int id; } user_t; user_t *Add_Regular_Users(int num_users){ user_t* users = (user_t*)calloc(num_users, sizeof(user_t)); int i = num_users; while( --i && (users[i].privileges = PRIV_REGULAR) ){ users[i].id = i; } return users; } int main(){ user_t* test; int i; test = Add_Regular_Users(25); for(i = 0; i < 25; i++) printf("user %d has privilege level %d\n", test[i].id, test[i].privileges); }
Bad · C
CVE ID标题CVSS风险等级Published
CVE-2026-35378 uutils coreutils 安全漏洞 — coreutils 3.3 Low2026-04-22

CWE-768(不正确的快捷方式验证) 是常见的弱点类别,本平台收录该类弱点关联的 1 条 CVE 漏洞。