CVE-2026-53597: Prompty Arbitrary Code Execution Vulnerability
HIGHCVE-2026-53597 is a HIGH arbitrary code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Prompty libraries in the npm ecosystem. The issue involves arbitrary code execution via javascript frontmatter in typescript loader. Remediation is available by upgrading affected packages to version 2.0.0-beta.3.
CVE-2026-53597 at a Glance
How to Fix CVE-2026-53597
To remediate this vulnerability, upgrade all affected Prompty dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @prompty/core@2.0.0-beta.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @prompty/core
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-53597, inspect your project dependencies using npm:
npm ls @prompty/core
Analyze the terminal output to locate any version of Prompty in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0-beta.3), your application is affected.
Note: The npm ls @prompty/core command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Prompty, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-53597 Affected Prompty Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@prompty/core
|
npm |
≥ 2.0.0-alpha.1
< 2.0.0-beta.3
|
2.0.0-beta.3
|
References
Frequently Asked Questions
What is CVE-2026-53597?
Which Prompty versions are affected?
What version fixes CVE-2026-53597?
Is @prompty/core affected?
What CWE is associated with CVE-2026-53597?
How can I check npm dependencies for CVE-2026-53597?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c4gh-rv8h-q9vw",
"modified" : "2026-07-17T19:53:34Z",
"published" : "2026-07-17T19:53:34Z",
"aliases" : [ "CVE-2026-53597" ],
"summary" : "Prompty: Arbitrary code execution via JavaScript frontmatter in TypeScript loader",
"details" : "## Summary\nThe 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.\n\n## Affected package\n- npm `@prompty/core` v2 prerelease line: `>= 2.0.0-alpha.1 < 2.0.0-beta.3`\n- Fixed in `@prompty/core@2.0.0-beta.3`\n\nThe 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`.\n\n## Impact\nApplications 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.\n\n## Remediation\nUpgrade `@prompty/core` to `2.0.0-beta.3` or later.\n\nThe 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.\n\n## Fix details\nFixed by commit `c27402da2487075be577f06aa79df627fb9d6853` and released via `typescript/2.0.0-beta.3`.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@prompty/core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0-alpha.1"
}, {
"fixed" : "2.0.0-beta.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/microsoft/prompty/security/advisories/GHSA-c4gh-rv8h-q9vw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-53597"
}, {
"type" : "WEB",
"url" : "https://github.com/microsoft/prompty/commit/c27402da2487075be577f06aa79df627fb9d6853"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/microsoft/prompty"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-17T19:53:34Z",
"nvd_published_at" : "2026-07-16T16:19:12Z"
}
}