cve.bz

CVE-2023-22491 gatsbyjs gatsby-transformer-remark: Cross-site Scripting

5.4 mediumExploit referenceEPSS 0.6%Fix available

Medium (5.4) in gatsbyjs gatsby-transformer-remark. EPSS 0.6% estimated probability of exploitation activity in the next 30 days. Fixed in gatsby-transformer-remark 5.25.1, 6.3.2.

On this page
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.

Severity

CVSS 3.1

5.4 medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
EPSS
0.6% (unchanged from 0.6% a week ago; 0.6% 30 days ago) estimated probability of exploitation activity in the next 30 days; 50th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: no · Technical impact: total, assessed 2025-03-11. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-79 Improper Neutralization of Input During Web Page Generation (Cross-site Scripting)
CWE-20 Improper Input Validation
CWE-89 Improper Neutralization of Special Elements used in an SQL Command (SQL Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

  • gatsby-transformer-remark (npm): fixed in 6.3.2, 5.25.1

Ask an AI about this CVE

Show the promptExplain CVE-2023-22491 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2023-22491?via=ask-ai-copy and https://cve.bz/cve/CVE-2023-22491?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2023-22491 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
gatsbyjs:gatsby-transformer-remarkbefore 5.25.1
gatsbyjs:gatsby-transformer-remarkfrom 6.0.0 before 6.3.2

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-7ch4-rr99-cqcwnpmgatsby-transformer-remark>=6.0.0 <6.3.26.3.2
GHSA-7ch4-rr99-cqcwnpmgatsby-transformer-remark<5.25.15.25.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Ubuntu16.04:LTS, 18.04:LTS, 20.04:LTS and 5 morereactno fix listedUBUNTU-CVE-2023-22491

From the distributions' data via OSV.dev: Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Ubuntu.

Attack patterns (CAPEC)

  • CAPEC-63 Cross-Site Scripting (XSS) Likelihood: High · Severity: Very High
  • CAPEC-85 AJAX Footprinting Likelihood: High · Severity: Low
  • CAPEC-209 XSS Using MIME Type Mismatch Severity: Medium
  • CAPEC-588 DOM-Based XSS Likelihood: High · Severity: Very High
  • CAPEC-591 Reflected XSS Likelihood: High · Severity: Very High
  • CAPEC-592 Stored XSS Likelihood: High · Severity: Very High
  • CAPEC-7 Blind SQL Injection Likelihood: High · Severity: High
  • CAPEC-66 SQL Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High
  • CAPEC-109 Object Relational Mapping Injection Likelihood: Low · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-89, CWE-20 (51).

References

Check your stackJSON