@tinacms/graphql has a Path Traversal issue
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
-
File Creation: Create files outside the collection directory
graphqlcreateDocument( collection: "post" relativePath: "../../config/malicious.md" params: { post: { title: "malicious" } } ) -
File Move/Rename: Move existing files outside the collection
graphqlupdateDocument( collection: "post" relativePath: "existing.md" params: { relativePath: "../../stolen.md" } ) -
File Deletion: Delete files outside the collection
graphqldeleteDocument( collection: "post" relativePath: "../../important-config.md" ) -
Folder Creation: Create folders outside the collection
graphqlcreateFolder( 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:
-
Schema Validation: Created/updated content must conform to the collection's GraphQL schema. Attackers cannot write arbitrary file content—the
paramsargument is validated against the generated mutation types (e.g.,PostMutation). -
Authentication Required: Exploitation requires authenticated access with CMS editor permissions. Anonymous users cannot access GraphQL mutations.
-
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)
"
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Paquete de npm | @tinacms/graphql | < 2.1.2 | 2.1.2 |
Referencias
- Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L- Debilidad (CWE)
CWE-22- Plataforma
- npm
- Paquete
@tinacms/graphql- Publicada
- 12.03.2026
- Actualizado
- 11.10.2026 10:22
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-2238-xc5r-v9hj - CC BY 4.0
Historial de vulnerabilidades: @tinacms/graphql
Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 5
- Primera → última
- 12.2025 04.2026
- Sin corrección
- 0
- Explotada en ataques
- 0
Distribución por gravedad
- Alta 4
- Media 1
Divulgaciones por año
- 2025: 1
- 2026: 4
-
@tinacms/graphql has a Path Traversal issue esta entrada
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.