Skip to content

@tinacms/graphql has a Path Traversal issue

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

Package

npm @tinacms/graphql (npm)

Affected versions

<= 2.1.1

Patched versions

2.1.2

Description

Description

TinaCMS allows users to create, update, and delete content documents using relative file paths (relativePath, newRelativePath) via GraphQL mutations. Under certain conditions, these paths are combined with the collection path using path.join() without validating that the resolved path remains within the collection root directory.

Because path.join() does not prevent directory traversal, paths containing ../ sequences can escape the intended directory boundary.

Attack Vectors

  1. File Creation: Create files outside the collection directory

    createDocument(
      collection: "post"
      relativePath: "../../config/malicious.md"
      params: { post: { title: "malicious" } }
    )
  2. File Move/Rename: Move existing files outside the collection

    updateDocument(
      collection: "post"
      relativePath: "existing.md"
      params: { relativePath: "../../stolen.md" }
    )
  3. File Deletion: Delete files outside the collection

    deleteDocument(
      collection: "post"
      relativePath: "../../important-config.md"
    )
  4. Folder Creation: Create folders outside the collection

    createFolder(
      collection: "post"
      relativePath: "../../malicious-folder"
    )

Impact

An authenticated user with document mutation permissions can:

  • Create content files outside collection boundaries (subject to schema validation)
  • Move or rename files outside collection boundaries
  • Delete content files outside collection boundaries
  • Read file contents via document retrieval mutations

Mitigating Factors

Several constraints limit the practical impact of this vulnerability:

  1. Schema Validation: Created/updated content must conform to the collection's GraphQL schema. Attackers cannot write arbitrary file content—the params argument is validated against the generated mutation types (e.g., PostMutation).

  2. Authentication Required: Exploitation requires authenticated access with CMS editor permissions. Anonymous users cannot access GraphQL mutations.

  3. Git Tracking: In typical deployments, all file operations are tracked in git (either via GitHub API for Tina Cloud/self-hosted with GitProvider, or local filesystem changes). Malicious changes are visible in version control and can be reverted.

What This Vulnerability Does NOT Allow

  • Writing arbitrary file content (content is schema-validated)
  • Silent/untracked file modifications (changes appear in git)
  • Unauthenticated access

Proof of Concept

See packages/@tinacms/graphql/tests/path-traversal-security/index.test.ts for automated tests demonstrating the vulnerability.

Manual reproduction:

node -e "
const path = require('path');

const collectionPath = 'content/posts';
const maliciousRelativePath = '../../OUTSIDE/poc.md';

const realPath = path.join(collectionPath, maliciousRelativePath);
console.log('Resolved path:', realPath);
// Output: OUTSIDE/poc.md (escaped content/posts)
"

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

Moderate

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
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low

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:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L

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.
(21st 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-24125

GHSA ID

GHSA-2238-xc5r-v9hj

Source code

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