{"id":"CVE-2023-22491","published":"2023-01-13T18:05:00Z","modified":"2025-03-11T13:34:01Z","title":"gatsby-transformer-remark vulnerable to unsanitized JavaScript code injection","vendor":"gatsbyjs","product":"gatsby","tier":"tail","description":{"text":"Gatsby is a free and open source framework based on React that helps developers build websites and apps. The gatsby-transformer-remark plugin prior to versions 5.25.1 and 6.3.2 passes input through to the `gray-matter` npm package, which is vulnerable to JavaScript injection in its default configuration, unless input is sanitized.  The vulnerability is present in gatsby-transformer-remark when passing input in data mode (querying MarkdownRemark nodes via GraphQL).  Injected JavaScript executes in the context of the build server. To exploit this vulnerability untrusted/unsanitized input would need to be sourced by or added into a file processed by gatsby-transformer-remark. A patch has been introduced in `gatsby-transformer-remark@5.25.1` and `gatsby-transformer-remark@6.3.2` which mitigates the issue by disabling the `gray-matter` JavaScript Frontmatter engine. As a workaround, if an older version of `gatsby-transformer-remark` must be used, input passed into the plugin should be sanitized ahead of processing. It is encouraged for  projects to upgrade to the latest major release branch for all Gatsby plugins to ensure the latest security updates and bug fixes are received in a timely manner.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.1,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00605,"percentile":0.49912,"provenance":"source"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"},{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw","tags":["x_refsource_CONFIRM"]}],"priority":{"score":15.7,"factors":[{"name":"EPSS percentile","points":9.98},{"name":"CVSS severity","points":5.67}]},"vendorSlug":"gatsbyjs","affectedVersions":[{"vendor":"gatsbyjs","product":"gatsby","versions":[">= 6.0.0, < 6.3.2","< 5.25.1"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2025-03-11T13:33:35.839405Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"gatsby-transformer-remark","vulnerableRanges":[">=6.0.0, <6.3.2","<5.25.1"],"patched":["6.3.2","5.25.1"],"from":["GHSA-7ch4-rr99-cqcw"],"provenance":"source"}],"summary":{"text":"The gatsby-transformer-remark plugin for the Gatsby framework, prior to versions 5.25.1 and 6.3.2, passes input through to the gray-matter npm package, which allows JavaScript injection in its default configuration when input is not sanitized, and the flaw is reachable when that input is queried in data mode via GraphQL on MarkdownRemark nodes. An attacker who can get untrusted input into a file processed by the plugin, with low privileges required and no user interaction, can have injected JavaScript execute in the context of the build server, affecting confidentiality and integrity.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:26:04Z"},"euvd":{"id":"EUVD-2023-0381","exploited":false,"provenance":"source"}}