Kaspersky official blog 2024年07月06日
CVE-2024-6387 aka regreSSHion – root cause, risks, mitigation
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

OpenSSH 中发现了一个名为 regreSSHion 的漏洞(CVE-2024-6387),允许攻击者在目标系统上执行任意代码并获取 root 权限。虽然大规模利用该漏洞的可能性较低,但所有使用 OpenSSH 的服务器管理员都应立即采取措施进行修复。

👨‍💻 **漏洞利用条件**: 该漏洞利用需要攻击者进行约 10,000 次身份验证尝试,并且目标系统必须基于使用 GNU C 库 (glibc) 的 Linux 版本,例如所有 Debian 变体。此外,攻击者还需要准备针对特定 glibc 和 Linux 版本定制的内存结构。研究人员已经在 32 位 Linux 系统上重现了攻击,但理论上也可以在 64 位系统上利用,尽管成功率较低。地址空间布局随机化 (ASLR) 会减缓利用过程,但不能完全提供保护。

🛡️ **漏洞修复**: OpenSSH 4.4p1 之前的版本以及 8.5p1 到 9.7p1 之间的版本在使用 glibc-Linux 的情况下容易受到攻击。基于 OpenBSD 的服务器不受影响。所有其他用户应将 sshd 更新到 9.8 版本。如果无法立即更新,管理员可以将登录超时设置为零 (在 sshd_config 中设置 LoginGraceTime=0) 作为临时缓解措施。但是,开发人员警告说,这会使 SSH 服务器更容易受到 DDoS 攻击。

🔒 **安全措施**: 除了更新 OpenSSH 版本外,管理员还可以通过使用防火墙和其他网络安全工具实施更严格的 SSH 访问控制来提高安全性。这可以通过限制 SSH 连接的来源 IP 地址、使用 SSH 密钥身份验证来提高安全性。

💡 **漏洞分析**: 该漏洞是由 OpenSSH 团队在 2006 年修复的 CVE-2006-5051 的回归问题。由于代码中引入的一些更改,导致已知的缺陷再次出现。因此,该漏洞被称为 regreSSHion。

⚠️ **漏洞影响**: OpenSSH 几乎无处不在,它被集成到大多数 Linux 发行版、OpenBSD 和 FreeBSD、macOS 以及基于 Junos OS 等专用设备中。由于许多电视、智能门铃、婴儿监视器、网络媒体播放器,甚至机器人吸尘器都基于 Linux 系统,因此 OpenSSH 也经常在其中使用。从 Windows 10 开始,OpenSSH 也在 Microsoft 的操作系统中可用,尽管它是一个可选组件,默认情况下未安装。可以毫不夸张地说,sshd 在数千万台设备上运行。

A vulnerability has been discovered in OpenSSH, a popular set of tools for remote management of *nix systems. The bug allows an unauthenticated attacker to execute arbitrary code on the affected system and gain root privileges. The vulnerability was named regreSSHion, and assigned the ID CVE-2024-6387. Given that sshd, the OpenSSH server, is integrated into most operating systems and many IoT devices as well as firewalls, the description of the vulnerability sounds like the beginning of a new epidemic on the scale of WannaCry and Log4Shell. In practice, the situation is somewhat more complex. Widespread exploitation of the vulnerability is unlikely. Nevertheless, all server administrators using OpenSSH must urgently address the vulnerability.

Where OpenSSH is Used

The OpenSSH utility set is almost ubiquitous. It is a popular implementation of the SSH (secure shell) protocol, and is integrated into most Linux distributions, OpenBSD and FreeBSD, macOS, as well as specialized devices like those based on Junos OS. Since many TVs, smart doorbells, baby monitors, network media players, and even robotic vacuum cleaners are based on Linux systems, OpenSSH is often used in them as well. Starting with Windows 10, OpenSSH is also available in Microsoft’s OSs, although it’s an optional component not installed by default. It’s no exaggeration to say that sshd runs on tens of millions of devices.

How to trigger the regreSSHion vulnerability

During an SSH authentication attempt, the user has a time limit to complete the process, with the default setting being 120 seconds. If authentication does not occur, the sshd server asynchronously calls the special “sigalarm” function, which in turn invokes system-level memory management functions. This was done in a manner unsafe for asynchronous execution. Under certain conditions, and with a small probability, this can trigger a race condition, leading to memory boundary violations and arbitrary code execution.

To exploit this vulnerability, an attacker needs to make approximately 10,000 attempts on average, and the target system must be based on Linux versions using the GNU C Library (glibc), such as all Debian variants. Additionally, attackers need to prepare memory structures tailored to the specific version of glibc and Linux. Researchers have reproduced the attack on 32-bit Linux systems but, theoretically, it’s possible to exploit on 64-bit systems as well — albeit with a lower success rate. Address Space Layout Randomization (ASLR) slows down the exploitation process but does not provide complete protection.

Interestingly, this bug was already fixed by the OpenSSH team in 2006, when it was assigned CVE-2006-5051. Therefore, the new bug is a regression — the reappearance of an already known defect due to some changes introduced in the code. This is where the name for the new vulnerability, regreSSHion, comes from.

The likelihood of CVE-2024-6387 being exploited in the wild

The vulnerability was discovered by researchers and responsibly disclosed to the development team. Therefore, immediate exploitation is unlikely. Moreover, the technical complexities described above make mass exploitation impractical. Ten thousand authentication attempts with standard OpenSSH settings would take six to eight hours per server. Additionally, one needs to know which version of Linux the server is running. If the server has any protection against brute force attacks and DDoS, these measures would likely block the attack.

Despite all this, targeted exploitation is quite possible. Patient attackers can conduct reconnaissance and then make low-frequency attempts from different IPs, and sooner or later they might succeed.

How to protect your servers against exploitation

Versions of OpenSSH up to 4.4p1, plus versions from 8.5p1 to 9.7p1 running on glibc-Linux, are vulnerable. OpenBSD-based servers are not affected, so admins of those can breathe easier; however, everyone else should update sshd to version 9.8.

If for some reason immediate updating is not possible, administrators can set the login timeout to zero (LoginGraceTime=0 in sshd_config) as a temporary mitigation. However, developers warn that this makes the SSH server more susceptible to DDoS attacks.

Another possible mitigation is stricter access control for SSH — implemented using firewalls and other network security tools.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

OpenSSH 漏洞 regreSSHion CVE-2024-6387 安全
相关文章