GHSA-529f-9qwm-9628

Suggest an improvement
Source
https://github.com/advisories/GHSA-529f-9qwm-9628
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/12/GHSA-529f-9qwm-9628/GHSA-529f-9qwm-9628.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-529f-9qwm-9628
Aliases
Published
2025-12-18T18:45:41Z
Modified
2025-12-18T21:26:19.876044Z
Severity
  • 7.3 (High) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P CVSS Calculator
Summary
tinacms is vulnerable to arbitrary code execution
Details

Summary

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.

Details

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.

PoC

  1. Create a tinacms app using the cli/documentation:
    npx create-tina-app@latest
    
  2. Modify one of the blog posts to contain the following front matter:
    ---js
    {
      "title": "Pawned" + console.log(require("fs").readFileSync("/etc/passwd").toString())
    }
    ---
    
  3. Start the tinacms server, e.g., with npm run dev
  4. Observe the console of the server printing the password file, showing that attackers can execute arbitrary commands.

Impact

RCE: attackers can execute arbitrary JavaScript code on the server hosting tinacms.

Feasibility

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.

Database specific
{
    "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"
}
References

Affected packages

npm / tinacms

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.1.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/12/GHSA-529f-9qwm-9628/GHSA-529f-9qwm-9628.json"

npm / @tinacms/cli

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.0.4

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/12/GHSA-529f-9qwm-9628/GHSA-529f-9qwm-9628.json"

npm / @tinacms/graphql

Package

Name
@tinacms/graphql
View open source insights on deps.dev
Purl
pkg:npm/%40tinacms/graphql

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.0.3

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/12/GHSA-529f-9qwm-9628/GHSA-529f-9qwm-9628.json"