CVE-2026-23942

SFTP root escape via component-agnostic prefix check in ssh_sftpd

Published Mar 13, 2026 CVSS 4.0 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Erlang OTP (ssh_sftpd module) allows Path Traversal.

This vulnerability is associated with program files lib/ssh/src/ssh_sftpd.erl and program routines ssh_sftpd:is_within_root/2.

The SFTP server uses string prefix matching via lists:prefix/2 rather than proper path component validation when checking if a path is within the configured root directory. This allows authenticated users to access sibling directories that share a common name prefix with the configured root directory. For example, if root is set to /home/user1, paths like /home/user10 or /home/user1_backup would incorrectly be considered within the root.

This issue affects OTP from OTP 17.0 before OTP 26.2.5.18, OTP 27.3.4.9, and OTP 28.4.1, corresponding to ssh from 3.0.1 before 5.1.4.14, 5.2.11.6, and 5.5.1. Whether OTP before OTP 17.0, corresponding to ssh before 3.0.1, is affected is unknown.

Analysis

AI-generated

Technical impact

Improper Limitation of a Pathname to a Restricted Directory (Path Traversal) vulnerability exists in the Erlang OTP ssh_sftpd module. The server determines whether a requested path is within the configured root using a simple string prefix comparison via lists:prefix/2, instead of validating path components. Because of this flaw, an authenticated user can provide a path that shares a common name prefix with the root directory, such as /home/user10 when the root is set to /home/user1, and the server will mistakenly treat the path as inside the root. This allows the attacker to read, modify, or delete files that are actually located outside the intended directory. The issue is present in OTP 17.0 through OTP 26.2.5.18, OTP 27.3.4.9, and OTP 28.4.1 (corresponding to ssh 3.0.1 through 5.1.4.14, 5.2.11.6, and 5.5.1). The impact on earlier OTP versions is unknown. The vulnerability affects the files lib/ssh/src/ssh_sftpd.erl and the routine ssh_sftpd:is_within_root/2 and is identified as CWE‑22.

Affected Systems

The vulnerability affects Erlang/OTP releases from OTP 17.0 through OTP 28.4.1, and specific builds 27.3.4.9 and 26.2.5.18. Corresponding ssh module versions that contain the flaw range from ssh 3.0.1 through 5.5.1, 5.2.11.6, and 5.1.4.14. Systems running these OTP or ssh releases with an exposed SFTP service for authenticated users are vulnerable.

Risk and Exploitability

Based on the description, it is inferred that the attacker must first authenticate to the SFTP service. The weakness permits traversal to sibling directories that share a name prefix, effectively escaping the configured root. The CVSS score is 5.3 (medium), the EPSS score is <1%, and the vulnerability is not listed in the CISA KEV catalog, indicating a low but tangible risk. While the exploitation does not require additional privileges beyond SFTP authentication, the potential for unauthorized file access makes this a significant concern for multi‑tenant or shared environments. The likely attack vector is a local SFTP connection from a trusted or compromised client that supplies malicious path names.

Remediation

Vendor Workaround

* Use OS-level chroot to run the Erlang VM/SFTP server process in an isolated filesystem environment. * Ensure that no sensitive or precious data is readable or writable by the OS user running the Erlang VM. * Ensure that the SFTP server port is not reachable from untrusted machines. * Use directory naming conventions that avoid common prefixes (e.g., /home/users/alice/ instead of /home/user1/).


OpenCVE Recommended Actions

  • Upgrade Erlang/OTP to a version beyond the vulnerable releases (e.g., OTP 28.4.2 or newer).
  • Run the Erlang VM/SFTP server inside an OS-level chroot to isolate the filesystem.
  • Operate the Erlang VM under a dedicated OS user that cannot read or write sensitive data.
  • Restrict the SFTP service port to trusted networks so untrusted inbound connections cannot reach it.
  • Adopt directory naming conventions that avoid common prefixes (e.g., use /home/users/alice/ instead of /home/user1/).

