CWE-362 使用共享资源的并发执行不恰当同步问题(竞争条件) 类弱点 606 条 CVE 漏洞汇总,含 AI 中文分析。
CWE-362 属于并发执行漏洞,指代码序列在需要独占访问共享资源时,因缺乏同步机制导致存在时间窗口,使其他并发序列能修改该资源。攻击者通常利用此竞态条件,通过精心构造并发请求篡改数据或绕过安全检查,从而引发逻辑错误或权限提升。开发者应避免此类问题,确保对共享资源的访问具备原子性,通过加锁、事务或原子操作等同步机制消除竞争窗口,保障数据一致性。
$transfer_amount = GetTransferAmount(); $balance = GetBalanceFromDatabase(); if ($transfer_amount < 0) { FatalError("Bad Transfer Amount"); } $newbalance = $balance - $transfer_amount; if (($balance - $transfer_amount) < 0) { FatalError("Insufficient Funds"); } SendNewBalanceToDatabase($newbalance); NotifyUser("Transfer of $transfer_amount succeeded."); NotifyUser("New balance: $newbalance");
In the following pseudocode, the attacker makes two simultaneous calls of the program, CALLER-1 and CALLER-2. Both callers are for the same user account. CALLER-1 (the attacker) is associated with PROGRAM-1 (the instance that handles CALLER-1). CALLER-2 is associated with PROGRAM-2. CALLER-1 makes a transfer request of 80.00. PROGRAM-1 calls GetBalanceFromDatabase and sets $balance to 100.00 PROGRAM-1 calculates $newbalance as 20.00, then calls SendNewBalanceToDatabase(). Due to high server load, the PROGRAM-1 call to SendNewBalanceToDatabase() encounters a delay. CALLER-2 makes a transfer req
void f(pthread_mutex_t *mutex) { pthread_mutex_lock(mutex); /* access shared resource */ pthread_mutex_unlock(mutex); }
int f(pthread_mutex_t *mutex) { int result; result = pthread_mutex_lock(mutex); if (0 != result) return result; /* access shared resource */ return pthread_mutex_unlock(mutex); }
| CVE ID | 标题 | CVSS | 风险等级 | Published |
|---|---|---|---|---|
| CVE-2017-7543 | openstack-neutron 竞争条件漏洞 — openstack-neutron | 5.9 | - | 2018-07-26 |
| CVE-2018-10850 | Red Hat 389-ds-base 竞争条件漏洞 — 389-ds-base | 5.9 | - | 2018-06-13 |
| CVE-2018-3759 | private_address_check ruby gem 竞争条件漏洞 — private_address_check ruby gem | 5.9 | - | 2018-06-13 |
| CVE-2017-2619 | Samba 后置链接漏洞 — samba | 7.1 | - | 2018-03-12 |
| CVE-2018-1049 | systemd 竞争条件问题漏洞 — systemd | 5.1 | - | 2018-02-16 |
| CVE-2017-15129 | Linux kernel 竞争条件问题漏洞 — Linux kernel v4.0-rc1 through v4.15-rc5 | 7.1 | - | 2018-01-09 |
CWE-362(使用共享资源的并发执行不恰当同步问题(竞争条件)) 是常见的弱点类别,本平台收录该类弱点关联的 606 条 CVE 漏洞。