/

CVE-2026-72571

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in Cast LocalVideo Endpoint

CVE-2026-72571

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read and Sensitive Information Disclosure

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal vulnerability in Cast LocalVideo allows unauthenticated remote attackers to read arbitrary files from the server. The issue becomes risky when attacker-controlled path values are passed to file-serving functionality without normalization or access restrictions.

Affected context

The vulnerability occurs in the application's file-serving handler when the user-supplied req.body.dir parameter is passed directly to res.sendFile().

Deployments may be affected when this endpoint is remotely reachable, does not require authentication, and lacks canonicalization or validation of requested paths. Absolute paths and traversal sequences such as ../ can allow requests to escape the intended directory.

Exploit preconditions

  • Attack surface: Remotely accessible file-serving endpoint
  • Required access: No authentication may be required
  • Attacker-controlled input: The req.body.dir request parameter
  • Trigger point: Construction of the path passed to res.sendFile()
  • Why exploitation is possible: The handler accepts path values without sufficient sanitization, allowing traversal outside the intended directory

Why this happens

The underlying bug is improper limitation of a user-controlled pathname before it is used for file access. Passing the request value directly to a file-serving API permits absolute paths or parent-directory components to influence the resolved filesystem location.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly called path traversal. The insecure pattern is trusting externally supplied paths without canonicalization, containment checks, and enforcement of an approved base directory.

Potential impact

  • An attacker may read sensitive application files
  • Server configuration, credentials, or environment data could be disclosed
  • Source code and internal deployment information may be exposed
  • Disclosed secrets could enable follow-on compromise of connected systems
  • Privacy, integrity, and availability may be affected indirectly

General mitigation guidance

Mitigation generally focuses on removing direct trust in client-supplied filesystem paths.

Common defensive patterns include:

  • Resolve requested paths against a fixed, approved base directory
  • Canonicalize paths before checking containment
  • Reject absolute paths, traversal components, and unexpected encodings
  • Prefer opaque file identifiers or an allowlisted mapping over raw path input
  • Apply authentication and authorization where file access is not intended to be public
  • Run the service with least-privilege filesystem permissions
  • Avoid exposing sensitive directories through static or dynamic file-serving handlers

How teams detect issues like this

Organizations can detect path traversal risks through:

  • Static analysis rules for user input flowing into filesystem APIs such as sendFile, readFile, or equivalent functions
  • Code review checks for raw request parameters used in path construction
  • Tests covering absolute paths, parent-directory segments, encoded traversal, and symlink behavior
  • Runtime monitoring for repeated requests containing traversal indicators or unexpected filesystem targets
  • Policy enforcement requiring canonicalization and base-directory containment before file access
  • Automated security review tools that identify tainted data flows into file APIs

Sources

SourceLink
github.comgithub.com/mustafaakin/cast-localvideo
github.comgithub.com/mustafaakin/cast-localvideo/blob/main/app.js

Frequently asked

questions

Yes. It may be remotely exploitable without authentication when the vulnerable file-serving endpoint is reachable by an attacker.

The attacker generally needs only network access to the endpoint and the ability to submit a crafted dir value.

Avoid accepting raw filesystem paths from clients. Use approved file identifiers or enforce canonicalized path containment within a fixed, non-sensitive directory.

Combine strict input validation, allowlisted file mappings, least-privilege service accounts, security-focused code review, and automated tests for traversal variants.

Find out what's already
exploitable in your codebase.