Description
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Erlang OTP ssh (ssh_sftpd module) allows an authenticated SFTP user to modify file attributes outside the configured chroot directory.

The SFTP daemon (ssh_sftpd) stores the raw, user-supplied path in file handles instead of the chroot-resolved path. When SSH_FXP_FSETSTAT is issued on such a handle, file attributes (permissions, ownership, timestamps) are modified on the real filesystem path, bypassing the root directory boundary entirely.

Any authenticated SFTP user on a server configured with the root option can modify file attributes of files outside the intended chroot boundary. The prerequisite is that a target file must exist on the real filesystem at the same relative path. Note that this vulnerability only allows modification of file attributes; file contents cannot be read or altered through this attack vector.

If the SSH daemon runs as root, this enables direct privilege escalation: an attacker can set the setuid bit on any binary, change ownership of sensitive files, or make system configuration world-writable.

This vulnerability is associated with program files lib/ssh/src/ssh_sftpd.erl and program routines ssh_sftpd:do_open/4 and ssh_sftpd:handle_op/4.

This issue affects OTP from OTP 17.0 until OTP 28.4.3, 27.3.4.11, and 26.2.5.20 corresponding to ssh from 3.01 until 5.5.3, 5.2.11.7, and 5.1.4.15.
Published: 2026-04-21
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Privilege Escalation via File Attribute Modification
Action: Immediate Patch
AI Analysis

Impact

The Erlang OTP SSH daemon (ssh_sftpd module) mishandles user-supplied paths by storing the raw path rather than the resolved, chroot‑constrained path. When a file attribute change request (SSH_FXP_FSETSTAT) is processed, the daemon modifies the attributes of the real file on the host filesystem, bypassing the intended chroot boundary. This path traversal flaw is a classic “CWE‑22” weakness and allows an authenticated SFTP user to set permissions, ownership, or timestamps on arbitrary files that already exist on the host at the same relative path. File contents remain protected, but the ability to change attributes can be abused for privilege escalation if the daemon runs with elevated privileges.

Affected Systems

The vulnerability affects Erlang OTP releases from 17.0 through 28.4.3, as well as the specific sub‑releases 27.3.4.11 and 26.2.5.20. It applies to versions of the SSH component in OTP 3.01 through 5.5.3, 5.2.11.7, and 5.1.4.15. Any system that installs one of these Erlang OTP releases and configures the SSH server to use the ‘root’ option for the SFTP subsystem is susceptible.

Risk and Exploitability

A remote attacker gains an SFTP session to an affected server that is configured with the root option. The exploit requires the target file to exist on the host at the same relative path; no content read or write is possible. If the SSH daemon is running as root, the attacker can remap executable binaries, assign set‑uid bits, alter ownership of sensitive files, or make system configuration files world‑writable, effectively bypassing the chroot and escalating privileges. The CVSS score is 5.3, indicating a moderate severity. The EPSS score is < 1 %, suggesting a very low current exploitation probability, and the vulnerability is not listed in CISA’s KEV catalog. Nonetheless, the potential impact of privilege escalation warrants a timely response.

Generated by OpenCVE AI on April 21, 2026 at 23:03 UTC.

Remediation

Vendor Workaround

* Do not use the root option in ssh_sftpd:subsystem_spec/1, and instead rely on OS-level chroot or container isolation to confine SFTP users. * Ensure the Erlang VM is not running as a privileged OS user. Running the VM as an unprivileged user limits the impact of this vulnerability, since attribute modifications are constrained by that user's OS-level permissions.


OpenCVE Recommended Actions

  • Rely on operating‑system level chroot or container isolation rather than the SSH root option – do not use the root option in ssh_sftpd:subsystem_spec/1.
  • Run the Erlang virtual machine as an unprivileged OS user – a non‑privileged VM limits the damage that can be caused by modified file attributes.
  • Upgrade Erlang OTP to the latest version that contains the SSH fsetstat patch; consult the Erlang project releases for a fixed build or apply the vendor‑supplied advisory to update the otp/ssh component.

Generated by OpenCVE AI on April 21, 2026 at 23:03 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 21 Apr 2026 17:30:00 +0000

Type Values Removed Values Added
First Time appeared Erlang otp
Vendors & Products Erlang otp

Tue, 21 Apr 2026 14:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Tue, 21 Apr 2026 12:15:00 +0000

Type Values Removed Values Added
Description Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Erlang OTP ssh (ssh_sftpd module) allows an authenticated SFTP user to modify file attributes outside the configured chroot directory. The SFTP daemon (ssh_sftpd) stores the raw, user-supplied path in file handles instead of the chroot-resolved path. When SSH_FXP_FSETSTAT is issued on such a handle, file attributes (permissions, ownership, timestamps) are modified on the real filesystem path, bypassing the root directory boundary entirely. Any authenticated SFTP user on a server configured with the root option can modify file attributes of files outside the intended chroot boundary. The prerequisite is that a target file must exist on the real filesystem at the same relative path. Note that this vulnerability only allows modification of file attributes; file contents cannot be read or altered through this attack vector. If the SSH daemon runs as root, this enables direct privilege escalation: an attacker can set the setuid bit on any binary, change ownership of sensitive files, or make system configuration world-writable. This vulnerability is associated with program files lib/ssh/src/ssh_sftpd.erl and program routines ssh_sftpd:do_open/4 and ssh_sftpd:handle_op/4. This issue affects OTP from OTP 17.0 until OTP 28.4.3, 27.3.4.11, and 26.2.5.20 corresponding to ssh from 3.01 until 5.5.3, 5.2.11.7, and 5.1.4.15.
Title SFTP chroot bypass via path traversal in SSH_FXP_FSETSTAT
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:N/VI:L/VA:N/SC:N/SI:L/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: EEF

Published:

Updated: 2026-04-22T04:13:25.005Z

Reserved: 2026-03-10T22:37:29.213Z

Link: CVE-2026-32147

cve-icon Vulnrichment

Updated: 2026-04-21T13:11:15.174Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-04-21T12:15:58.800

Modified: 2026-04-21T16:20:24.180

Link: CVE-2026-32147

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-21T23:15:03Z

Weaknesses