Skip to content
Race condition Write-up Advanced

RCE vulnerability in OpenSSH: everything you need to know

A signal handler race condition in OpenSSH server (sshd) allows an unauthenticated attacker to potentially achieve remote code execution as root. The flaw is exploitable in the default configuration on 32-bit glibc-based Linux distributions within specific version ranges.

Amitai Cohen Follow

Published on wiz.io

An unauthenticated RCE-as-root vulnerability was identified in OpenSSH server (sshd) by researchers from Qualys, assigned CVE-2024-6387 and dubbed regreSSHion. The vulnerability is a signal handler race condition and is known to be exploitable in the default configuration of OpenSSH in specific version ranges running…

Amitai Cohen, on wiz.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The SIGALRM handler calls async-signal-unsafe functions like syslog(), which in glibc can call malloc() and free(), leading to heap corruption if interrupted by another heap operation.

Impact

Exploitation is unlikely to be widespread because it requires distribution-specific conditions and hours of attempts, but a patient attacker could target specific organisations over weeks; no in-the-wild exploitation has been identified as of July 1st, 2024.

What the attacker needed

OpenSSH version in vulnerable range; 32-bit glibc-based Linux distribution; Default configuration; Network access to SSH service

The fix

Affected organisations should upgrade to the latest version of OpenSSH and restrict SSH access, not exposing servers to the internet.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

OpenSSH is software that lets you log into other computers securely. A race condition is a bug where two things happen at the same time and interfere with each other. Here, if a login attempt times out, a function runs that can corrupt memory, and an attacker might exploit that to run their own code as the most powerful user (root).

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

More by Amitai Cohen

View all

6 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.