CVE-2026-53597

Prompty: Arbitrary code execution via JavaScript frontmatter in TypeScript loader

Published Jul 16, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

Prompty, a Markdown-based prompt format used by Microsoft, contained a flaw in its TypeScript loader that allows an attacker-controlled file to include a JavaScript frontmatter section. During prompt loading, the loader utilized the gray‑matter library without disabling the default JavaScript engine, resulting in the arbitrary execution of that frontmatter code. This is categorized as CWE‑94, a code injection weakness that can compromise confidentiality, integrity, and availability of the system hosting the loader.

Affected Systems

The vulnerability affects user deployments of Microsoft Prompty, specifically any use of the @prompty/core package between versions 2.0.0‑alpha.1 and 2.0.0‑beta.2 inclusive. The loader resides in runtime/typescript/packages/core/src/core/loader.ts and, during that period, did not override gray‑matter’s default handling of 'js' frontmatter, leaving the execution engine enabled.

Risk and Exploitability

The CVSS score of 8.7 indicates a high severity vulnerability. The EPSS score of less than 1% signifies a low but non-zero probability of exploitation, and the vulnerability is not listed in CISA KEV. The likely attack path involves supply of a crafted .prompty file containing malicious JavaScript in the frontmatter; when the loader processes that file, the JavaScript executes with the privileges of the running Prompty process. Successful exploitation could allow an attacker to execute arbitrary code, modify system state, or compromise data stored or accessed by the Prompty environment.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the @prompty/core package to version 2.0.0‑beta.3 or later, where JavaScript frontmatter processing is disabled.
  • If an upgrade cannot be performed immediately, apply the patch from commit c27402da2487075be577f06aa79df627fb9d6853 to disable or remove JavaScript frontmatter handling in the loader.
  • Restrict write access to .prompty files to trusted users and validate or sanitize frontmatter to reject any 'js' engine before loading.

Generated by OpenCVE AI on July 31, 2026 at 01:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-c4gh-rv8h-q9vw Prompty: Arbitrary code execution via JavaScript frontmatter in TypeScript loader
History
Type Values Removed Values Added
First Time appeared Microsoft
Microsoft prompty
Vendors & Products Microsoft
Microsoft prompty
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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.
Title Prompty: Arbitrary code execution via JavaScript frontmatter in TypeScript loader
Weaknesses CWE-94
References
Metrics cvssV4_0

{'score': 8.7, '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'}

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 18, 2026, 2:51 AM
Reserved
Jun 9, 2026, 7:39 PM
Status
Deferred
Published
Jul 16, 2026, 4:19 PM
Modified
Oct 24, 2026, 8:10 PM