CVE-2026-23942: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in Erlang OTP
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.
AI Analysis
Technical Summary
This vulnerability in Erlang OTP's ssh_sftpd module (specifically in ssh_sftpd:is_within_root/2) is due to improper limitation of a pathname to a restricted directory (CWE-22). The SFTP server incorrectly uses lists:prefix/2 for path validation, which treats directories with similar prefixes as within the root directory. For example, if the root is /home/user1, paths like /home/user10 or /home/user1_backup are mistakenly allowed, enabling path traversal to sibling directories. Affected versions include OTP 17.0 through 28.4.1, OTP 27.3.4.9, and OTP 26.2.5.18, corresponding to ssh versions 3.0.1 through 5.5.1 and certain patch versions.
Potential Impact
Authenticated users of the vulnerable Erlang OTP ssh_sftpd SFTP server can access files outside the intended root directory by exploiting the path traversal flaw. This may lead to unauthorized disclosure of files in sibling directories that share a prefix with the root directory. The vulnerability does not require user interaction and has low attack complexity but requires low privileges. There is no indication of known exploits in the wild.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Since no patch or official fix information is provided, users should monitor Erlang's official advisories for updates. Until a fix is available, restrict access to the SFTP service to trusted users only and consider additional access controls to limit exposure.
CVE-2026-23942: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in Erlang OTP
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.
CVSS v4.0
Score 5.3medium
Affected software
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This vulnerability in Erlang OTP's ssh_sftpd module (specifically in ssh_sftpd:is_within_root/2) is due to improper limitation of a pathname to a restricted directory (CWE-22). The SFTP server incorrectly uses lists:prefix/2 for path validation, which treats directories with similar prefixes as within the root directory. For example, if the root is /home/user1, paths like /home/user10 or /home/user1_backup are mistakenly allowed, enabling path traversal to sibling directories. Affected versions include OTP 17.0 through 28.4.1, OTP 27.3.4.9, and OTP 26.2.5.18, corresponding to ssh versions 3.0.1 through 5.5.1 and certain patch versions.
Potential Impact
Authenticated users of the vulnerable Erlang OTP ssh_sftpd SFTP server can access files outside the intended root directory by exploiting the path traversal flaw. This may lead to unauthorized disclosure of files in sibling directories that share a prefix with the root directory. The vulnerability does not require user interaction and has low attack complexity but requires low privileges. There is no indication of known exploits in the wild.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Since no patch or official fix information is provided, users should monitor Erlang's official advisories for updates. Until a fix is available, restrict access to the SFTP service to trusted users only and consider additional access controls to limit exposure.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- EEF
- Date Reserved
- 2026-01-19T14:23:14.343Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 69b3d90e2f860ef943bac728
Added to database: 3/13/2026, 9:29:50 AM
Last enriched: 5/27/2026, 8:04:03 PM
Last updated: 6/11/2026, 11:12:22 PM
Views: 129
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.