RegreSSHion explained

RegreSSHion (security bug)
Discoverer:Qualys Threat Research Unit (TRU)
Affected Software:OpenSSH (8.5p1–9.7p1)

RegreSSHion is a family of security bugs in the OpenSSH software that allows for an attacker to remotely execute code and gain potential root access on a machine running the OpenSSH Server.[1] [2] The vulnerability was discovered by the Qualys Threat Research Unit and was disclosed on July 1, 2024. It affected all prior versions of OpenSSH from 8.5p1 (March 3, 2021) to 9.7p1 (March 11, 2024) and was patched in release 9.8/9.8p1 on July 1, 2024.[3] Qualys reported identifying over 14 million public facing OpenSSH instances potentially vulnerable to the attack.[4] It affects glibc-based Linux systems; Windows and OpenBSD systems are not vulnerable to the attack.

Disclosure

The vulnerability was publicly disclosed by Qualys on July 1, 2024. Qualys reported disclosing the vulnerability to the OpenSSH developers on May 19, approximately two months prior, and reported notifying OpenWall on June 20, 2024.[5]

Vulnerability

The regreSSHion vulnerability in OpenSSH results from a signal handler race condition in its server component (sshd). This issue is triggered when a client fails to authenticate within the LoginGraceTime period (default 120 seconds). When this timeout occurs, sshd's SIGALRM handler is called asynchronously, invoking functions that are not safe to use in signal handlers, such as syslog. In versions < 4.4p1, an attacker could exploit the free function during syslog within the signal handler. However, in versions from 8.5p1 to 9.7p1, both the free and malloc functions are targeted.

This vulnerability is a regression of CVE-2006-5051, reintroduced in OpenSSH 8.5p1 (October 2020) due to the accidental removal of a crucial directive that had mitigated the earlier vulnerability. The directive transformed unsafe calls into a safe _exit(1) call.

Affected versions

Note: The following versions are referring to the upstream versions. Checking the versions shipped by e.g. linux Distros is not enough to validate it being vulnerable or not as many have backported fixes to older versions. E.g. Debian's OpensSSH version 9.7p1-7[6] and Rocky Linux's OpenSSH version 8.7p1-38.4[7] are also NOT Vulnerable.

Legend: Vulnerable Not Vulnerable

Terminology

According to Qualys, the bug was named "regreSSHion" as a reference to a regression bug affecting OpenSSH.

Notes and References

  1. Web site: RegreSSHion: Remote Unauthenticated Code Execution Vulnerability in OpenSSH server . July 2024 .
  2. Web site: "RegreSSHion" vulnerability in OpenSSH gives attackers root on Linux . 2 July 2024 .
  3. Web site: OpenSSH Release Notes . OpenSSH . 16 July 2024.
  4. Web site: regreSSHion: Remote Unauthenticated Code Execution Vulnerability in OpenSSH server . Qualys Community . Qualys . 16 July 2024.
  5. Web site: Qualys Technical Details . Qualys . 16 July 2024.
  6. Web site: Package: openssh Debian Sources . 2024-07-26 . sources.debian.org.
  7. Web site: 2024-07-10 . import openssh-8.7p1-38.el9_4.4 (ebf2263f) · Commits · staging / rpms / openssh · GitLab . 2024-07-26 . GitLab . en.