@tinacms/graphql
Affected
- introduced
0, fixed2.1.2(semver)
Fixed versions
2.1.2
Fix
- Fixed version
2.1.2npm install @tinacms/[email protected]
Advisory
Also known as: CVE-2026-24125
@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
createDocument(
collection: "post"
relativePath: "../../config/malicious.md"
params: { post: { title: "malicious" } }
)
updateDocument(
collection: "post"
relativePath: "existing.md"
params: { relativePath: "../../stolen.md" }
)
deleteDocument(
collection: "post"
relativePath: "../../important-config.md"
)
createFolder(
collection: "post"
relativePath: "../../malicious-folder"
)
Impact
An authenticated user with document mutation permissions can:
Mitigating Factors
Several constraints limit the practical impact of this vulnerability:
params argument is validated against the generated mutation types (e.g., PostMutation).What This Vulnerability Does NOT Allow
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)
"Medium Basis: The source's own band: MODERATE
0, fixed 2.1.2 (semver)2.1.2
2.1.2npm install @tinacms/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0