# CVE-2026-23942: SFTP root escape via component-agnostic prefix check in ssh_sftpd

Status: published. Published: 2026-03-13. Updated: 2026-11-11.

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.

## Remediation

- 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/). (source: CNA: EEF)
- fix: The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches. (source: CNA: EEF) — https://github.com/erlang/otp/commit/5ed603a1211b83b8be2d1fc06d3f3bf30c3c9759
- fix: The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches. (source: CNA: EEF) — https://github.com/erlang/otp/commit/9e0ac85d3485e7898e0da88a14be0ee2310a3b28
- fix: The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches. (source: CNA: EEF) — https://github.com/erlang/otp/commit/27688a824f753d4c16371dc70e88753fb410590b

## Affected products and versions

- Erlang / OTP (otp): ≥ 17.0; < * (affected, otp); unaffected at 26.2.5.18; unaffected at 27.3.4.9; unaffected at 28.4.1. Source: CNA: EEF
- Erlang / OTP (ssh): ≥ 3.0.1; < * (affected, otp); unaffected at 5.1.4.14; unaffected at 5.2.11.6; unaffected at 5.5.1. Source: CNA: EEF
- Erlang / OTP (erlang/otp): ≥ 84adefa331c4159d432d22840663c38f155cd4c1; < * (affected, git); unaffected at 5ed603a1211b83b8be2d1fc06d3f3bf30c3c9759; unaffected at 9e0ac85d3485e7898e0da88a14be0ee2310a3b28; unaffected at 27688a824f753d4c16371dc70e88753fb410590b; ≥ 5ed603a1211b83b8be2d1fc06d3f3bf30c3c9759; < * (unaffected, git); ≥ 9e0ac85d3485e7898e0da88a14be0ee2310a3b28; < * (unaffected, git); ≥ 27688a824f753d4c16371dc70e88753fb410590b; < * (unaffected, git). Source: CNA: EEF

## Severity and prioritization

- CVSS 4.0: 5.3 (medium); 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; source: CNA: EEF

- CISA KEV: No listing in collected sources

- EPSS: 0.41% as of 2026-11-10; percentile 35.44%

- SSVC: exploitation none; automatable yes; technical impact partial; source ADP: CISA-ADP

- Weaknesses: CWE-22

## Exploit evidence

No exploit evidence in collected sources. This is not proof of no exploitation.

## References

- https://github.com/erlang/otp/security/advisories/GHSA-4749-w85x-hw9h (CNA: EEF; vendor-advisory, related)

- https://cna.erlef.org/cves/CVE-2026-23942.html (CNA: EEF; related)

- https://osv.dev/vulnerability/EEF-CVE-2026-23942 (CNA: EEF; related)

- https://www.erlang.org/doc/system/versions.html#order-of-versions (CNA: EEF; x_version-scheme)

- https://github.com/erlang/otp/commit/5ed603a1211b83b8be2d1fc06d3f3bf30c3c9759 (CNA: EEF; patch)

- https://github.com/erlang/otp/commit/9e0ac85d3485e7898e0da88a14be0ee2310a3b28 (CNA: EEF; patch)

- https://github.com/erlang/otp/commit/27688a824f753d4c16371dc70e88753fb410590b (CNA: EEF; patch)

## Provenance

- CNA: EEF: https://www.cve.org/CVERecord?id=CVE-2026-23942; retrieved 2026-11-11; source updated 2026-11-11

- FIRST EPSS: https://api.first.org/data/v1/epss?cve=CVE-2026-23942; retrieved 2026-11-11; source updated Not reported

Revision: e5fc995397e4e3c58260f9cfc4d43abd5594af0a79c369fef06f5fc63287b1d5

Canonical: https://y2.dev/cve/CVE-2026-23942

## Agent and API access

Public CVE pages, Markdown, and JSON are free to read without an account or API key.

- Public catalog: https://y2.dev/cve/index.json. Follow nextCursor with the same search, filters, sort, and limit (1–100). A null cursor marks the end.

- WebMCP: search_cve_disclosures, get_cve_disclosure, get_cve_page_markdown, get_y2_cve_access. Available in compatible browsers.

- Cyber API: https://api.y2.dev/api/v2/cyber/cves and https://api.y2.dev/api/v2/cyber/cves/{cveId}.

- Y2 Pro or Elite: create a workspace API key with the intel:cyber scope and send Authorization: Bearer <Y2_API_KEY>. Setup: https://y2.dev/docs/api/create-key.

- x402: Pay per request without an account or API key. Omit Authorization, read the HTTP 402 PAYMENT-REQUIRED challenge, validate its current requirements, and retry with PAYMENT-SIGNATURE through an authorized payment client. These browser tools never make payments. Guide: https://y2.dev/docs/api/x402.

- OpenAPI: https://y2.dev/api/openapi.yaml. Agent access metadata: https://y2.dev/cve/agent.json.

Collected public records only. Check source status for coverage and freshness.