/

CVE-2026-33949

Severity:

HIGH RISK

(8.1)

Path Traversal File Write in Tina @tinacms/graphql

CVE-2026-33949

Analyzed

Vulnerability type

Category:

Path Traversal / Arbitrary File Write

CWE:

CWE-22, CWE-73

Impact:

Arbitrary File Overwrite and Potential Command Execution

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal vulnerability in the @tinacms/graphql module allows unauthenticated users to write or overwrite arbitrary files within the project root by abusing the relativePath parameter in GraphQL mutations.

Under vulnerable configurations, an attacker can replace critical server files or sabotage build scripts, which may ultimately enable arbitrary command execution during deployment or build processes.

Affected context

This issue affects applications using Tina as a headless CMS where the @tinacms/graphql API is exposed and accepts user-supplied relativePath values for file-based content operations.

The vulnerability manifests when file write operations derive filesystem paths from client-controlled input without robust normalization and enforcement of allowed directories.

It is most relevant in environments where the project root contains build scripts, configuration files, or other sensitive assets that can influence server behavior or deployment.

Exploit preconditions

  • Attack surface: Publicly exposed @tinacms/graphql endpoint handling content mutations.
  • Required access: No authentication required; any network-accessible user can send crafted GraphQL mutations.
  • Trigger point: File creation or update mutations that take a relativePath parameter to determine the target file location.
  • Why exploitation is possible: The implementation trusts the relativePath input and does not sufficiently prevent directory traversal sequences (e.g., "..") or enforce strict confinement to intended content directories, allowing writes to arbitrary paths within the project root.

Why this happens

The underlying bug class is directory traversal combined with unsafe file write operations, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory and CWE-73: External Control of File Name or Path.

The system constructs filesystem paths for write operations directly from client-controlled relativePath values, with incomplete canonicalization and boundary checks.

Without strict validation and enforcement of an allowed base directory, attackers can escape the intended content folder and target sensitive resources under the project root, turning a content-editing feature into a generic arbitrary file writer.

Potential impact

  • Overwriting application or configuration files within the project root.
  • Injecting or modifying build scripts to execute attacker-controlled commands during build or deployment.
  • Sabotaging application behavior by corrupting templates, content schemas, or environment-related files.
  • Introducing backdoors or malicious logic into source files that are later compiled or deployed.
  • Causing denial of service by corrupting critical project assets needed for startup or runtime.

General mitigation guidance

Effective mitigation focuses on constraining file operations and distrusting client-controlled paths:

  • Rigorously normalize and canonicalize all file paths derived from user input before use.
  • Enforce a strict, server-side configured base directory for all content operations, rejecting any path that resolves outside this directory.
  • Use allowlists of permissible directories and, where practical, restrict file names or extensions to known-safe patterns.
  • Separate build and deployment scripts, configuration files, and other sensitive assets from directories exposed to content editing features.
  • Apply least-privilege filesystem permissions so the process handling GraphQL mutations cannot modify critical project or system files.

How teams detect issues like this

Organizations can detect and monitor this class of issue by:

  • Applying static analysis rules to identify file operations that concatenate or join filesystem paths with raw user input.
  • Reviewing GraphQL resolvers and API handlers for any parameters that control filenames or paths without canonicalization and boundary checks.
  • Implementing security tests or fuzzing that send traversal payloads (e.g., sequences using "../") to file-related mutations to verify enforcement of directory constraints.
  • Using centralized logging and alerting to detect unexpected writes to configuration files, build scripts, or other sensitive locations under the project root.

Sources

SourceLink
github.comgithub.com/tinacms/tinacms/security/advisories/GHSA-v9p7-gf3q-h779

Frequently asked

questions

Yes. If the @tinacms/graphql endpoint is exposed over the network, a remote attacker can exploit this issue by sending crafted GraphQL mutations without needing local access to the server.

No. The vulnerability description specifies that unauthenticated users can trigger the issue, so any network-accessible user can attempt exploitation if the endpoint is reachable.

The most robust fix is to strictly confine all file operations to a designated base directory: fully canonicalize the requested path, verify that it remains within the allowed directory tree, and reject any operation that attempts to escape that boundary. Additionally, separate sensitive project files from directories intended for user-driven content.

Treat all path-related input as untrusted; never concatenate user-supplied strings into filesystem paths without normalization and boundary checks. Combine this with strong code review practices for file I/O, automated checks that flag external control of file paths, and architectural decisions that isolate content-editing features from critical configuration and build logic.

Find out what's already
exploitable in your codebase.