/

CVE-2026-28793

Severity:

HIGH RISK

(8.4)

Path Traversal in TinaCMS CLI Media Endpoints

CVE-2026-28793

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read/Write via HTTP Media Endpoints

Severity:

HIGH RISK

(8.4)

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

The TinaCMS CLI development server exposes media endpoints that are vulnerable to path traversal, allowing crafted paths to escape the intended media directory.

When the dev server is running, an attacker who can send HTTP requests to the media endpoints may read from or write to arbitrary files on the host filesystem.

Affected context

This vulnerability affects TinaCMS projects when the tinacms dev CLI command is used, which starts a local HTTP server (default port 4001) for development.

The issue occurs on instances where the media endpoints (/media/list/*, /media/upload/*, /media/*) are reachable by untrusted clients, such as when the dev server is bound to a non-local interface, proxied, or exposed within a shared network environment.

The risk is concentrated around deployments where the development server is used beyond a strictly isolated local developer environment.

Exploit preconditions

  • Attack surface: HTTP media endpoints on the TinaCMS CLI dev server (e.g., http://host:4001/media/...).
  • Required access: Ability to send HTTP requests to the running dev server; no authenticated session is necessarily required for media operations.
  • Trigger point: Use of crafted path segments within media URLs that result in filesystem paths outside the configured media directory.
  • Why exploitation is possible: User-controlled path components are decoded with decodeURI() and combined with path.join() without checking that the resolved path remains within the intended media root, enabling directory traversal.

Why this happens

The root cause is improper neutralization and validation of user-supplied path components before using them in filesystem operations, corresponding to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The dev server takes path segments from URLs such as /media/list/*, decodes them, and passes them into path.join() to construct on-disk paths.

Without enforcing that the normalized, resolved path is still within the configured media directory, attackers can use sequences like .. and other traversal patterns to break out of the intended directory and target arbitrary locations on the filesystem for reading or writing.

Potential impact

  • Read access to files outside the media directory that the dev server process can access.
  • Overwriting or creating arbitrary files on the filesystem via upload endpoints, potentially altering application behavior or developer assets.
  • Disclosure of sensitive information stored in configuration files, local credentials, or source code.
  • Modification of project files that could lead to malicious code injection into the application.

General mitigation guidance

Effective mitigation focuses on strict path normalization and directory confinement:

  • Normalize and resolve requested paths and verify that the final absolute path remains within the configured media root before any filesystem access.
  • Explicitly reject any paths containing traversal indicators (e.g., .., absolute path prefixes) after normalization.
  • Introduce a dedicated layer or utility for handling file paths that enforces directory whitelisting and does not permit arbitrary path usage.
  • Run development-facing servers with the least privileges needed, avoiding unnecessary access to sensitive directories or user-level files.
  • Keep development servers bound to localhost or otherwise isolated from untrusted networks to reduce exposure if a similar issue reappears.

How teams detect issues like this

Path traversal issues can be identified using a combination of automated and manual techniques:

  • Static analysis: Configure rules or custom checks to flag any use of user-controlled strings in filesystem APIs (fs.readFile, fs.writeFile, fs.readdir, etc.) without prior normalization and directory boundary checks.
  • Code review: Look for URL parameters or route segments passed directly into path.join(), fs operations, or similar APIs; verify that the resolved path is always checked against an allowed base directory.
  • Dynamic testing: Use security scanners or manual tests to send traversal payloads (e.g., ../, nested traversal patterns) to media-related endpoints and confirm that access is denied.
  • Policy enforcement: Introduce development guidelines and CI checks that require centralized helpers for path handling, disallowing ad hoc concatenation of user-provided paths.

Sources

SourceLink
github.comgithub.com/tinacms/tinacms/security/advisories/GHSA-2f24-mg4x-534q

Frequently asked

questions

It can be remotely exploitable if the TinaCMS dev server is reachable over a network by untrusted users. When the server is bound only to localhost and used solely by the developer, the exposure is significantly reduced but still warrants fixing to avoid accidental misuse or future misconfiguration.

An attacker needs network access to the running tinacms dev server and the ability to send HTTP requests to its media endpoints. No additional authentication or CMS-level permissions may be required, depending on the project's configuration.

The safest approach is to treat all path segments from HTTP requests as untrusted, normalize the path, and enforce that the resolved path is strictly within a predefined media root directory. Any request that attempts to escape this directory should be rejected before touching the filesystem.

Use central helpers for file path handling that encapsulate normalization and directory boundary checks, avoid building file paths directly from user input, restrict development servers to trusted networks, and include security-focused code reviews or automated scans that flag unvalidated filesystem access patterns.

Find out what's already
exploitable in your codebase.