# CVE-2020-26299: File System Bounds Escape

> Attackers can escape the FTP user's root directory on Windows systems using path traversal commands, allowing unauthorized file access.

- **Severity:** Medium 6.3 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:H/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 Feb 2021
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-pmw4-jgxx-pcq9

## What is CVE-2020-26299?

CVE-2020-26299 is a medium-severity path traversal vulnerability in autovance ftp-srv, published on 10 Feb 2021. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

ftp-srv is an open-source FTP server designed to be simple yet configurable. In ftp-srv before version 4.4.0 there is a path-traversal vulnerability. Clients of FTP servers utilizing ftp-srv hosted on Windows machines can escape the FTP user's defined root folder using the expected FTP commands, for example, CWD and UPDR. When windows separators exist within the path (`\`), `path.resolve` leaves the upper pointers intact and allows the user to move beyond the root folder defined for that user. We did not take that into account when creating the path resolve function. The issue is patched in version 4.4.0 (commit 457b859450a37cba10ff3c431eb4aa67771122e3).

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

## Which versions are affected by CVE-2020-26299?

2 open source packages ship an affected version, including ftp-srv. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ftp-srv` | npm | All versions | 4.4.0 |
| `ftp-srv` | npm | All versions | 4.4.0 |

Products: Ftp-Srv Project Ftp-Srv.

## How do I fix CVE-2020-26299?

Upgrade ftp-srv to 4.4.0 or later.

## Is CVE-2020-26299 being exploited?

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

## Other vulnerabilities in autovance ftp-srv

- [CVE-2020-15152](https://insights.sbomify.com/CVE-2020-15152/): Server-Side Request Forgery in ftp-srv (critical 9.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-26299 and fix it if it is affected.

What it is: CVE-2020-26299 is a medium-severity path traversal vulnerability in autovance ftp-srv, published on 10 Feb 2021. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2020-26299 in the wild and no public exploit code.

Affected packages and fixed versions:
- ftp-srv (npm): affected all versions; fixed in 4.4.0
- ftp-srv (npm): affected all versions; fixed in 4.4.0

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-2020-26299/ (Markdown: https://insights.sbomify.com/CVE-2020-26299/index.md)
```

## Sources

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

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