CVE-2025-32433: Pre-Auth RCE in Erlang/OTP SSH Server

Recently, a critical vulnerability tracked as CVE-2025-32433 was disclosed in the SSH server implementation of Erlang/Open Telecom Platform (OTP). It allows remote attackers to execute arbitrary code without completing the SSH authentication process. The vulnerability is due to improper handling of SSH protocol messages during the pre-authentication phase. If the Erlang/OTP SSH daemon runs with elevated privileges such as root, successful exploitation could allow an attacker to gain full control over the system. Given its severity, the vulnerability has been assigned the maximum CVSS v3 score of 10.0.

Erlang is a programming language designed for building scalable real-time systems that require high availability. OTP is set of Erlang libraries, tools and design principles that provide middle-ware for developing highly concurrent, distributed, and fault-tolerant applications. The Erlang/OTP SSH is an implementation of the SSH protocol within Erlang OTP. It enables secure shell access and secure file transfers within Erlang-based systems. Erlang/OTP is a foundational technology in high-availability systems used across telecommunications, messaging platforms, IoT infrastructure, and financial services. It is used by organizations like Ericsson, Cisco, and WhatsApp. Its widespread adoption significantly elevates the real-world risk posed by this vulnerability. The affected versions include OTP 27.3.2 and earlier, OTP 26.2.5.10 and earlier, OTP 25.3.2.19 and earlier, and versions from OTP 17.0 and older.

Technical Details

The vulnerability lies in how Erlang/OTP’s built-in SSH server processes connection protocol messages during the pre-authentication phase.

According to RFC 4254, the SSH Connection Protocol operates on top of the SSH transport and user authentication layers. It provides features such as interactive logins, remote command execution, and port forwarding.

The two relevant message types involved in this exploit are:

Figure 1: SSH_MSG_CHANNEL_OPEN Message Format

Figure 2: SSH_MSG_CHANNEL_REQUEST Message Format

According to the SSH protocol specification, these messages should only be accepted after successful authentication. In compliant implementations, any attempt to send them prematurely should result in immediate termination of the connection.

In vulnerable versions of Erlang/OTP, the SSH daemon fails to enforce this rule. The server incorrectly accepts and processes this connection protocol messages before authentication, allowing attackers to open a session channel and send an exec request containing arbitrary commands — all without supplying valid credentials.

This makes the vulnerability highly dangerous, as the exploit occurs entirely pre-authentication, during the SSH handshake. A remote attacker can execute arbitrary shell commands without knowing a username, password, or key — effectively performing a pre-auth channel injection attack.

A working proof-of-concept exploit for this vulnerability has been publicly released. Interestingly, the exploit was developed with the assistance of AI, which analyzed Git diffs to identify the flaw and generate the exploit code.

Exploitation Steps

We reproduced the attack using the publicly disclosed PoC.

1. Deploy the vulnerable server.

We used a docker-based setup referenced from the PoC repository.

First, we clone the repository and navigate into the project directory:

git clone https://github.com/ProDefense/CVE-2025-32433.git && cd CVE-2025-32433

Then we can build the Docker image using:

docker build -t erlang-ssh .

Once the image is built, we can bring up the vulnerable server by running:

docker run -d --name erlang-ssh -p 2222:2222 erlang-ssh

The vulnerable OTP version used here is OTP-26.2.5.10, which by default listens on port 2222. Erlang expects the SSH private key to be in PEM format and the public key in OpenSSH (RFC 4253) format.

Other deployment methods can be found here.

2. Exploitation

Depending on our setup, we may need to configure the target host and port in the PoC script (CVE-2025-32433.py) at lines 5 and 6.

Then we can specify the payload we want to execute at line 108. For instance, the PoC uses a benign command to create a file:

Figure 3: File write Erlang payload

We can then execute the PoC script by running:

python3 CVE-2025-32433.py

Figure 4: Executing the PoC to Trigger Remote Code Execution

To verify if the payload executed successfully, we can check the file content inside the container:

