GHSA-c4gh-rv8h-q9vw: Prompty: Arbitrary code execution via JavaScript frontmatter in TypeScript loader
Summary
The 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.
Affected package
- npm @prompty/core v2 prerelease line: >= 2.0.0-alpha.1 < 2.0.0-beta.3
- Fixed in @prompty/core@2.0.0-beta.3
The 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.
Impact
Applications 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.
Remediation
Upgrade @prompty/core to 2.0.0-beta.3 or later.
The 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.
Fix details
Fixed by commit c27402da2487075be577f06aa79df627fb9d6853 and released via typescript/2.0.0-beta.3.
Details
Original advisory: https://github.com/advisories/GHSA-c4gh-rv8h-q9vw
Exploitation outlook
EPSS (FIRST.org) estimates each CVE’s probability of exploitation in the next 30 days — here is the CSIRTS.com read on those numbers.
- Low exploitation riskCVE-2026-535970.93% 30-day exploitation probability — currently an unlikely target, but scores change as exploit code circulates. Riskier than 57% of all scored CVEs.
Referenced CVEs
| CVE | CSIRTS overview | External |
|---|---|---|
| CVE-2026-53597 | coverage & exploitation status | NVD · CVE.org |
Same CVEs, other sources
How other CERTs, PSIRTs and databases cover the vulnerabilities in this advisory.
More from GitHub Security Advisories
- mediumGHSA-jr6p-8pjj-mfx6: Capsule has an incomplete fix of CVE-2026-22872: TenantResource RawItems and Generators s…2026-07-31
- mediumGHSA-68cj-mvg9-rgm2: Capsule: CapsuleConfiguration NodeMetadata regex fields lack webhook validation, allowing…2026-07-31
- mediumGHSA-ff84-5f28-78qj: re2: Out-of-bounds heap read in `exec`/`test`/`match` via attacker-influenced `lastIndex`…2026-07-31
- mediumGHSA-6hxr-mr5r-9836: re2: Global `String.prototype.match` with an empty-matchable pattern never advances → inf…2026-07-31
- mediumGHSA-x83g-979r-f5fh: Sylius Mollie Plugin has unauthenticated IDOR that leaks order token and customer PII2026-07-31