Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2023-22491

HIGH 8.1EPSS 45%

gatsby-transformer-remark vulnerable to unsanitized JavaScript code injection

Also known as GHSA-7ch4-rr99-cqcw

Mitigation

  • Upgrade gatsby-transformer-remark to one of 6.3.2, 5.25.1 (or later in the same release line).

Who should check

  • Projects that depend on npm package gatsby-transformer-remark (>= 6.0.0, < 6.3.2)
  • Anyone running gatsbyjs gatsby >= 6.0.0, < 6.3.2; < 5.25.1

Vulnerability facts

Affected
gatsby-transformer-remark >= 6.0.0, < 6.3.2
Fixed in
6.3.2, 5.25.1
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, login needed
CVSS
8.1 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: Low
  • Privileges required: Low
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: None
EPSS
0.64% chance of exploitation in 30 days (percentile 45, 2026-11-26)
CWE
CWE-89, CWE-20
Published
Modified

Description

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 and fixed versions

Package / productAffectedFixedSource
npm gatsby-transformer-remark>= 6.0.0, < 6.3.26.3.2, 5.25.1osv
gatsbyjs gatsby>= 6.0.0, < 6.3.2; < 5.25.1—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2023-22491. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-22491.md
Affected: gatsby-transformer-remark >= 6.0.0, < 6.3.2
Fixed in: 6.3.2, 5.25.1

Steps:
1. Search this machine and project for gatsby-transformer-remark (npm), gatsbyjs gatsby: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2023-22491 being exploited?

There is no confirmed exploitation: CVE-2023-22491 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.64% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2023-22491?

High: CVSS 8.1 (v3.1, scored by CNA). Remote, login needed.

Which versions are affected by CVE-2023-22491?

gatsby-transformer-remark >= 6.0.0, < 6.3.2.

Is there a fix for CVE-2023-22491?

Yes. Fixed in 6.3.2, 5.25.1. Upgrade gatsby-transformer-remark to one of 6.3.2, 5.25.1 (or later in the same release line).

How do I check if I'm affected by CVE-2023-22491?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors