{"id":"CVE-2026-53597","aliases":["GHSA-c4gh-rv8h-q9vw"],"url":"https://o3.security/vulnerability/CVE-2026-53597","summary":"Prompty: Arbitrary code execution via JavaScript frontmatter in TypeScript loader","details":"## Summary\nThe TypeScript Prompty loader used `gray-matter` without overriding executable frontmatter engines. `gray-matter` supports JavaScript frontmatter blocks such as `---js` and evaluates them while parsing. An attacker-controlled `.prompty` file could therefore execute arbitrary JavaScript during prompt loading.\n\n## Affected package\n- npm `@prompty/core` v2 prerelease line: `>= 2.0.0-alpha.1 < 2.0.0-beta.3`\n- Fixed in `@prompty/core@2.0.0-beta.3`\n\nThe legacy v1 JavaScript runtime had a historical hardening change for this issue. During the v2 TypeScript runtime rebuild, the loader again called `gray-matter` directly and the vulnerable behavior was present in the v2 prerelease packages until `2.0.0-beta.3`.\n\n## Impact\nApplications that load untrusted `.prompty` files, user-provided prompt paths, or prompt bundles from less-trusted locations could execute arbitrary JavaScript in the host Node.js process during frontmatter parsing.\n\n## Remediation\nUpgrade `@prompty/core` to `2.0.0-beta.3` or later.\n\nThe fix explicitly overrides the `js` and `javascript` gray-matter engines and rejects JavaScript frontmatter in `.prompty` files. Prompty frontmatter is YAML-only; executable frontmatter is unsupported. A regression test now verifies that `---js` frontmatter is rejected and not evaluated.\n\n## Fix details\nFixed by commit `c27402da2487075be577f06aa79df627fb9d6853` and released via `typescript/2.0.0-beta.3`.","published":"2026-07-16T14:54:55.075Z","modified":"2026-08-12T03:51:22.518401893Z","cvss":null,"epss":{"score":0.00972,"percentile":0.60302,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"@prompty/core","fixedVersion":"2.0.0-beta.3"}],"fix":{"url":"https://github.com/microsoft/prompty/commit/c27402da2487075be577f06aa79df627fb9d6853","label":"microsoft/prompty@c27402d"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/53xxx/CVE-2026-53597.json"},{"type":"ADVISORY","url":"https://github.com/microsoft/prompty/security/advisories/GHSA-c4gh-rv8h-q9vw"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53597"},{"type":"FIX","url":"https://github.com/microsoft/prompty/commit/c27402da2487075be577f06aa79df627fb9d6853"},{"type":"PACKAGE","url":"https://github.com/microsoft/prompty"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:22.518401893Z"}}