CVEfocus › CVE database › CVE-2023-22491

CVE-2023-22491gatsby-transformer-remark vulnerable to unsanitized JavaScript code injection

CVSS 8.1 HighEPSS 0.6% (higher than 45% of CVEs)Published 2023-01-13Updated 2025-03-11Assigner: GitHub_M

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.

CWE-20CWE-89

What to do

Fixed builds are available from npm: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

1Fixed
1Fix pending
3Under investigation
5Will not fix

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10reactFix pendingUBUNTU-CVE-2023-22491
Ubuntu 26.04reactUnder investigationUBUNTU-CVE-2023-22491
Ubuntu 25.10reactWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2023-22491
Ubuntu 24.04reactUnder investigationUBUNTU-CVE-2023-22491
Ubuntu 22.04reactUnder investigationUBUNTU-CVE-2023-22491
Ubuntu 20.04reactWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2023-22491
Ubuntu 18.04reactWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2023-22491
Ubuntu 16.04reactWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2023-22491
Ubuntu 14.04reactWill not fix
Ubuntu decided not to fix this in this release
npm librarygatsby-transformer-remarkFixed5.25.1GHSA-7ch4-rr99-cqcw

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.