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.
Published: 2026-08-26
Score: 6.9 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability lies in ZLMediaKit’s downloadFile API, which incorrectly resolves root directories. The code loads root paths using a helper that omits a trailing separator when the relative path is empty, and the API accepts a file path if it starts with the root string. A directory whose name merely begins with the configured root string can therefore be accessed, allowing an attacker to download any file outside the intended sandbox. The flaw is a classic Directory Traversal (CWE‑22) that enables arbitrary file disclosure. The API is protected by an API secret, so the attacker already needs that credential; once they have it, they can read any file that the server process can access, which is especially dangerous when the server runs as root, as noted in the reference container.

Affected Systems

The affected product is ZLMediaKit across all releases that contain the current downloadFile implementation. No version ranges are explicitly listed, so any installed instance that has not yet applied an update where the bug is fixed is vulnerable. Administrators should treat all ZLMediaKit deployments as impacted until they confirm the code change or a patch has been applied.

Risk and Exploitability

The CVSS score of 6.9 indicates moderate severity. Because the EPSS score is not available and the vulnerability has not been reported in the CISA KEV catalog, there is no evidence of active exploitation in the wild. However, the flaw requires only the API secret and the server’s permissions; if the secret is compromised or weak, an attacker can read sensitive files. The lack of a disallowed double‑dot check further widens the attack surface. In environments where the server runs as root, the potential impact is higher, turning a data exfiltration vector into a full system compromise if additional privileges are available.

Generated by OpenCVE AI on August 26, 2026 at 17:58 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade ZLMediaKit to the latest release that includes the fix for the downloadFile root resolution logic.
  • If an upgrade cannot be applied immediately, limit the usage of the downloadFile API to trusted users by enforcing a strong API secret or disabling the endpoint altogether.
  • Monitor your application logs for unexpected downloadFile requests and verify that all accessed paths remain within intended directories.

Generated by OpenCVE AI on August 26, 2026 at 17:58 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 26 Aug 2026 16:00:00 +0000

Type Values Removed Values Added
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.
Title ZLMediaKit downloadFile Root-Directory Confinement Bypass via Prefix Collision
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 4.9, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N'}

cvssV4_0

{'score': 6.9, 'vector': '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'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-26T15:44:57.303Z

Reserved: 2026-08-26T15:23:05.351Z

Link: CVE-2026-81028

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-26T16:16:45.400

Modified: 2026-08-26T16:16:45.400

Link: CVE-2026-81028

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-26T18:00:04Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')