Published on July 2, 2024Documentation Index
Fetch the complete documentation index at: https://help.onetsolutions.net/llms.txt
Use this file to discover all available pages before exploring further.
The story behind the bug
CVE-2006-5051 was fixed in 2006. In 2020, an OpenSSH logging-code refactor reintroduced the same condition. Nobody spotted it for four years. Qualys dug it back up in June 2024 — hence the name “RegreSSHion”, a contraction of regression and SSH.
The mechanics
sshd enforces a maximum delay (LoginGraceTime, 120 seconds by default) for a client to complete authentication. When that delay expires, the kernel sends SIGALRM to the process, which fires a handler called sigdie. That handler calls logging functions (syslog(), etc.) which are not async-signal-safe — they can take locks, allocate memory, touch global structures.
If the attacker times the timer expiry precisely while sshd is itself manipulating those structures (typically during a concurrent logging operation), they trigger heap corruption. With enough attempts and a finely-tuned payload, that corruption turns into code execution in the privileged sshd process.
Why the attack is slow without being theoretical
- It takes tens of thousands of attempts to win the race.
- Each attempt must wait for
LoginGraceTimeto expire. - The payload must match the exact OpenSSH version and target libc.
Are you affected?
Versions affected (Linux glibc):- OpenSSH 4.4p1 → 8.5p1: not affected (the regression was introduced later).
- OpenSSH 8.5p1 → 9.7p1: vulnerable.
- OpenSSH 9.8p1 and later: fixed.
Patches
Track your distribution’s advisory:| Distribution | Patched version |
|---|---|
| Ubuntu Jammy (22.04) | 1:8.9p1-3ubuntu0.10 |
| Ubuntu Mantic (23.10) | 1:9.3p1-1ubuntu3.6 |
| Ubuntu Noble (24.04) | 1:9.6p1-3ubuntu13.3 |
| Debian Bullseye (11) | 1:8.4p1-5+deb11u3 |
| Debian Bookworm (12) | 1:9.2p1-2+deb12u3 |
| Debian Sid | 1:9.7p1-7 |
Temporary mitigation
If you cannot patch right away, you can remove the race window by settingLoginGraceTime 0 in /etc/ssh/sshd_config:
This mitigation exposes you to a trivial denial of service: an attacker can open TCP connections that never authenticate and exhaust
sshd’s pre-auth slots. Use it only as a last resort, until the patch lands.- Restrict SSH access at the firewall to known IPs or ranges.
- Use
Match+AllowUsersto narrow the reachable account surface. - Add
fail2banon the auth log to slow attempt bursts.

