高危 Sudo 堆缓冲区溢出致本地提权漏洞
CVE编号
CVE-2021-3156利用情况
EXP 已公开补丁情况
官方补丁披露时间
2021-01-27漏洞描述
Sudo是一个功能强大的实用程序,大多数基于Unix和Linux的操作系统都包含Sudo。它允许用户使用其他用户的安全特权运行程序。2021年1月27日,阿里云应急响应中心监控到国外安全研究人员披露了Sudo 堆缓冲区溢出致本地提权漏洞,漏洞编号为 CVE-2021-3156。任何本地用户(包括普通用户和系统用户,sudoer和非sudoers)若成功利用该漏洞,可在无需密码的情况下获得root权限。解决建议
1. 下载升级sudo软件包,下载链接为: https://www.sudo.ws/dist/2. 使用 systemtap 执行以下命令进行临时缓解:首先,安装所需的 systemtap 软件包和依赖项:systemtap yum-utils kernel-devel-"$(uname -r)"然后,对于RHEL 7,使用命令安装 kernel debuginfo:debuginfo-install -y kernel-"$(uname -r)"。对于RHEL 8,使用命令安装 sudo debuginfo:debuginfo-install sudo。接着,创建以下 systemtap 脚本,并将文件命名为 sudoedit-block.stap:probe process("/usr/bin/sudo").function("main") {command = cmdline_args(0,0,"");if (strpos(command, "edit") >= 0) {raise(9);}}最终,使用root权限以下命令安装脚本:# nohup stap -g sudoedit-block.stap &该脚本将使得易受攻击的sudoedit二进制文件停止工作。 sudo命令仍将照常工作。上述更改在重启后失效,必须在每次重启后重新应用。一旦安装了补丁程序,就可以通过取消systemtap进程来删除systemtap脚本。 例如,通过使用:# kill -s SIGTERM 7590 (其中7590是systemtap进程的PID)受影响软件情况
# | 类型 | 厂商 | 产品 | 版本 | 影响面 | ||||
1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
运行在以下环境 | |||||||||
应用 | sudo | sudo | * | From (including) 1.8.2 | Up to (including) 1.8.31p2 | ||||
运行在以下环境 | |||||||||
应用 | sudo | sudo | * | From (including) 1.9.0 | Up to (including) 1.9.5p1 | ||||
运行在以下环境 | |||||||||
系统 | alibaba_cloud_linux_2.1903 | sudo | * | Up to (excluding) 1.8.23-10.1.al7.1 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.10 | sudo | * | Up to (excluding) 1.9.5p2-r0 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.11 | sudo | * | Up to (excluding) 1.8.31-r1 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.12 | sudo | * | Up to (excluding) 1.9.5p2-r0 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.13 | sudo | * | Up to (excluding) 1.9.5p2-r0 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.14 | sudo | * | Up to (excluding) 1.9.5p2-r0 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.15 | sudo | * | Up to (excluding) 1.9.5p2-r0 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.16 | sudo | * | Up to (excluding) 1.9.5p2-r0 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.17 | sudo | * | Up to (excluding) 1.9.5p2-r0 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.18 | sudo | * | Up to (excluding) 1.9.5p2-r0 | |||||
运行在以下环境 | |||||||||
系统 | alpine_edge | sudo | * | Up to (excluding) 1.9.5_p2-r0 | |||||
运行在以下环境 | |||||||||
系统 | amazon_2 | sudo | * | Up to (excluding) 1.8.23-4.amzn2.2.1 | |||||
运行在以下环境 | |||||||||
系统 | amazon_2022 | libarchive | * | Up to (excluding) 3.5.3-2.amzn2022.0.1 | |||||
运行在以下环境 | |||||||||
系统 | amazon_2023 | libarchive | * | Up to (excluding) 3.5.3-2.amzn2023.0.2 | |||||
运行在以下环境 | |||||||||
系统 | amazon_AMI | sudo | * | Up to (excluding) 1.8.23-9.56.amzn1 | |||||
运行在以下环境 | |||||||||
系统 | anolis_os_8 | sudo | * | Up to (excluding) 1.8.29-5 | |||||
运行在以下环境 | |||||||||
系统 | anolis_os_8.2 | sudo | * | Up to (excluding) 1.8.29-5 | |||||
运行在以下环境 | |||||||||
系统 | centos_7 | sudo | * | Up to (excluding) 1.8.23-10.el7_9.1 | |||||
运行在以下环境 | |||||||||
系统 | centos_8 | sudo-debuginfo | * | Up to (excluding) 3.3.3-3.el8_5 | |||||
运行在以下环境 | |||||||||
系统 | debian_10 | sudo | * | Up to (excluding) 1.8.27-1+deb10u3 | |||||
运行在以下环境 | |||||||||
系统 | debian_11 | sudo | * | Up to (excluding) 1.9.5p1-1.1 | |||||
运行在以下环境 | |||||||||
系统 | debian_12 | sudo | * | Up to (excluding) 1.9.5p1-1.1 | |||||
运行在以下环境 | |||||||||
系统 | debian_9 | sudo | * | Up to (excluding) 1.8.19p1-2.1+deb9u3 | |||||
运行在以下环境 | |||||||||
系统 | debian_sid | sudo | * | Up to (excluding) 1.9.5p1-1.1 | |||||
运行在以下环境 | |||||||||
系统 | fedora_32 | sudo-devel | * | Up to (excluding) 1.9.5p2-1.fc32 | |||||
运行在以下环境 | |||||||||
系统 | fedora_33 | sudo-devel | * | Up to (excluding) 1.9.5p2-1.fc33 | |||||
运行在以下环境 | |||||||||
系统 | kylinos_aarch64_V10 | sudo | * | Up to (excluding) 1.8.23-10.el7_9.1 | |||||
运行在以下环境 | |||||||||
系统 | kylinos_aarch64_V10SP1 | sudo | * | Up to (excluding) 1.9.2-2.ky10 | |||||
运行在以下环境 | |||||||||
系统 | kylinos_x86_64_V10 | sudo | * | Up to (excluding) 1.8.23-10.el7_9.1 | |||||
运行在以下环境 | |||||||||
系统 | kylinos_x86_64_V10SP1 | sudo | * | Up to (excluding) 1.9.2-2.ky10 | |||||
运行在以下环境 | |||||||||
系统 | opensuse_Leap_15.1 | sudo | * | Up to (excluding) 1.8.22-lp151.5.12.1 | |||||
运行在以下环境 | |||||||||
系统 | opensuse_Leap_15.2 | sudo | * | Up to (excluding) 1.8.22-lp152.8.9.1 | |||||
运行在以下环境 | |||||||||
系统 | oracle_6 | oraclelinux-release | * | Up to (excluding) 1.8.6p3-29.0.3.el6_10.3 | |||||
运行在以下环境 | |||||||||
系统 | oracle_7 | oraclelinux-release | * | Up to (excluding) 1.8.23-10.el7_9.1 | |||||
运行在以下环境 | |||||||||
系统 | oracle_8 | oraclelinux-release | * | Up to (excluding) 1.8.29-6.el8_3.1 | |||||
运行在以下环境 | |||||||||
系统 | redhat_6 | sudo | * | Up to (excluding) 0:1.8.6p3-29.el6_10.4 | |||||
运行在以下环境 | |||||||||
系统 | redhat_7 | sudo | * | Up to (excluding) 1.8.23-10.el7_9.1 | |||||
运行在以下环境 | |||||||||
系统 | redhat_8 | sudo-debuginfo | * | Up to (excluding) 3.3.3-3.el8_5 | |||||
运行在以下环境 | |||||||||
系统 | suse_12_SP5 | sudo | * | Up to (excluding) 1.8.27-4.6.1 | |||||
运行在以下环境 | |||||||||
系统 | ubuntu_16.04 | sudo | * | Up to (excluding) 1.8.16-0ubuntu1.10 | |||||
运行在以下环境 | |||||||||
系统 | ubuntu_16.04.7_lts | sudo | * | Up to (excluding) 1.8.16-0ubuntu1.10 | |||||
运行在以下环境 | |||||||||
系统 | ubuntu_18.04 | sudo | * | Up to (excluding) 1.8.21p2-3ubuntu1.4 | |||||
运行在以下环境 | |||||||||
系统 | ubuntu_18.04.5_lts | sudo | * | Up to (excluding) 1.8.21p2-3ubuntu1.4 | |||||
运行在以下环境 | |||||||||
系统 | ubuntu_20.04 | sudo | * | Up to (excluding) 1.8.31-1ubuntu1.2 | |||||
- 攻击路径 本地
- 攻击复杂度 容易
- 权限要求 无需权限
- 影响范围 全局影响
- EXP成熟度 EXP 已公开
- 补丁情况 官方补丁
- 数据保密性 无影响
- 数据完整性 无影响
- 服务器危害 服务器失陷
- 全网数量 100000+
CWE-ID | 漏洞类型 |
CWE-122 | 堆缓冲区溢出 |
CWE-193 | Off-by-one错误 |
CWE-787 | 跨界内存写 |
Exp相关链接
- https://github.com/0xDevil/CVE-2021-3156
- https://github.com/1N53C/CVE-2021-3156-PoC
- https://github.com/apogiatzis/docker-CVE-2021-3156
- https://github.com/Ashish-dawani/CVE-2021-3156-Patch
- https://github.com/baka9moe/CVE-2021-3156-Exp
- https://github.com/binw2018/CVE-2021-3156-SCRIPT
- https://github.com/blasty/CVE-2021-3156
- https://github.com/cdeletre/Serpentiel-CVE-2021-3156
- https://github.com/Chal13W1zz/Sudo-Spunk
- https://github.com/CptGibbon/CVE-2021-3156
- https://github.com/D3v17-000/CVE-2021-3156
- https://github.com/dinhbaouit/CVE-2021-3156
- https://github.com/dock0d1/CVE-2021-3156
- https://github.com/elbee-cyber/CVE-2021-3156-PATCHER
- https://github.com/gmldbd94/cve-2021-3156
- https://github.com/H4ckForJob/cve-2021-3156
- https://github.com/Hello12112020/CVE-2021-3156
- https://github.com/jm33-m0/CVE-2021-3156
- https://github.com/jokerTPR2004/CVE-2021-3156
- https://github.com/kal1gh0st/CVE-2021-3156
- https://github.com/kernelzeroday/CVE-2021-3156-Baron-Samedit
- https://github.com/leterts/CVE-2021-3156-sudo-raising
- https://github.com/lmol/CVE-2021-3156
- https://github.com/ltfafei/CVE-2021-3156
- https://github.com/mbcrump/CVE-2021-3156
- https://github.com/mr-r3b00t/CVE-2021-3156
- https://github.com/nexcess/sudo_cve-2021-3156
- https://github.com/nobodyatall648/CVE-2021-3156
- https://github.com/oneoy/CVE-2021-3156
- https://github.com/perlun/sudo-1.8.3p1-patched
- https://github.com/ph4ntonn/CVE-2021-3156
- https://github.com/Q4n/CVE-2021-3156
- https://github.com/r3k4t/how-to-solve-sudo-heap-based-bufferoverflow-vulnerability
- https://github.com/reverse-ex/CVE-2021-3156
- https://github.com/Rvn0xsy/CVE-2021-3156-plus
- https://github.com/SantiagoSerrao/ScannerCVE-2021-3156
- https://github.com/Serpentiel/CVE-2021-3156
- https://github.com/stong/CVE-2021-3156
- https://github.com/teamtopkarl/CVE-2021-3156
- https://github.com/TheSerialiZator/CTF-2021
- https://github.com/voidlsd/CVE-2021-3156
- https://github.com/worawit/CVE-2021-3156
- https://github.com/Y3rbit4/CVE-2021-3156
- https://github.com/yaunsky/cve-2021-3156
- https://github.com/ymrsmns/CVE-2021-3156
- https://www.exploit-db.com/exploits/49521
- https://www.exploit-db.com/exploits/49522

版权声明
本站原创文章转载请注明文章出处及链接,谢谢合作!
评论