docker exec <container_id> cat /file.txt

If the file contains the expected output which is “Testing!” in our case, it confirms successful code execution.

In addition to writing files, we can also inject and execute system shell commands using:

os:cmd("<OS Command>").

Example:

Figure 5: OS command Injection Erlang payload

We can verify using:

docker exec <container_id> ls /tmp

If the /tmp directory contains the file poc, it confirms successful code execution.

Note: The final . is essential in Erlang expressions and must be included for the payload to run properly.

Figure 6: Post-Exploitation Verification

Attack Flow

1. Banner exchange

The client and server begin by exchanging version strings (e.g., SSH-2.0-OpenSSH_8.2). This is standard in any SSH session to determine protocol compatibility.

2. Send SSH_MSG_KEXINIT

The attacker sends an SSH_MSG_KEXINIT packet to initiate the key exchange negotiation. This message includes supported algorithms for key exchange, encryption, and compression.

3. Send SSH_MSG_CHANNEL_OPEN

After the initial key exchange, the attacker sends SSH_MSG_CHANNEL_OPEN with the channel type set to "session" to request a new channel. In a standard SSH session, a user can request a new channel only after successful authentication. However, in CVE-2025-32433, the Erlang/OTP SSH daemon fails to enforce this rule. The attacker sends this request before authentication, and the server incorrectly processes it, allowing a session channel to be opened without verifying the user's identity.

4. Send SSH_MSG_CHANNEL_REQUEST

The final step is sending SSH_MSG_CHANNEL_REQUEST, which normally runs commands inside an authenticated session. But due to improper pre-auth validation, the server accepts and processes the SSH_MSG_CHANNEL_REQUEST with an "exec" payload even though no authentication has occurred. This enables remote, unauthenticated attackers to execute arbitrary shell commands on the server.

Figure 7: Sample Malicious Request Sent by Attacker

CVE-2025-32433 poses a significant threat due to its ease of exploitation and potential impact. An attacker could leverage the publicly available PoC on GitHub to compromise vulnerable systems. Since Erlang is widely used in networking infrastructure, distributed systems, telecommunications, and IoT/OT environments, the risk surface is substantial. Once exploited, this vulnerability allows remote shell access without authentication. If the SSH daemon runs with elevated privileges, attackers can execute arbitrary commands, install persistent backdoors, move laterally across the network, or exfiltrate sensitive data. Given the widespread use of Erlang/OTP in critical environments, the real-world consequences could be severe. Organizations using Erlang/OTP SSH servers must act swiftly to patch affected systems and implement additional security measures to prevent unauthorized access.

Disclaimer: This information is provided for educational purposes only. Unauthorized exploitation of vulnerabilities is illegal and unethical.

CVE-2025-32433 Strike in BreakingPoint

At Keysight Technologies, our Application and Threat Intelligence (ATI) team has analyzed the attack traffic pattern of Erlang/OTP SSH Remote Code Execution Vulnerability (CVE-2025-32433) and added a new 1-arm verified Strike in ATI-2025-08 StrikePack.

Figure 8: Erlang/OTP SSH Authentication Vulnerability Strike in BPS

Leverage Subscription Service to Stay Ahead of Attacks

Keysight's Application and Threat Intelligence subscription provides daily malware and bi-weekly updates of the latest application protocols and vulnerabilities for use with Keysight test platforms. The ATI Research Centre continuously monitors threats as they appear in the wild. Customers of BreakingPoint now have access to attack campaigns for different advanced persistent threats, allowing BreakingPoint Customers to test their currently deployed security control's ability to detect or block such attacks.

References

https://nvd.nist.gov/vuln/detail/CVE-2025-32433

https://github.com/erlang/otp

https://github.com/erlang/otp/security/advisories/GHSA-37cp-fgq5-7wc2

https://www.rfc-editor.org/rfc/rfc4254.html

https://platformsecurity.com/blog/CVE-2025-32433-poc

https://github.com/ProDefense/CVE-2025-32433

limit
3