CVE-2026-108259 in Tina
Summary
by MITRE • 10/10/2026
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.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 10/10/2026
TinaCMS is a headless content management system that provides tools for developers to integrate CMS capabilities into their applications. A significant security vulnerability was identified in versions prior to 3.0.0 of the @tinacms/cli package, specifically within its code generation logic used during preview builds. The flaw stems from how the CLI handles Git branch information when constructing API URLs and generating client-side JavaScript modules. During a build process, particularly one triggered by platforms like Vercel or GitHub Actions, the tool attempts to determine the current git branch context to configure the CMS connection correctly. It retrieves this value from environment variables such as VERCEL_GIT_COMMIT_REF or GITHUB_BRANCH, or falls back to reading directly from HEAD if those are not present.
The core technical flaw is a classic injection vulnerability resulting from improper input validation and sanitization of user-controlled data derived from git branch names. The raw string obtained from these sources is incorporated directly into an API URL without escaping special characters. Subsequently, this unescaped value is interpolated into JavaScript string literals within the generated code files located in packages/@tinacms/cli/src/next/codegen/index.ts and plugin.ts. Because git branch names can contain arbitrary characters including quotes, a malicious actor with write access to the repository or control over CI/CD pipeline variables could craft a branch name containing a closing quote character followed by malicious JavaScript expressions.
When the build process executes, it generates client modules that include these tainted string literals. Upon import of this generated module during the preview phase, the injected code is executed within the context of the build environment. This execution occurs with the privileges granted to the CI/CD runner or development server, which often have access to sensitive environment variables containing database credentials, API keys, and other secrets necessary for deployment operations. Consequently, an attacker can exploit this vector to exfiltrate these credentials by making network requests to a remote server controlled by them. Furthermore, the ability to execute arbitrary code allows for more severe impacts such as modifying build artifacts or deploying backdoors into the application source code before it is deployed to production environments.
This vulnerability aligns with CWE-94 Improper Control of Generation of Code (Code Injection) and falls under ATT&CK technique T1059 Command and Scripting Interpreter, specifically involving JavaScript execution in a CI/CD context. The impact extends beyond simple data leakage; it compromises the integrity of the software supply chain by allowing unauthorized modifications to the build output or source code artifacts. This represents a critical risk for organizations relying on TinaCMS for their content management workflows, as it undermines trust in automated deployment pipelines where branch names are often derived from user input or pull request titles that may be manipulated.
The issue has been addressed and fixed in version 3.0.0 of the @tinacms/cli package. The fix involves implementing strict sanitization measures to ensure that any values used for constructing API URLs or embedded within generated code literals are properly escaped or validated against a whitelist of allowed characters. Developers using versions prior to 3.0.0 should upgrade immediately to mitigate this risk. Additionally, organizations should audit their CI/CD configurations to restrict write access to repository branches and environment variables where possible, ensuring that branch naming conventions do not allow for the injection of special characters like quotes or backslashes into contexts where they are interpreted as code delimiters rather than literal data values.