CVE-2026-34603: @tinacms/graphql @tinacms/graphql's Media Endpoints Can Escape Vulnerability

HIGH
Advisory Identifier: GHSA-g87c-r2jp-293w
CVSS 7.1
CWE-59 CWE-22
Published
Advisory Summary

CVE-2026-34603 is a HIGH (CVSS 7.1) @tinacms/graphql's media endpoints can escape vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting @tinacms/graphql libraries in the npm ecosystem. The issue involves @tinacms/graphql's media endpoints can escape the media root via symlinks or junctions. Remediation is available by upgrading affected packages to version 2.2.2.

CVE-2026-34603 at a Glance

CVE Identifier CVE-2026-34603
GHSA Identifier GHSA-g87c-r2jp-293w
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-59: Improper Link Resolution Before File Access ('Link Following')
Affected Product @tinacms/graphql
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2026-34603

To remediate this vulnerability, upgrade all affected @tinacms/graphql dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@tinacms/graphql fixed: 2.2.2
npm install @tinacms/graphql@2.2.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @tinacms/graphql

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-34603, inspect your project dependencies using npm:

npm ls @tinacms/graphql

Analyze the terminal output to locate any version of @tinacms/graphql in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.2), your application is affected.

Note: The npm ls @tinacms/graphql command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In @tinacms/graphql, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary `@tinacms/cli` recently added lexical path-traversal checks to the dev media routes, but the implementation still validates only the path string and does not resolve symlink or junction targets. If a link already exists under the media root, Tina accepts a path like `pivot/written-from-media.txt` as "inside" the media directory and then performs real filesystem operations through that link target. This allows out-of-root media listing and write access, and the same root cause also affects delete. ## Details The dev media handlers validate user-controlled paths with: ```ts function resolveWithinBase(userPath: string, baseDir: string): string { const resolvedBase = path.resolve(baseDir); const resolved = path.resolve(path.join(baseDir, userPath)); if (resolved === resolvedBase) { return resolvedBase; } if (resolved.startsWith(resolvedBase + path.sep)) { return resolved; } throw new PathTraversalError(userPath); } function resolveStrictlyWithinBase(userPath: string, baseDir: string): string { const resolvedBase = path.resolve(baseDir) + path.sep; const resolved = path.resolve(path.join(baseDir, userPath)); if (!resolved.startsWith(resolvedBase)) { throw new PathTraversalError(userPath); } return resolved; } ``` But the validated path is then used directly for real filesystem access: ```ts filesStr = await fs.readdir(validatedPath); ... await fs.ensureDir(path.dirname(saveTo)); file.pipe(fs.createWriteStream(saveTo)); ... await fs.remove(file); ``` This does not account for symlinks/junctions already present below the media root. A path such as `pivot/secret.txt` can be lexically inside the media directory while the filesystem target is outside it. ## Local Reproduction I verified this locally with a real junction on Windows. Test layout: - media root: `D:\bugcrowd\tinacms\temp\junction-repro4\public\uploads` - junction under media root: `public\uploads\pivot -> D:\bugcrowd\tinacms\temp\junction-repro4\outside` - file outside the media root: `outside\secret.txt` Tina's current media-path validation logic was applied and used to perform the same list/write operations the route handlers use. Observed result: ```json { "media": { "base": "D:\\bugcrowd\\tinacms\\temp\\junction-repro4\\public\\uploads", "resolvedListPath": "D:\\bugcrowd\\tinacms\\temp\\junction-repro4\\public\\uploads\\pivot", "listedEntries": [ "secret.txt" ], "resolvedWritePath": "D:\\bugcrowd\\tinacms\\temp\\junction-repro4\\public\\uploads\\pivot\\written-from-media.txt", "outsideWriteExists": true, "outsideWriteContents": "MEDIA_ESCAPE" } } ``` This shows the problem clearly: - the path validator accepted `pivot` - listing revealed a file from outside the media root - writing to `pivot/written-from-media.txt` created `outside\written-from-media.txt` The delete path uses the same flawed containment model and should be hardened at the same time. ## Impact - **Out-of-root file listing** via `/media/list/...` - **Out-of-root file write** via `/media/upload/...` - **Likely out-of-root file delete** via `/media/...` `DELETE`, using the same path-validation gap - **Bypass of the recent path traversal hardening** for any deployment whose media tree contains a link to another location This is especially relevant in development and self-hosted workflows where the media directory may contain symlinks or junctions intentionally or via repository content. ## Recommended Fix Harden media path validation with canonical filesystem checks: 1. resolve the real base path with `fs.realpath()` 2. resolve the real target path, or for writes the nearest existing parent 3. compare canonical paths rather than lexical strings 4. reject any operation that traverses through a symlink/junction to leave the real media root `path.resolve(...).startsWith(...)` is not sufficient for filesystem security on linked paths. ## Resources - `packages/@tinacms/cli/src/next/commands/dev-command/server/media.ts` - `packages/@tinacms/cli/src/server/models/media.ts` - `packages/@tinacms/cli/src/utils/path.ts`

CVE-2026-34603 Affected @tinacms/graphql Versions

1 component(s)
Fixed Versions:
2.2.2
Product / Package Ecosystem Affected Versions Fixed Version
@tinacms/graphql
npm
< 2.2.2
2.2.2

References

Frequently Asked Questions

