Skip to main content
Vulnerability Database/CVE-2025-48038

CVE-2025-48038: Erlang OTP SSH Resource Exhaustion DOS

CVE-2025-48038 is a denial of service vulnerability in Erlang OTP SSH module that enables resource exhaustion through unthrottled allocation. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-48038 Overview

CVE-2025-48038 is a resource exhaustion vulnerability in the Erlang/OTP ssh_sftpd module. The flaw stems from the SFTP daemon failing to enforce the 256-byte file handle size limit defined in draft-ietf-secsh-filexfer-02. An authenticated SFTP client can send oversized handle values in operations such as SSH_FXP_READ, SSH_FXP_WRITE, and SSH_FXP_CLOSE, forcing the server to allocate memory without bounds. The issue is tracked under CWE-400: Uncontrolled Resource Consumption and resides in lib/ssh/src/ssh_sftpd.erl.

Critical Impact

Authenticated remote attackers can exhaust server memory on Erlang/OTP SSH SFTP services, degrading availability of any application that embeds the OTP SSH server.

Affected Products

  • Erlang/OTP from OTP 17.0 before OTP 28.0.3
  • Erlang/OTP 27.3.4.3 and earlier in the 27.x branch
  • Erlang/OTP 26.2.5.15 and earlier in the 26.x branch (ssh app 3.0.1 through 5.3.2, 5.2.11.2, 5.1.4.11)

Discovery Timeline

  • 2025-09-11 - CVE-2025-48038 published to NVD
  • 2026-07-24 - Last updated in NVD database

Technical Details for CVE-2025-48038

Vulnerability Analysis

The Erlang/OTP SSH application implements an SFTP server in ssh_sftpd.erl. SFTP operations reference open files via a handle string returned by the server during SSH_FXP_OPEN. The SFTP protocol draft specifies these handles must not exceed 256 bytes. Prior to the fix, the server parsed the client-supplied handle length field (UINT32) and processed the request without validating that length against the documented maximum.

An authenticated SFTP user can send repeated requests containing handle length values up to 2^32-1 bytes. The server allocates buffers to parse and compare the oversized binary against its internal handle table, leading to excessive memory consumption and resource leaks across sessions.

Root Cause

The root cause is missing input validation on the handle size field in the handle_op/4 dispatcher. The function accepted the client-declared handle length verbatim before performing table lookups, violating the protocol constraint and the resource allocation requirements described in [CWE-400].

Attack Vector

Exploitation requires network access to the SFTP service and valid SSH credentials with SFTP subsystem access. No user interaction is required. The attacker opens an SSH session, requests the SFTP subsystem, and submits crafted SSH_FXP_READ, SSH_FXP_WRITE, SSH_FXP_FSTAT, SSH_FXP_FSETSTAT, SSH_FXP_READDIR, or SSH_FXP_CLOSE operations carrying oversized handle data.

erlang
%% Patch excerpt from lib/ssh/src/ssh_sftpd.erl
%% From draft-ietf-secsh-filexfer-02 "The file handle strings MUST NOT be longer than 256 bytes."
handle_op(Request, ReqId, <<?UINT32(HLen), _/binary>>, State = #state{xf = XF})
  when (Request == ?SSH_FXP_CLOSE orelse
        Request == ?SSH_FXP_FSETSTAT orelse
        Request == ?SSH_FXP_FSTAT orelse
        Request == ?SSH_FXP_READ orelse
        Request == ?SSH_FXP_READDIR orelse
        Request == ?SSH_FXP_WRITE),
       HLen > 256 ->
    ssh_xfer:xf_send_status(XF, ReqId, ?SSH_FX_INVALID_HANDLE, "Invalid handle"),
    State;

Source: GitHub Commit #4e3bf867

The fix rejects any handle larger than 256 bytes with SSH_FX_INVALID_HANDLE before further processing occurs.

Detection Methods for CVE-2025-48038

Indicators of Compromise

  • Sudden growth in Erlang VM heap or binary memory on hosts running the OTP SSH SFTP daemon
  • SFTP sessions issuing repeated SSH_FXP_READ, SSH_FXP_WRITE, or SSH_FXP_CLOSE requests with abnormally large handle length fields
  • beam.smp process memory saturation followed by OOM termination or node restarts

Detection Strategies

  • Inspect SFTP server logs for frequent SSH_FX_INVALID_HANDLE responses after patching, which indicate attempted exploitation attempts
  • Monitor packet captures of SSH channel data for SFTP packets where the handle length field in the payload exceeds 256 bytes
  • Correlate authentication events with sharp increases in SSH subsystem memory usage per session

Monitoring Recommendations

  • Enable Erlang sasl and ssh logging at an appropriate verbosity to capture subsystem request anomalies
  • Baseline normal SFTP request sizes and alert on outliers, particularly from recently authenticated accounts
  • Track per-process memory metrics for the ssh_sftpd gen_server using observer or recon exporters

How to Mitigate CVE-2025-48038

Immediate Actions Required

  • Upgrade Erlang/OTP to 28.0.3, 27.3.4.4, or 26.2.5.16 (or newer) on all hosts running the OTP SSH SFTP server
  • Audit SFTP user accounts and revoke credentials that are no longer required, since exploitation requires valid authentication
  • Restrict network reachability of SFTP services to known administrative networks until patches are applied

Patch Information

The fix was delivered in commits 4e3bf867 and f09e0201 via GitHub Pull Request #10156. Advisory details are published in GHSA-pvj7-9652-7h9r and the Erlang CNA advisory.

Workarounds

  • Disable the SFTP subsystem in the OTP SSH daemon configuration if the service is not required by the application
  • Place SFTP services behind a reverse proxy or bastion that enforces per-session resource limits and connection throttling
  • Apply operating-system memory ceilings (for example, systemdMemoryMax) to the Erlang runtime to contain exhaustion damage
bash
# Verify installed Erlang/OTP version
erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell

# Example: constrain the Erlang service via systemd override
# /etc/systemd/system/myapp.service.d/limits.conf
[Service]
MemoryMax=4G
TasksMax=2048

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.