Summary
Prompty: Server-Side Template Injection to Remote Code Execution in the @prompty/core Nunjucks Renderer
The TypeScript Nunjucks renderer evaluated untrusted .prompty template bodies with unrestricted JavaScript member access. An attacker-controlled template could traverse constructor and prototype properties to execute JavaScript in the host Node.js process.
Affected packages
- npm
@prompty/coreversions<= 0.1.4 - npm
@prompty/coreversions<= 2.0.0-beta.4
Fix details
The fix is merged in PR #404 and includes regression coverage for default Nunjucks rendering, explicit renderer usage, unsafe member lookups, and attempted template function calls.
Impact
Applications that render untrusted, community-supplied, cloned, or LLM-generated .prompty files with the TypeScript runtime could allow attacker-controlled code execution with the privileges of the Node.js host process.
Untrusted input is evaluated as executable code within the application's runtime environment. Typical impact: arbitrary code execution within the application's privilege context.
GHSA-W28W-GP39-M4P6 has a CVSS score of 10.0 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.1.5, 2.0.0-beta.5); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Upgrade to @prompty/core 2.0.0-beta.5 or later. The patched renderer sanitizes render inputs to own-data-only values, rejects constructor/prototype member traversal, and disallows template function calls. Ordinary interpolation, conditionals, loops, and own nested data properties remain supported.
Frequently Asked Questions
- What is GHSA-W28W-GP39-M4P6? GHSA-W28W-GP39-M4P6 is a critical-severity code injection vulnerability in @prompty/core (npm), affecting versions <= 0.1.4. It is fixed in 0.1.5, 2.0.0-beta.5. Untrusted input is evaluated as executable code within the application's runtime environment.
- How severe is GHSA-W28W-GP39-M4P6? GHSA-W28W-GP39-M4P6 has a CVSS score of 10.0 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of @prompty/core are affected by GHSA-W28W-GP39-M4P6? @prompty/core (npm) versions <= 0.1.4 is affected.
- Is there a fix for GHSA-W28W-GP39-M4P6? Yes. GHSA-W28W-GP39-M4P6 is fixed in 0.1.5, 2.0.0-beta.5. Upgrade to this version or later.
- Is GHSA-W28W-GP39-M4P6 exploitable, and should I be worried? Whether GHSA-W28W-GP39-M4P6 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-W28W-GP39-M4P6 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-W28W-GP39-M4P6?
- Upgrade
@prompty/coreto 0.1.5 or later - Upgrade
@prompty/coreto 2.0.0-beta.5 or later
- Upgrade