OpenSSH Remote Code Execution Vulnerability (CVE-2024-6387) Notification

OpenSSH Remote Code Execution Vulnerability (CVE-2024-6387) Notification

julho 2, 2024 | NSFOCUS

Overview

Recently, NSFOCUS CERT detected that OpenSSH issued a security announcement and fixed the remote code execution vulnerability of OpenSSH (CVE-2024-6387). Due to a signal handler race condition issue in OpenSSH Server (sshd) under the default configuration, if the client does not authenticate within seconds of LoginGraceTime (120 seconds by default and 600 seconds in older versions of OpenSSH), the SIGALRM handler for sshd will be called asynchronously. The signal handler calls various non-async-signal-safe functions, such as syslog(), which can be exploited by an unauthenticated attacker to execute arbitrary code as root on glibc-based Linux systems. At present, the vulnerability details and PoC have been disclosed. The affected users are advised to take measures for protection as soon as possible.

Reference link:

https://www.openssh.com/txt/release-9.8

Scope of Impact

Affected Version

8.5p1 <= OpenSSH < 9.8p1

Note: This vulnerability was reintroduced to CVE-2006-5051 in October 2020.

Unaffected Version

  • OpenSSH >= 9.8/9.8p1

Note: 4.4p1 <= OpenSSH < 8.5p1 is not vulnerable to this vulnerability, and the OpenBSD system is not affected by this vulnerability.

Detection

The old and new versions may coexist when updating the OpenSSH version. To ensure the accuracy of version detection, you can run the following command to check whether the current OpenSSH version is affected:

ssh -V

Mitigation

Official upgrade

At present, a new version and security patch have been officially released to fix this vulnerability. Please install the update as soon as possible for protection.

Download link:

https://www.openssh.com/releasenotes.html

Patch link:

https://github.com/openssh/openssh-portable/commit/81c1099d22b81ebfd20a334ce986c4f753b0db29

Redhat:

https://access.redhat.com/security/cve/CVE-2024-6387

Ubuntu:

https://lists.ubuntu.com/archives/ubuntu-security-announce/2024-July/008406.html

Temporary measures

If sshd cannot be updated or recompiled, LoginGraceTime can be set to 0 in the configuration file, which exhausts all MaxStartups connections and makes sshd vulnerable to a denial of service attack, but mitigates this RCE vulnerability.

Statement

This advisory is only used to describe a potential risk. NSFOCUS does not provide any commitment or promise on this advisory. NSFOCUS and the author will not bear any liability for any direct and/or indirect consequences and losses caused by transmitting and/or using this advisory. NSFOCUS reserves all the rights to modify and interpret this advisory. Please include this statement paragraph when reproducing or transferring this advisory. Do not modify this advisory, add/delete any information to/from it, or use this advisory for commercial purposes without permission from NSFOCUS.

About NSFOCUS

NSFOCUS, a pioneering leader in cybersecurity, is dedicated to safeguarding telecommunications, Internet service providers, hosting providers, and enterprises from sophisticated cyberattacks.

Founded in 2000, NSFOCUS operates globally with over 4000 employees at two headquarters in Beijing, China, and Santa Clara, CA, USA, and over 50 offices worldwide. It has a proven track record of protecting over 25% of the Fortune Global 500 companies, including four of the five largest banks and six of the world’s top ten telecommunications companies.

Leveraging technical prowess and innovation, NSFOCUS delivers a comprehensive suite of security solutions, including the Intelligent Security Operations Platform (ISOP) for modern SOC, DDoS Protection, Continuous Threat Exposure Management (CTEM) Service and Web Application and API Protection (WAAP). All the solutions and services are augmented by the Security Large Language Model (SecLLM), ML, patented algorithms and other cutting-edge research achievements developed by NSFOCUS.