Mittel

@tinacms/graphql has a Path Traversal issue

  • Veröffentlicht: 12.03.2026
  • Aktualisiert: 11.10.2026 10:22

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

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

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

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

    graphql
    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:

bash
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)
"

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
npm-Paket @tinacms/graphql < 2.1.2 2.1.2

Verweise

CVSS-Wert 6.3/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Schwäche (CWE)
CWE-22
Plattform
npm
Paket
@tinacms/graphql
Veröffentlicht
12.03.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-2238-xc5r-v9hj - CC BY 4.0

Schwachstellenhistorie: @tinacms/graphql

Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Einträge insgesamt
5
Erste → letzte
12.2025 04.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Hoch 4
  • Mittel 1

Veröffentlichungen pro Jahr

  1. 2025: 1
  2. 2026: 4
  1. @tinacms/graphql has a Path Traversal issue dieser Eintrag
    Mittel · 6.3 CVE-2026-24125 < 2.1.2 2.1.2
  2. Hoch CVE-2025-68278 < 2.0.3 2.0.3

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.