What is CVE-2026-34603?
CVE-2026-34603 is a security vulnerability in @tinacms/graphql involving @tinacms/graphql's Media Endpoints Can Escape the Media Root via Symlinks or Junctions under CWE-59: Improper Link Resolution Before File Access ('Link Following').
Which @tinacms/graphql versions are affected?
Affected versions include releases prior to 2.2.2 across affected packages: @tinacms/graphql.
What version fixes CVE-2026-34603?
Upgrading to 2.2.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @tinacms/graphql affected?
Yes, @tinacms/graphql is affected in releases prior to 2.2.2. Upgrade your dependency to 2.2.2 or later.
What is the CVSS score of CVE-2026-34603?
CVE-2026-34603 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2026-34603?
CVE-2026-34603 is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following') (The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.).
How can I check npm dependencies for CVE-2026-34603?
Run the dependency tree command: 'npm ls @tinacms/graphql'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g87c-r2jp-293w",
  "modified" : "2026-04-06T16:44:07Z",
  "published" : "2026-04-01T00:23:02Z",
  "aliases" : [ "CVE-2026-34603" ],
  "summary" : "@tinacms/graphql's Media Endpoints Can Escape the Media Root via Symlinks or Junctions",
  "details" : "## Summary\n\n`@tinacms/cli` recently added lexical path-traversal checks to the dev media routes, but the implementation still validates only the path string and does not resolve symlink or junction targets.\n\nIf a link already exists under the media root, Tina accepts a path like `pivot/written-from-media.txt` as \"inside\" the media directory and then performs real filesystem operations through that link target. This allows out-of-root media listing and write access, and the same root cause also affects delete.\n\n## Details\n\nThe dev media handlers validate user-controlled paths with:\n\n```ts\nfunction resolveWithinBase(userPath: string, baseDir: string): string {\n  const resolvedBase = path.resolve(baseDir);\n  const resolved = path.resolve(path.join(baseDir, userPath));\n  if (resolved === resolvedBase) {\n    return resolvedBase;\n  }\n  if (resolved.startsWith(resolvedBase + path.sep)) {\n    return resolved;\n  }\n  throw new PathTraversalError(userPath);\n}\n\nfunction resolveStrictlyWithinBase(userPath: string, baseDir: string): string {\n  const resolvedBase = path.resolve(baseDir) + path.sep;\n  const resolved = path.resolve(path.join(baseDir, userPath));\n  if (!resolved.startsWith(resolvedBase)) {\n    throw new PathTraversalError(userPath);\n  }\n  return resolved;\n}\n```\n\nBut the validated path is then used directly for real filesystem access:\n\n```ts\nfilesStr = await fs.readdir(validatedPath);\n...\nawait fs.ensureDir(path.dirname(saveTo));\nfile.pipe(fs.createWriteStream(saveTo));\n...\nawait fs.remove(file);\n```\n\nThis does not account for symlinks/junctions already present below the media root. A path such as `pivot/secret.txt` can be lexically inside the media directory while the filesystem target is outside it.\n\n## Local Reproduction\n\nI verified this locally with a real junction on Windows.\n\nTest layout:\n\n- media root: `D:\\bugcrowd\\tinacms\\temp\\junction-repro4\\public\\uploads`\n- junction under media root: `public\\uploads\\pivot -> D:\\bugcrowd\\tinacms\\temp\\junction-repro4\\outside`\n- file outside the media root: `outside\\secret.txt`\n\nTina's current media-path validation logic was applied and used to perform the same list/write operations the route handlers use.\n\nObserved result:\n\n```json\n{\n  \"media\": {\n    \"base\": \"D:\\\\bugcrowd\\\\tinacms\\\\temp\\\\junction-repro4\\\\public\\\\uploads\",\n    \"resolvedListPath\": \"D:\\\\bugcrowd\\\\tinacms\\\\temp\\\\junction-repro4\\\\public\\\\uploads\\\\pivot\",\n    \"listedEntries\": [\n      \"secret.txt\"\n    ],\n    \"resolvedWritePath\": \"D:\\\\bugcrowd\\\\tinacms\\\\temp\\\\junction-repro4\\\\public\\\\uploads\\\\pivot\\\\written-from-media.txt\",\n    \"outsideWriteExists\": true,\n    \"outsideWriteContents\": \"MEDIA_ESCAPE\"\n  }\n}\n```\n\nThis shows the problem clearly:\n\n- the path validator accepted `pivot`\n- listing revealed a file from outside the media root\n- writing to `pivot/written-from-media.txt` created `outside\\written-from-media.txt`\n\nThe delete path uses the same flawed containment model and should be hardened at the same time.\n\n## Impact\n\n- **Out-of-root file listing** via `/media/list/...`\n- **Out-of-root file write** via `/media/upload/...`\n- **Likely out-of-root file delete** via `/media/...` `DELETE`, using the same path-validation gap\n- **Bypass of the recent path traversal hardening** for any deployment whose media tree contains a link to another location\n\nThis is especially relevant in development and self-hosted workflows where the media directory may contain symlinks or junctions intentionally or via repository content.\n\n## Recommended Fix\n\nHarden media path validation with canonical filesystem checks:\n\n1. resolve the real base path with `fs.realpath()`\n2. resolve the real target path, or for writes the nearest existing parent\n3. compare canonical paths rather than lexical strings\n4. reject any operation that traverses through a symlink/junction to leave the real media root\n\n`path.resolve(...).startsWith(...)` is not sufficient for filesystem security on linked paths.\n\n## Resources\n\n- `packages/@tinacms/cli/src/next/commands/dev-command/server/media.ts`\n- `packages/@tinacms/cli/src/server/models/media.ts`\n- `packages/@tinacms/cli/src/utils/path.ts`",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@tinacms/graphql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.2.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/tinacms/tinacms/security/advisories/GHSA-g87c-r2jp-293w"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34603"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tinacms/tinacms/commit/f124eabaca10dac9a4d765c9e4135813c4830955"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tinacms/tinacms"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-59" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-01T00:23:02Z",
    "nvd_published_at" : "2026-04-01T17:28:41Z"
  }
}