{"id":"EEF-CVE-2026-23942","summary":"SFTP root escape via component-agnostic prefix check in ssh_sftpd","details":"## Summary\n\nImproper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Erlang OTP (ssh_sftpd module) allows Path Traversal.\n\nThis vulnerability is associated with program files `lib/ssh/src/ssh_sftpd.erl` and program routines `ssh_sftpd:is_within_root/2`.\n\nThe 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.\n\nThis 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.\n\n## Workarounds\n\n* Use OS-level chroot to run the Erlang VM/SFTP server process in an isolated filesystem environment.\n* Ensure that no sensitive or precious data is readable or writable by the OS user running the Erlang VM.\n* Ensure that the SFTP server port is not reachable from untrusted machines.\n* Use directory naming conventions that avoid common prefixes (e.g., `/home/users/alice/` instead of `/home/user1/`).\n\n## Configurations\n\nThe SFTP subsystem must be enabled on the SSH server, the SSH port must be reachable by the attacker, and a root directory must be configured. This is the case when `ssh_sftpd` is included in the `subsystems` option with a `root` parameter and there exist sibling directories sharing the same name prefix as the root.","aliases":["CVE-2026-23942","GHSA-4749-w85x-hw9h"],"modified":"2026-11-11T19:45:03.038616128Z","published":"2026-03-13T09:11:56.424Z","database_specific":{"capec_ids":["CAPEC-126"],"cpe_ids":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"cwe_ids":["CWE-22"]},"references":[{"type":"ADVISORY","url":"https://github.com/erlang/otp/security/advisories/GHSA-4749-w85x-hw9h"},{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-23942.html"},{"type":"WEB","url":"https://www.erlang.org/doc/system/versions.html#order-of-versions"},{"type":"FIX","url":"https://github.com/erlang/otp/commit/5ed603a1211b83b8be2d1fc06d3f3bf30c3c9759"},{"type":"FIX","url":"https://github.com/erlang/otp/commit/9e0ac85d3485e7898e0da88a14be0ee2310a3b28"},{"type":"FIX","url":"https://github.com/erlang/otp/commit/27688a824f753d4c16371dc70e88753fb410590b"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/erlang/otp","events":[{"introduced":"84adefa331c4159d432d22840663c38f155cd4c1"},{"fixed":"5ed603a1211b83b8be2d1fc06d3f3bf30c3c9759"},{"fixed":"9e0ac85d3485e7898e0da88a14be0ee2310a3b28"},{"fixed":"27688a824f753d4c16371dc70e88753fb410590b"}]}],"versions":["patch-base-27","OTP-27.3.4","patch-base-26","OTP-26.2.5","OTP-28.4","OTP-27.0","OTP-26.2.5.9","OTP-28.0","OTP-26.2.5.17","OTP-27.3.4.8","OTP-27.3.4.6","OTP-27.3.4.7","OTP-26.2.5.16","OTP-26.2.5.12","OTP-27.3","OTP-27.3.4.5","OTP-27.3.4.4","OTP-26.2.5.15","OTP-26.2.3","OTP-28.1","OTP-27.3.4.3","OTP-27.3.3","OTP-26.2.5.14","OTP-27.3.4.2","OTP-26.0","OTP-26.2.5.13","OTP-25.0","OTP-27.3.4.1","OTP-28.0-rc4","OTP-26.2.5.11","OTP-27.3.2","OTP-28.0-rc3","OTP-26.2.5.10","OTP-27.2","OTP-28.0-rc2","OTP-27.3.1","OTP-28.0-rc1","OTP-26.2.5.8","OTP-26.2.5.7","OTP-26.2.5.6","OTP-27.1","OTP-26.2.5.5","OTP-26.2.5.4","OTP-26.2.5.3","OTP-26.2","OTP-26.2.5.2","OTP-26.2.5.1","OTP-26.2.4","OTP-27.0-rc3","OTP-27.0-rc2","OTP-27.0-rc1","OTP-24.0","OTP-26.1","OTP-26.0-rc3","OTP-26.0-rc2","OTP-26.0-rc1","OTP-23.0","OTP-21.0","OTP-25.0-rc3","OTP-25.0-rc2","OTP-25.0-rc1","OTP-22.0","OTP-24.0-rc3","OTP-24.0-rc2","OTP-24.0-rc1","OTP-23.0-rc3","OTP-23.0-rc2","OTP-23.0-rc1","OTP-20.0","OTP-22.0-rc3","OTP-22.0-rc2","OTP-22.0-rc1","OTP-19.0","OTP-21.0-rc2","OTP-18.0","OTP-21.0-rc1","OTP-17.0","OTP-20.0-rc2","OTP-20.0-rc1","OTP-19.0-rc2","OTP-19.0-rc1","OTP_R16B","OTP-18.0-rc1","OTP_17.0-rc2","OTP_17.0-rc1","OTP_R13B03","OTP_R16A_RELEASE_CANDIDATE","OTP_R14B03","OTP_R15B","OTP_R15A","OTP_R14B02","OTP_R14B01","OTP_R14B","OTP_R13B04","OTP_R14A"],"database_specific":{"source":"https://cna.erlef.org/osv/EEF-CVE-2026-23942.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"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"}],"credits":[{"name":"Luigino Camastra / Aisle Research","type":"FINDER"},{"name":"Jakub Witczak","type":"REMEDIATION_DEVELOPER"},{"name":"Michał Wąsowski","type":"REMEDIATION_REVIEWER"}]}