GHSA-w28w-gp39-m4p6: Prompty Remote Code Execution Vulnerability

CRITICAL
CVSS 10.0
CWE-94 CWE-1336
Published
Advisory Summary

GHSA-w28w-gp39-m4p6 is a CRITICAL (CVSS 10.0) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Prompty libraries in the npm ecosystem. The issue involves server-side template injection to remote code execution in the @prompty/core nunjucks renderer. Remediation is available by upgrading affected packages to version 0.1.5, 2.0.0-beta.5.

GHSA-w28w-gp39-m4p6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-w28w-gp39-m4p6
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Prompty
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-w28w-gp39-m4p6

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.

@prompty/core fixed: 0.1.5
npm install @prompty/core@0.1.5
@prompty/core fixed: 2.0.0-beta.5
npm install @prompty/core@2.0.0-beta.5
Verify Direct and Transitive Dependencies

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 GHSA-w28w-gp39-m4p6, 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 0.1.5), 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

## Summary 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/core` versions `<= 0.1.4` - npm `@prompty/core` versions `<= 2.0.0-beta.4` ## 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. ## Remediation 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. ## 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.

GHSA-w28w-gp39-m4p6 Affected Prompty Versions

2 component(s)
Fixed Versions:
0.1.52.0.0-beta.5
Product / Package Ecosystem Affected Versions Fixed Version
@prompty/core
npm
< 0.1.5
0.1.5
@prompty/core
npm
≥ 2.0.0-alpha.1
< 2.0.0-beta.5
2.0.0-beta.5

References

Frequently Asked Questions

What is GHSA-w28w-gp39-m4p6?
GHSA-w28w-gp39-m4p6 is a security vulnerability in Prompty involving Server-Side Template Injection to Remote Code Execution in the @prompty/core Nunjucks Renderer under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Prompty versions are affected?
Affected versions include releases prior to 0.1.5, 2.0.0-beta.5 across affected packages: @prompty/core.
What version fixes GHSA-w28w-gp39-m4p6?
Upgrading to 0.1.5, 2.0.0-beta.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @prompty/core affected?
Yes, @prompty/core is affected in releases prior to 0.1.5, 2.0.0-beta.5. Upgrade your dependency to 0.1.5, 2.0.0-beta.5 or later.
What is the CVSS score of GHSA-w28w-gp39-m4p6?
GHSA-w28w-gp39-m4p6 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with GHSA-w28w-gp39-m4p6?
GHSA-w28w-gp39-m4p6 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (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.).
How can I check npm dependencies for GHSA-w28w-gp39-m4p6?
Run the dependency tree command: 'npm ls @prompty/core'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w28w-gp39-m4p6",
  "modified" : "2026-07-24T16:23:59Z",
  "published" : "2026-07-24T16:23:59Z",
  "aliases" : [ ],
  "summary" : "Prompty: Server-Side Template Injection to Remote Code Execution in the @prompty/core Nunjucks Renderer",
  "details" : "## Summary\nThe 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.\n\n## Affected packages\n- npm `@prompty/core` versions `<= 0.1.4`\n- npm `@prompty/core` versions `<= 2.0.0-beta.4`\n\n## Impact\nApplications 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.\n\n## Remediation\nUpgrade 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.\n\n## Fix details\nThe 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@prompty/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.1.4"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@prompty/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0-alpha.1"
      }, {
        "fixed" : "2.0.0-beta.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.0.0-beta.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/prompty/security/advisories/GHSA-w28w-gp39-m4p6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/prompty/pull/404"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/microsoft/prompty/commit/047756f4c8caf91c5868eeb42520c938393277b0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/microsoft/prompty"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1336", "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-24T16:23:59Z",
    "nvd_published_at" : null
  }
}