High

Prompty: Arbitrary code execution via JavaScript frontmatter in TypeScript loader

  • Disclosed: 17.07.2026
  • Updated: 11.10.2026 10:22

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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package @prompty/core >= 2.0.0-alpha.1, < 2.0.0-beta.3 2.0.0-beta.3

References

CVSS score -
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Weakness (CWE)
CWE-94
Platform
npm
Package
@prompty/core
Disclosed
17.07.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-c4gh-rv8h-q9vw - CC BY 4.0

Vulnerability history: @prompty/core

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
3
First → latest
07.2026 07.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 1
  • High 2

Disclosures per year

  1. 2026: 3
  1. Critical · 10.0 CVE-2026-73299 < 0.1.5, >= 2.0.0-alpha.1, < 2.0.0-beta.5 0.1.5, 2.0.0-beta.5
  2. Prompty: Arbitrary code execution via JavaScript frontmatter in TypeScript loader this entry
    High CVE-2026-53597 >= 2.0.0-alpha.1, < 2.0.0-beta.3 2.0.0-beta.3
  3. High · 7.5 CVE-2026-53598 < 2.0.0-beta.2 2.0.0-beta.2

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.