CVE-2026-53597: Prompty: Arbitrary code execution via JavaScript frontmatter in TypeScript loader

Published Jul 16, 2026
·
Updated

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.

Other sources

Prompty is a markdown file format (.prompty) for LLM prompts. From 2.0.0-alpha.1 until 2.0.0-beta.3, the @prompty/core TypeScript loader in runtime/typescript/packages/core/src/core/loader.ts used gray-matter without overriding executable js and javascript frontmatter engines, allowing an attacker-controlled .prompty file with ---js frontmatter to execute arbitrary JavaScript during prompt loading. This issue is fixed in version 2.0.0-beta.3.

MITRE

Affected Software

2 affected componentsFixes available
Prompty @prompty/core TypeScript loader>2.0.0-alpha.1<2.0.0-beta.3
npm/@prompty/core>=2.0.0-alpha.1<2.0.0-beta.3
2.0.0-beta.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@prompty/core to a version that resolves this vulnerability.

    Fixed in 2.0.0-beta.3
  2. Upgrade

    Upgrade @prompty/core to a version that resolves this vulnerability.

    Fixed in 2.0.0-beta.3Patch c27402da2487075be577f06aa79df627fb9d6853

Event History

Jul 16, 2026
CVE Published
via MITRE·02:54 PM
Data Sourced
via MITRE·02:54 PM
DescriptionWeakness
Data Sourced
via NVD·04:19 PM
DescriptionSeverityWeakness
Jul 17, 2026
Advisory Published
via GitHub·07:53 PM
Data Sourced
via GitHub·07:53 PM
DescriptionWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-53597?

CVE-2026-53597 has a high severity rating of 8.7 according to the CVSS score.

2

How does CVE-2026-53597 allow for arbitrary code execution?

CVE-2026-53597 allows arbitrary code execution due to the improper handling of JavaScript frontmatter blocks in the TypeScript Prompty loader.

3

What software is affected by CVE-2026-53597?

The affected software is the Prompty TypeScript loader, specifically @prompty/core from npm.

4

What type of security risk does CVE-2026-53597 represent?

CVE-2026-53597 represents a code injection risk due to executing attacker-controlled JavaScript in certain files.

5

How can I mitigate the risk associated with CVE-2026-53597?

To mitigate CVE-2026-53597, ensure to update the Prompty package to the latest version that addresses this vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203