Listen to this Post
CVE-2026-108259 is a critical code injection vulnerability affecting `@tinacms/cli` versions prior to 3.0.0.
The vulnerability originates from how the command-line interface handles Git branch names during client code generation.
Specifically, during preview builds on platforms like Vercel or GitHub Actions, the tool reads environmental variables.
These variables include VERCEL_GIT_COMMIT_REF, GITHUB_BRANCH, or `HEAD` to determine the active Git branch.
The extracted raw string value of the branch name is directly incorporated into the internal API URL builder.
In packages/@tinacms/cli/src/next/codegen/index.ts, the `_createApiUrl()` function concatenates this raw branch.
Crucially, no sanitization, encoding, or escaping functions such as `encodeURIComponent()` or `JSON.stringify()` are applied.
When the generator builds the client source code via genClient(), it interpolates the URL directly into string literals.
The template string utilizes single quotes, such as url: '${apiURL}', without validating or escaping special characters.
Because Git allows various characters in branch naming conventions, an attacker can craft a malicious branch name.
A Git-valid branch name can contain a single quote character to prematurely terminate the enclosing JavaScript string literal.
Following the single quote, the attacker appends arbitrary JavaScript expressions using addition operators to maintain syntax validity.
When the consumer project runs its build process, the CLI executes codegen and outputs the tainted `client.ts` file.
When this generated client module is subsequently imported or evaluated, the injected JavaScript code executes immediately.
This execution happens entirely within the context of the build server or local machine running the npm build process.
Because build servers typically possess elevated privileges, this flaw leads directly to remote code execution.
Attackers can leverage pull request mechanisms in open-source repositories to automatically trigger preview deployments.
When the CI/CD pipeline processes the pull request branch, the malicious payload is synthesized and executed.
This systemic oversight in template generation highlights the extreme dangers of unescaped environmental inputs in codegen.
Developers utilizing automated build tools must ensure all dynamic CI references are strictly sanitized before interpolation.
Failing to sanitize build-time inputs allows untrusted repository contributors to compromise entire software supply chains.
The vulnerability affects all package versions below 3.0.0 and requires immediate remediation by upgrading the package.
DailyCVE Form:
Platform: TinaCMS CLI
Version: Before 3.0.0
Vulnerability: Code Injection
Severity: High
date: October 2026
Prediction: Patched October 2026
(end of form)
What Undercode Say
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
import { transform } from 'esbuild';
import vm from 'vm';
const branch = "x'+(globalThis.__TINA_PROBE='hit')+'";
const apiURL = <code>https://content.tinajs.io/2.4/content/my-client/github/${branch}`;
console.log(apiURL);
<h2 class=”f1b-anim” style=”color:#3b82f6;border-left:4px solid #3b82f6;padding-left:12px;margin:22px 0 10px 0;font-weight:bold”>Exploit: (Educational Purposes!)</h2>
git branch "x'+(process.mainModule.require('child_process').execSync('id'))+'"
An attacker creates a pull request using a specially crafted branch name containing single quotes and JavaScript code. When Vercel or GitHub Actions triggers the preview build, `@tinacms/cli` readsVERCEL_GIT_COMMIT_REF, embeds the raw branch intoclient.ts, and triggers arbitrary code execution during build evaluation.encodeURIComponent
<h2 class="f1b-anim" style="color:#3b82f6;border-left:4px solid #3b82f6;padding-left:12px;margin:22px 0 10px 0;font-weight:bold">Protection: from this CVE</h2>
<h2 class="f1b-anim" style="color:#3b82f6;border-left:4px solid #3b82f6;padding-left:12px;margin:22px 0 10px 0;font-weight:bold">Upgrade `@tinacms/cli` to version 3.0.0 or later immediately.</h2>
Ensure strict sanitization and encoding () of all CI environmental branch references before string interpolation.process.env`), NPM tokens, and cloud provider credentials.
Restrict automated preview builds on public pull requests from untrusted forks.
<h2 class="f1b-anim" style="color:#3b82f6;border-left:4px solid #3b82f6;padding-left:12px;margin:22px 0 10px 0;font-weight:bold">Impact:</h2>
<h2 class="f1b-anim" style="color:#3b82f6;border-left:4px solid #3b82f6;padding-left:12px;margin:22px 0 10px 0;font-weight:bold">Full remote code execution within the build environment.</h2>
Access to sensitive build secrets, environment variables (
Supply-chain compromise through tainted deployment artifacts and modified build outputs.
🎯Let’s Practice Exploiting & Learn Patching For Free:
🎓 Live Courses & Certifications:
Join Undercode Academy for Verified Certifications
🚀 Request a Custom Project:
Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands
Sources:
Reported By: github.com
Extra Source Hub:
Undercode

