字号·· | 护眼
漏洞档案 · 高危

Sudo 堆缓冲区溢出(CVE-2021-3156)

CVE-2021-3156 别名:GHSA-W5VH-2923-GP5C、DEBIAN-CVE-2021-3156
CVSS 7.8 / 3.1 EPSS 100.0% CISA KEV 在野利用 公开 PoC · 83
综合风险83/ 100
CVSS7.8高危
EPSS100.0%30 天利用概率
机构收录时间2021-01-26更新 2026-12-01

研判简报

概述

Sudo 在 1.9.5p2 之前的版本存在 off-by-one 错误,可造成基于堆的缓冲区溢出,本地用户通过 sudoedit -s 配合以单个反斜杠结尾的命令行参数即可提权至 root。该漏洞别名 GHSA-W5VH-2923-GP5C,对应 CWE-193(差一错误)与 CWE-122(堆溢出),2021-01-26 发布。任何运行受影响 sudo 的多用户 Linux/Unix 主机都应关注,尤其是允许普通用户执行 sudoedit 的跳板机与共享服务器。公开 PoC 已可覆写 /etc/passwd 等目标文件,利用门槛低。

严重性

CVSS 3.1 评分 7.8(high),综合风险分 85.19/100;EPSS 30 天利用概率 100.0%(百分位 100.0%,核查日期 2026-11-24)。攻击面为本地已登录用户对 setuid sudoedit 的调用,CISA SSVC 技术影响判定为 total。

利用状态

CISA KEV 已收录(2022-04-06),SSVC 标注 exploitation=active、automatable=no、technical_impact=total;Exploit-DB 等公开渠道共 83 条 PoC,其中 49521(Python3,fork 竞态写目标文件)与 49522(C 版,覆写 /etc/passwd)可直接复用。勒索软件关联情况材料未给出;Nuclei 模板状态材料未给出。以上核查日期均为 2026-11-24。

受影响产品

官方记录标题表述为「Sudo before 1.9.5p2」,受影响版本字段为 n/a。参考材料(Exploit-DB 49521)给出更细区间:legacy 版本 1.8.2 至 1.8.31p2、stable 版本 1.9.0 至 1.9.5p1,并在 Ubuntu 20.04.1 LTS(sudo 1.8.31)与 Ubuntu 18.04/20.04 上测试成功;与官方「1.9.5p2 之前」表述一致,仅更具体。涉及组件为 sudo/sudoedit 二进制的参数解析逻辑;部署形态材料未给出。

修复版本

材料以「Sudo before 1.9.5p2」界定受影响范围,即 1.9.5p2 为修复版本。参考链接中包含发行版公告 Debian DSA-4839 与 Gentoo GLSA 202101-33,其具体修复包版本材料未给出。

缓解措施

材料未给出临时缓解措施(如禁用 sudoedit 或限制 sudoers 授权等均无记载)。KEV 要求动作为「Apply updates per vendor instructions.」,期限 2022-04-27,现已过期,说明应视为必须立即修补而非可长期缓解。

响应步骤

  1. 清点资产:在所有 Linux/Unix 主机执行 sudo --version,标记低于 1.9.5p2 的实例。
  2. 优先升级 sudo 至 1.9.5p2 或发行版公告(DSA-4839、GLSA 202101-33 等)提供的修复包。
  3. 排查利用痕迹:审计 sudoedit/sudo 调用日志,关注 sudoedit -s 后接以单反斜杠结尾参数的命令行,以及非预期目录、符号链接的创建。
  4. 校验完整性:对 /etc/passwd、/etc/shadow 等敏感文件做基线比对,确认未被 PoC 覆写。
  5. 收敛攻击面:复核 sudoers 授权,删除不必要的 sudoedit 权限,降低本地用户可触发的概率。
  6. 记录 KEV 期限(2022-04-27)已逾期事实,将未修补主机纳入紧急处置清单并跟踪闭环。

参考来源

  1. https://nvd.nist.gov/vuln/detail/CVE-2021-3156kev
  2. https://www.exploit-db.com/exploits/49521exploit,exploitdb
  3. https://www.exploit-db.com/exploits/49522exploit,exploitdb
  4. https://lists.debian.org/debian-lts-announce/2021/01/msg00022.htmlmailing-list,mailing-list,x_transferred,advisory,euvd
  5. http://seclists.org/fulldisclosure/2021/Jan/79mailing-list,mailing-list,x_transferred,advisory,euvd
  6. http://www.openwall.com/lists/oss-security/2021/01/26/3mailing-list,mailing-list,x_transferred,advisory,euvd
  7. https://security.gentoo.org/glsa/202101-33vendor-advisory,vendor-advisory,x_transferred,advisory,euvd
  8. https://www.debian.org/security/2021/dsa-4839vendor-advisory,vendor-advisory,x_transferred,advisory,euvd
  9. https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LHXK6ICO5AYLGFK2TAX5MZKUXTUKWOJY/vendor-advisory,vendor-advisory,x_transferred,advisory,euvd
  10. https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CALA5FTXIQBRRYUA2ZQNJXB6OQMAXEII/vendor-advisory,vendor-advisory,x_transferred,advisory,euvd
  11. http://www.openwall.com/lists/oss-security/2021/01/27/1mailing-list,mailing-list,x_transferred,advisory,euvd
  12. http://www.openwall.com/lists/oss-security/2021/01/27/2mailing-list,mailing-list,x_transferred,advisory,euvd
  13. https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-sudo-privesc-jan2021-qnYQfcMvendor-advisory,vendor-advisory,x_transferred,advisory,euvd
  14. https://www.kb.cert.org/vuls/id/794544third-party-advisory,third-party-advisory,x_transferred,advisory,euvd
  15. http://seclists.org/fulldisclosure/2021/Feb/42mailing-list,mailing-list,x_transferred,advisory,euvd
  16. http://www.openwall.com/lists/oss-security/2021/02/15/1mailing-list,mailing-list,x_transferred,advisory,euvd