CVE-2026-23942: SFTP root escape via component-agnostic prefix check in ssh_sftpd
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.
Security readout for executives and security teams
Plain-English summary
An authenticated SFTP user may escape an Erlang OTP server’s configured file root and reach sibling directories whose names begin with the same text. Exposure is limited by operating-system permissions, but accessible files could be read or modified. The flaw does not directly enable anonymous access or service disruption.
Executive priority
Patch promptly on externally reachable or multi-tenant SFTP systems because authenticated users can cross an intended security boundary. Systems that do not use ssh_sftpd are not exposed through this flaw. Treat confirmation of module use, account trust, and filesystem permissions as the immediate triage task.
Technical view
The ssh_sftpd module’s is_within_root/2 routine uses lists:prefix/2 instead of comparing complete path components. Consequently, a root such as /home/user1 also accepts paths under similarly prefixed sibling directories. OTP 17.0 onward is affected before the applicable fixed releases: 28.4.1, 27.3.4.9, or 26.2.5.18.
Likely exposure
Exposure requires ssh_sftpd, a configured restricted root, and an authenticated account. Practical impact further requires a similarly named sibling directory and operating-system permission to access it. Internet-reachable or partner-facing SFTP services with broadly permitted filesystem accounts deserve the fastest review.
Exploitation context
CVSS 4.0 rates this 5.3: network-accessible, low complexity, low privileges, and no user interaction, with limited confidentiality and integrity impact. The supplied record does not identify active exploitation, and the CVE is not listed as KEV. Exploit prevalence therefore remains unknown.
Researcher notes
The defect is a component-boundary validation failure, not general unauthenticated traversal. Analysis should distinguish lexical prefix acceptance from actual filesystem access, which remains permission-dependent. Three upstream commits are supplied for supported release lines. The bundle establishes affected and fixed version thresholds but provides no evidence of exploitation in the wild.
Mitigation direction
Upgrade each affected OTP branch to at least 28.4.1, 27.3.4.9, or 26.2.5.18, as applicable.
Consult the Erlang advisory and patch references before handling older or unsupported OTP branches.
Restrict SFTP access to necessary accounts while upgrades are pending.
Use operating-system permissions or isolation to prevent SFTP accounts accessing unintended sibling directories.
Validation and detection
Inventory OTP and ssh application versions on systems providing SFTP.
Confirm whether ssh_sftpd is enabled with a configured restricted root.
Identify sibling directories sharing the root-name prefix and review account permissions to them.
After upgrading, verify the deployed OTP branch meets its documented fixed version.
Review available SFTP and file-access records for unexpected access outside intended roots.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-22: File access and web shell behavior lookup
File traversal and upload weaknesses can lead teams to review file, web shell, execution, and collection telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references file access or upload behavior, so file telemetry and web shell review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.