CVE-2023-22491

gatsby-transformer-remark vulnerable to unsanitized JavaScript code injection

MEDIUM
5.4
CVSS Score
Published: January 13, 2023 at 06:05 PM UTC
Updated: September 29, 2026 at 03:06 PM UTC
2 products affected across 1 vendorGatsby Transformer RemarkGatsby

Using gatsby by gatsbyjs?

Get instant alerts when new vulnerabilities affect gatsby - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.4
Exploit prediction
EPSS 0.6%
SSVC
PoC

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 `[email protected]` and `[email protected]` 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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 5.25.16.0.0 ≤ v < 6.3.2
Affected range stops below 5.25.1, so it looks safe — our inference, not a vendor statement
Affected range stops below 6.3.2, so it looks safe — our inference, not a vendor statement
Gatsby· Gatsbyjswordpress-plugin
60%
v < 5.25.1v < 6.3.2
Affected range stops below 5.25.1, so it looks safe — our inference, not a vendor statement
Affected range stops below 6.3.2, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet, and no fixed version or vendor advisory is recorded against it.

References (1)

SSVC — Action Prioritization

SSVCPoCNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
LOW
User Interaction
REQUIRED
Scope
CHANGED
Confidentiality
LOW
Integrity
LOW
Availability
NONE
Vector?

Quick Info

StatusANALYZED
CWE
CWE-20CWE-89CWE-79

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card