regreSSHion (CVE-2024-6387): a remote code execution flaw in the OpenSSH server

An old bug returned to OpenSSH and allowed unauthenticated code execution as root on Linux servers. Why SSH should never be wide open.

Publicly disclosed: 1 July 2024

On 1 July 2024 Qualys published details of a vulnerability in the OpenSSH server (sshd) on glibc-based Linux systems. A race condition in the signal handler — a bug fixed back in 2006 that returned in a later code change, hence the name “regreSSHion” — could allow an unauthenticated attacker to run code as root. Exploitation is difficult and takes many attempts, but it is possible.

CVESeverityAffectedFixed in
CVE-2024-6387High, CVSS 8.1 (race condition, remote code execution)OpenSSH 8.5p1 – 9.7p1 (and versions before 4.4p1) on glibc LinuxOpenSSH 9.8p1 and distribution updates

How to protect

  1. Install the security update from your Linux distribution — the version number may stay older with the fix backported.
  2. Do not expose SSH to the whole internet: allow it only from VPN or known IP addresses.
  3. If you cannot update immediately, the OpenSSH team suggested setting LoginGraceTime 0 in sshd_config; this blocks the code execution path but makes it easier to exhaust connection slots.
  4. Use rate limiting and tools such as fail2ban to slow down repeated connection attempts.
  5. Use key-based authentication and disable password login for administrators.

SSH is the key to your servers. Keep the keyhole as small as possible.

Sources: Qualys research, OpenSSH 9.8 release notes, NVD CVE-2024-6387.

Need help with this? Contact CySec for a free consultation.


All articles

Need help with this?

Our engineers can review your current setup and propose concrete improvements.