# CVE-2026-23942: SFTP root escape via component-agnostic prefix check in ssh\_sftpd

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.3
- **CVSS:** 5.3 (v4.0, CNA) `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`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: None; Privileges required: Low; User interaction: None; Confidentiality impact: Low; Integrity impact: Low; Availability impact: None; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **EPSS:** 0.45% (percentile 31, 2026-11-26)
- **CWE:** CWE-22
- **Published:** 2026-03-13T09:11:56.424Z
- **Modified:** 2026-11-20T06:17:22.600Z

## Who should check

- Anyone running Erlang OTP \>= 3.0.1, \< \*
- Anyone running Erlang OTP \>= 17.0, \< \*
- Anyone running Erlang OTP \>= 84adefa331c4159d432d22840663c38f155cd4c1, \< \*

## 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.

## Affected and fixed versions

- Erlang OTP: \>= 3.0.1, \< \* (cvelist)
- Erlang OTP: \>= 17.0, \< \* (cvelist)
- Erlang OTP: \>= 84adefa331c4159d432d22840663c38f155cd4c1, \< \* (cvelist)

## Mitigation

- 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/).

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-23942. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-23942.md
Affected: Erlang OTP >= 3.0.1, < *; Erlang OTP >= 17.0, < *; Erlang OTP >= 84adefa331c4159d432d22840663c38f155cd4c1, < *
Fixed in: no fixed version listed yet

Steps:
1. Search this machine and project for Erlang OTP: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-23942 being exploited?

There is no confirmed exploitation: CVE-2026-23942 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.45% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-23942?

Medium: CVSS 5.3 (v4.0, scored by CNA). Remote, login needed.

### Which versions are affected by CVE-2026-23942?

Erlang OTP \>= 3.0.1, \< \*; Erlang OTP \>= 17.0, \< \*; Erlang OTP \>= 84adefa331c4159d432d22840663c38f155cd4c1, \< \*.

### Is there a fix for CVE-2026-23942?

No fixed version is listed in the sources yet. 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/).

### How do I check if I'm affected by CVE-2026-23942?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/erlang/otp/security/advisories/GHSA-4749-w85x-hw9h>
- vendor: <https://cna.erlef.org/cves/CVE-2026-23942.html>
- vendor: <https://osv.dev/vulnerability/EEF-CVE-2026-23942>
- patch: <https://github.com/erlang/otp/commit/27688a824f753d4c16371dc70e88753fb410590b>
- patch: <https://github.com/erlang/otp/commit/5ed603a1211b83b8be2d1fc06d3f3bf30c3c9759>
- patch: <https://github.com/erlang/otp/commit/9e0ac85d3485e7898e0da88a14be0ee2310a3b28>
- other: <https://www.erlang.org/doc/system/versions.html#order-of-versions>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-23942>

HTML: <https://flawdb.com/CVE-2026-23942> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-23942>
