# CVE-2023-35887: Apache MINA SSHD: Information disclosure bugs with RootedFilesystem

> Attackers can discover file existence outside the root directory in SFTP servers using Apache MINA SSHD with RootedFileSystem.

- **Severity:** Medium 5.0 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Jul 2023
- **Updated:** 7 Oct 2024
- **Also known as:** CLEANSTART-2026-DP56505, CLEANSTART-2026-EF36950, CLEANSTART-2026-PH67619, GHSA-mjmq-gwgm-5qhm, MINI-vw9x-whc4-x8rj, OESA-2024-1079

## What is CVE-2023-35887?

CVE-2023-35887 is a medium-severity path traversal vulnerability in Apache MINA SSHD, published on 10 Jul 2023. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Exposure of Sensitive Information to an Unauthorized Actor vulnerability in Apache Software Foundation Apache MINA.

In SFTP servers implemented using Apache MINA SSHD that use a RootedFileSystem, logged users may be able to discover "exists/does not exist" information about items outside the rooted tree via paths including parent navigation ("..") beyond the root, or involving symlinks.

This issue affects Apache MINA: from 1.0 before 2.10. Users are recommended to upgrade to 2.10

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2023-35887?

6 open source packages ship an affected version, including org.apache.sshd:sshd-common, org.apache.sshd:sshd-core and org.apache.sshd:sshd-sftp. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.sshd:sshd-common` | Maven | From 2.1.0 | 2.9.3 |
| `org.apache.sshd:sshd-common` | Maven | From 2.1.0 | 2.9.3 |
| `org.apache.sshd:sshd-core` | Maven | From 1.0.0 | 2.1.0 |
| `org.apache.sshd:sshd-core` | Maven | From 1.0.0 | 2.1.0 |
| `org.apache.sshd:sshd-sftp` | Maven | From 1.0.0 | 2.9.3 |
| `org.apache.sshd:sshd-sftp` | Maven | From 1.0.0 | 2.9.3 |

Products: Apache Sshd.

## How do I fix CVE-2023-35887?

Upgrade org.apache.sshd:sshd-common to 2.9.3 or later.

## Is CVE-2023-35887 being exploited?

There is no known exploitation of CVE-2023-35887 in the wild and no public exploit code.

Public exploit code:

- https://github.com/shoucheng3/apache__mina-sshd_CVE-2023-35887_2-9-2 (github_poc): https://github.com/shoucheng3/apache__mina-sshd_CVE-2023-35887_2-9-2

## Other vulnerabilities in Apache MINA SSHD

- [CVE-2022-45047](https://insights.sbomify.com/CVE-2022-45047/): Apache MINA SSHD: Java unsafe deserialization vulnerability (critical 9.8)
- [CVE-2021-30129](https://insights.sbomify.com/CVE-2021-30129/): DoS/OOM leak vulnerability in Apache Mina SSHD Server (medium 6.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-35887 and fix it if it is affected.

What it is: CVE-2023-35887 is a medium-severity path traversal vulnerability in Apache MINA SSHD, published on 10 Jul 2023. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-35887 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache.sshd:sshd-common (Maven): affected from 2.1.0; fixed in 2.9.3
- org.apache.sshd:sshd-common (Maven): affected from 2.1.0; fixed in 2.9.3
- org.apache.sshd:sshd-core (Maven): affected from 1.0.0; fixed in 2.1.0
- org.apache.sshd:sshd-core (Maven): affected from 1.0.0; fixed in 2.1.0
- org.apache.sshd:sshd-sftp (Maven): affected from 1.0.0; fixed in 2.9.3
- org.apache.sshd:sshd-sftp (Maven): affected from 1.0.0; fixed in 2.9.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-35887/ (Markdown: https://insights.sbomify.com/CVE-2023-35887/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-35887
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-35887
- OSV: https://osv.dev/vulnerability/CVE-2023-35887

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-35887/
Summaries are generated and may contain mistakes; the official description above is the record.
