GHSA-C4GH-RV8H-Q9VW

Vulnerability from github – Published: 2026-07-17 19:53 – Updated: 2026-07-17 19:53
VLAI
Summary
Prompty: Arbitrary code execution via JavaScript frontmatter in TypeScript loader
Details

Summary

The 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.

Affected package

  • npm @prompty/core v2 prerelease line: >= 2.0.0-alpha.1 < 2.0.0-beta.3
  • Fixed in @prompty/core@2.0.0-beta.3

The 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.

Impact

Applications 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.

Remediation

Upgrade @prompty/core to 2.0.0-beta.3 or later.

The 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.

Fix details

Fixed by commit c27402da2487075be577f06aa79df627fb9d6853 and released via typescript/2.0.0-beta.3.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@prompty/core"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.0.0-alpha.1"
            },
            {
              "fixed": "2.0.0-beta.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-53597"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-17T19:53:34Z",
    "nvd_published_at": "2026-07-16T16:19:12Z",
    "severity": "HIGH"
  },
  "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: `\u003e= 2.0.0-alpha.1 \u003c 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`.",
  "id": "GHSA-c4gh-rv8h-q9vw",
  "modified": "2026-07-17T19:53:34Z",
  "published": "2026-07-17T19:53:34Z",
  "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"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Prompty: Arbitrary code execution via JavaScript frontmatter in TypeScript loader"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…