# CVE-2026-81028: ZLMediaKit downloadFile Root-Directory Confinement Bypass via Prefix Collision

> Attackers with API access can read files outside the configured root directory due to a prefix collision flaw in the downloadFile API.

- **Severity:** Medium 6.9 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 26 Aug 2026
- **Updated:** 27 Oct 2026
- **Also known as:** GHSA-4j5x-jgmh-j582

## What is CVE-2026-81028?

CVE-2026-81028 is a medium-severity path traversal vulnerability in ZLMediaKit, published on 26 Aug 2026. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

ZLMediaKit confines the downloadFile API to a configured set of root directories with a prefix comparison that does not account for directory boundaries. The configuration loader in server/WebApi.cpp builds each root with File::absolutePath("", item, true); because the relative-path argument is empty that helper returns the value without a trailing separator. The handler then accepts a requested path when start_with(file_path, root) holds, so a sibling directory whose name merely begins with the configured root string satisfies the test and is served. The only other guard rejects a path containing two dots, which this requires none of. The equivalent confinement check for the ordinary static file server in src/Http/HttpFileManager.cpp computes its root with a non-empty second argument, which appends the separator before comparing, and so is not affected. The endpoint requires the configured API secret, so this grants no privilege beyond what that secret already implies, but it reads files outside the directory the operator confined it to, and the reference container runs the server as root.

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

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


## How do I fix CVE-2026-81028?

No fix has been published for CVE-2026-81028 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-81028 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-81028 and fix it if it is affected.

What it is: CVE-2026-81028 is a medium-severity path traversal vulnerability in ZLMediaKit, published on 26 Aug 2026. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-81028 in the wild and no public exploit code.

Affected product: ZLMediaKit. No package-level version data is available, so check the vendor advisory linked from the reference page.

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

## Sources

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

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