---
id: CVE-2026-81028
title: >-
  ZLMediaKit confines the downloadFile API to a configured set of root
  directories with a prefix comparison that does not account for directory
  boundaries
summary: >-
  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::absoluteP…
severity: medium
cvss: 4.9
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N'
cwe:
  - CWE-22
published: '2026-08-26'
updated: '2026-09-23'
sourceUpdated: '2026-09-23T17:17:43.160'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-81028'
references:
  - url: 'https://github.com/ZLMediaKit/ZLMediaKit'
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/ZLMediaKit/ZLMediaKit/blob/fa347d7dbe48dfdce525d3a0fdb92e576970ef9f/server/WebApi.cpp
    label: disclosure@vulncheck.com
  - url: 'https://github.com/ZLMediaKit/ZLMediaKit/issues/4817'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/zlmediakit-downloadfile-root-directory-confinement-bypass-via-prefix-collision
    label: disclosure@vulncheck.com
tags:
  - nvd
  - cve.org
epss: 0.00515
epssPercentile: 0.43659
ingestedAt: '2026-09-23T17:28:14.803Z'
vendor: ZLMediaKit
product: ZLMediaKit
affected:
  - ZLMediaKit fa347d7dbe48dfdce525d3a0fdb92e576970ef9f
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-08-27T18:24:17.709556Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
