---
id: CVE-2023-22491
title: >-
  Gatsby is a free and open source framework based on React that helps
  developers build websites and apps
summary: >-
  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…
severity: high
cvss: 8.1
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N'
cwe:
  - CWE-20
  - CWE-89
  - CWE-79
vendor: gatsbyjs
product: gatsby-transformer-remark
affected:
  - gatsby-transformer-remark < 5.25.1
  - 'gatsby-transformer-remark >= 6.0.0, < 6.3.2'
patched:
  - gatsby-transformer-remark 6.3.2
published: '2023-01-13'
updated: '2026-09-29'
sourceUpdated: '2026-09-29T15:06:00.643'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2023-22491'
references:
  - url: 'https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw'
    label: security-advisories@github.com
  - url: 'https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw'
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
tags:
  - nvd
epss: 0.00613
epssPercentile: 0.47293
ingestedAt: '2026-09-29T16:39:33.221Z'
---

## Overview

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.

## Affected

- `gatsby-transformer-remark < 5.25.1`
- `gatsby-transformer-remark >= 6.0.0, < 6.3.2`

## Remediation

Upgrade past the affected range:

- `gatsby-transformer-remark 6.3.2`
