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.
Published: 2026-07-16
Score: 8.7 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

Thu, 30 Jul 2026 20:45:00 +0000

Type Values Removed Values Added
First Time appeared Microsoft
Microsoft prompty
Vendors & Products Microsoft
Microsoft prompty

Sat, 18 Jul 2026 03:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Thu, 16 Jul 2026 15:30:00 +0000

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'}


Subscriptions

Microsoft Prompty
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-18T02:51:03.900Z

Reserved: 2026-06-09T19:39:52.404Z

Link: CVE-2026-53597

cve-icon Vulnrichment

Updated: 2026-07-18T02:50:59.228Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T02:00:05Z

Weaknesses
  • CWE-94

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