# CVE-2026-108259: TinaCMS CLI code injection via unescaped Git branch name

Source: https://junglewise.ai/threats/cve-2026-108259-tina-code-injection-via-unescaped-git-branch-name-in-generated  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-09. Updated: 2026-10-09  
License: CC BY 4.0 with a link back

CVE-2026-108259 · Severity: high · CVSS 8.2 · Published 2026-10-09

TinaCMS is a headless CMS that generates client code during builds. A malicious Git branch name can inject arbitrary JavaScript code into the generated client module, which executes with full build-process privileges when the consumer build imports the module. An attacker can exploit this by creating a pull request with a crafted branch name to compromise build environment variables, secrets, and deployment artifacts.

Technologies: [@tinacms/cli (npm)](https://junglewise.ai/threats/technologies/tinacms-cli). Vendors: [npm](https://junglewise.ai/threats/vendors/npm), [TinaCMS](https://junglewise.ai/threats/vendors/tinacms).

## Quick answers

**Is CVE-2026-108259 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-108259 being exploited in the wild.

**How severe is CVE-2026-108259?** High severity, with a CVSS score of 8.2, published 9 October 2026.

**Which products and versions are affected?** @tinacms/cli (npm) <= 2.7.0, SEMVER:introduced=0,fixed=3.0.0; TinaCMS @Tinacms/Cli <unknown.

**Is there a fix for CVE-2026-108259?** Yes. @tinacms/cli (npm): upgrade to 3.0.0 or later. Until then: Apply JSON.stringify() or encodeURIComponent() to all runtime values (branch name, API URL, token) before interpolating them into generated source templates. Move runtime configuration out of source templates and into a JSON config file that the generated client reads at initialization instead. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-108259 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-108259?** Check whether you run @tinacms/cli (npm) or TinaCMS @Tinacms/Cli at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @tinacms/cli (npm): upgrade to 3.0.0 or later

  ```sh
  npm install @tinacms/cli@3.0.0
  ```


Apply JSON.stringify() or encodeURIComponent() to all runtime values (branch name, API URL, token) before interpolating them into generated source templates. Move runtime configuration out of source templates and into a JSON config file that the generated client reads at initialization instead.

## Technical details

The vulnerability is a code injection flaw in @tinacms/cli's code generation pipeline. The package reads a Git branch name (from VERCEL_GIT_COMMIT_REF, GITHUB_BRANCH, or HEAD) and concatenates it unsanitized into an API URL, then interpolates that URL into a JavaScript string literal in the generated client.ts template without escaping or encoding. A branch name containing a single quote and JavaScript expression (e.g., x'+(code)+'`) closes the string literal and injects executable code that runs during build at module load time. Attack preconditions: attacker ability to create a PR/branch that triggers a build, and codegen enabled (default).

## Affected products

- TinaCMS @tinacms/cli <unknown

## Identifiers

- CVE-2026-108259
- GHSA-pwhx-cvv3-qj5c

## Timeline

- 2026-10-09: disclosed

## Related threats

- [TinaCMS CLI cross-origin CSRF in media upload](https://junglewise.ai/threats/cve-2026-63123-tinacms-cli-cross-origin-csrf-in-media-upload)
- [TinaCMS @tinacms/cli Remote Code Execution in Forestry migration](https://junglewise.ai/threats/cve-2026-54074-tinacms-tinacms-cli-remote-code-execution-in-forestry-migration)
- [TinaCMS CLI arbitrary file read via disabled Vite filesystem restriction](https://junglewise.ai/threats/cve-2026-29066-tinacms-cli-arbitrary-file-read-via-disabled-vite-filesystem)
- [TinaCMS CLI path traversal in media endpoints](https://junglewise.ai/threats/cve-2026-28793-tinacms-path-traversal-in-cli-development-server-media-endpoints)
- [TinaCMS CLI dev server CORS misconfiguration and path traversal](https://junglewise.ai/threats/cve-2026-28792-tinacms-cli-dev-server-cors-misconfiguration-and-path-traversal)
