@tinacms/graphql has Path Traversal that leads to overwrite of arbitrary files
Summary
A Path Traversal vulnerability in @tinacms/graphql allows unauthenticated users to write and overwrite arbitrary files within the project root. This is achieved by manipulating the relativePath parameter in GraphQL mutations. The impact includes the ability to replace critical server configuration files and potentially execute arbitrary commands by sabotaging build scripts.
Details
The vulnerability exists in the path validation logic within @tinacms/graphql. Specifically, the regex-based validation in getValidatedPath fails to recognize backslashes (\) as directory separators on non-Windows platforms (Mac/Linux). An attacker can provide a path like x\..\..\..\package.json, which bypasses the validation check but is subsequently treated as a traversal path during file I/O operations by the underlying fs modules and path normalization utilities.
Incriminated code areas:
- packages/@tinacms/graphql/src/database/bridge/filesystem.ts: assertWithinBase function.
- packages/@tinacms/graphql/src/resolver/index.ts:
getValidatedPathfunction.
PoC
- Start the TinaCMS development server.
- Send a malicious GraphQL mutation to overwrite a project file (e.g., package.json):
curl -X POST http://localhost:4001/graphql \
-H "Content-Type: application/json" \
-d '{"query": "mutation { updateDocument(collection: \"global\", relativePath: \"x\\\\..\\\\..\\\\..\\\\package.json\", params: { global: { header: { name: \"OVERWRITTEN\" } } }) { __typename } }"}'
- Observe that the root package.json has been replaced with the provided payload.
Impact
This is an Arbitrary File Write vulnerability. Any unauthenticated user with network access to the GraphQL API can:
- Overwrite critical server configuration files (e.g., package.json, tsconfig.json).
- Host malicious scripts in the
public/directory for client-side attacks. - Perform Arbitrary Code Execution by modifying build scripts or server-side logic files that are subsequently executed by the environment.
Weaknesses:
- CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
- CWE-73: External Control of File Name or Path
Czego dotyczy
Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.
| Platforma | Paczka | Podatne wersje | Poprawka w wersji |
|---|---|---|---|
| Paczka npm | @tinacms/graphql | < 2.2.2 | 2.2.2 |
Odnośniki
- Wektor CVSS
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H- Słabość (CWE)
CWE-22, CWE-73- Platforma
- npm
- Paczka
@tinacms/graphql- Ujawniono
- 30.03.2026
- Aktualizacja
- 11.10.2026 10:22
Źródła i licencje
OSV / GitHub Advisory Database - GHSA-v9p7-gf3q-h779 - CC BY 4.0
Historia podatności: @tinacms/graphql
Wszystkie opisane podatności tej paczki (Paczka npm), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.
- Wszystkich wpisów
- 5
- Pierwsza → ostatnia
- 12.2025 04.2026
- Bez poprawki
- 0
- Wykorzystywana w atakach
- 0
Rozkład istotności
- Wysoka 4
- Średnia 1
Ujawnienia w latach
- 2025: 1
- 2026: 4
-
@tinacms/graphql has Path Traversal that leads to overwrite of arbitrary files ten wpis
Dowiedz się, które podatności dotyczą Twojej aplikacji
Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.