tinacms uses the gray-matter package in an insecure way allowing attackers that can control the content of the processed markdown files, e.g., blog posts, to execute arbitrary code.
The gray-matter package executes by default the code in the markdown file's front matter. tinacms does not change this behavior when process markdown file, e.g., by passing a custom engine property for js/javascript in the options object.
npx create-tina-app@latest
---js
{
"title": "Pawned" + console.log(require("fs").readFileSync("/etc/passwd").toString())
}
---
npm run devRCE: attackers can execute arbitrary JavaScript code on the server hosting tinacms.
Potential attack scenarios can be executed like this: Companies often have technical writers as contractors. These contractors produce md files, which they send over email or upload in a shared cloud folder. Developers download these files and upload them in tinacms's content folder. While this example might appear speculative or contrived, a general observation is that developers would be very surprised to find out that processing untrusted markdown files via tinacms = server-side code execution = complete machine take over. That is, tinacms users might not expect markdown files to contain anything else than data and gray-matter violates that assumption.
{
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"nvd_published_at": "2025-12-18T16:15:57Z",
"severity": "HIGH",
"github_reviewed_at": "2025-12-18T18:45:41Z"
}