Generated by OpenCVE AI on November 15, 2026 at 13:02 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4590-1 erlang security update
History
Type Values Removed Values Added
Description Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Erlang OTP (ssh_sftpd module) allows Path Traversal. This vulnerability is associated with program files lib/ssh/src/ssh_sftpd.erl and program routines ssh_sftpd:is_within_root/2. The SFTP server uses string prefix matching via lists:prefix/2 rather than proper path component validation when checking if a path is within the configured root directory. This allows authenticated users to access sibling directories that share a common name prefix with the configured root directory. For example, if root is set to /home/user1, paths like /home/user10 or /home/user1_backup would incorrectly be considered within the root. This issue affects OTP from OTP 17.0 before OTP 28.4.1, OTP 27.3.4.9 and OTP 26.2.5.18, corresponding to ssh from 3.0.1 before 5.5.1, 5.2.11.6 and 5.1.4.14. Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Erlang OTP (ssh_sftpd module) allows Path Traversal. This vulnerability is associated with program files lib/ssh/src/ssh_sftpd.erl and program routines ssh_sftpd:is_within_root/2. The SFTP server uses string prefix matching via lists:prefix/2 rather than proper path component validation when checking if a path is within the configured root directory. This allows authenticated users to access sibling directories that share a common name prefix with the configured root directory. For example, if root is set to /home/user1, paths like /home/user10 or /home/user1_backup would incorrectly be considered within the root. This issue affects OTP from OTP 17.0 before OTP 26.2.5.18, OTP 27.3.4.9, and OTP 28.4.1, corresponding to ssh from 3.0.1 before 5.1.4.14, 5.2.11.6, and 5.5.1. Whether OTP before OTP 17.0, corresponding to ssh before 3.0.1, is affected is unknown.
Type Values Removed Values Added
Description Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Erlang OTP (ssh_sftpd module) allows Path Traversal. This vulnerability is associated with program files lib/ssh/src/ssh_sftpd.erl and program routines ssh_sftpd:is_within_root/2. The SFTP server uses string prefix matching via lists:prefix/2 rather than proper path component validation when checking if a path is within the configured root directory. This allows authenticated users to access sibling directories that share a common name prefix with the configured root directory. For example, if root is set to /home/user1, paths like /home/user10 or /home/user1_backup would incorrectly be considered within the root. This issue affects OTP from OTP 17.0 until OTP 28.4.1, OTP 27.3.4.9 and OTP 26.2.5.18, corresponding to ssh from 3.0.1 until 5.5.1, 5.2.11.6 and 5.1.4.14. Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Erlang OTP (ssh_sftpd module) allows Path Traversal. This vulnerability is associated with program files lib/ssh/src/ssh_sftpd.erl and program routines ssh_sftpd:is_within_root/2. The SFTP server uses string prefix matching via lists:prefix/2 rather than proper path component validation when checking if a path is within the configured root directory. This allows authenticated users to access sibling directories that share a common name prefix with the configured root directory. For example, if root is set to /home/user1, paths like /home/user10 or /home/user1_backup would incorrectly be considered within the root. This issue affects OTP from OTP 17.0 before OTP 28.4.1, OTP 27.3.4.9 and OTP 26.2.5.18, corresponding to ssh from 3.0.1 before 5.5.1, 5.2.11.6 and 5.1.4.14.
Type Values Removed Values Added
First Time appeared Erlang erlang\/ssh
CPEs cpe:2.3:a:erlang:erlang\/ssh:*:*:*:*:*:*:*:*
Vendors & Products Erlang erlang\/ssh
Metrics cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N'}

Type Values Removed Values Added
First Time appeared Erlang erlang/otp
Erlang otp
Vendors & Products Erlang erlang/otp
Erlang otp
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Erlang OTP (ssh_sftpd module) allows Path Traversal. This vulnerability is associated with program files lib/ssh/src/ssh_sftpd.erl and program routines ssh_sftpd:is_within_root/2. The SFTP server uses string prefix matching via lists:prefix/2 rather than proper path component validation when checking if a path is within the configured root directory. This allows authenticated users to access sibling directories that share a common name prefix with the configured root directory. For example, if root is set to /home/user1, paths like /home/user10 or /home/user1_backup would incorrectly be considered within the root. This issue affects OTP from OTP 17.0 until OTP 28.4.1, OTP 27.3.4.9 and OTP 26.2.5.18, corresponding to ssh from 3.0.1 until 5.5.1, 5.2.11.6 and 5.1.4.14.
Title SFTP root escape via component-agnostic prefix check in ssh_sftpd
First Time appeared Erlang
Erlang erlang\/otp
Weaknesses CWE-22
CPEs cpe:2.3:a:erlang:erlang\/otp:*:*:*:*:*:*:*:*
Vendors & Products Erlang
Erlang erlang\/otp
References
Metrics cvssV4_0

{'score': 5.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
EEF
Published
Updated
Nov 20, 2026, 5:56 AM
Reserved
Jan 19, 2026, 2:23 PM
Status
Modified
Published
Mar 13, 2026, 7:54 PM
Modified
Nov 20, 2026, 6:17 AM