Skip to content

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

MediumCVSS 5.4 EPSS 0.60%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: no · technical impact: total
Technology
Ubuntu

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.

Upgrade path

11 packages: 2 fixed, 8 with no fix yet.

PackageAffectedFixed inStatus
ubuntu/react(Ubuntu 16.04) = 0.9.4-3; = 1.2.0-2build1; All versions No fix listed No fix yet
ubuntu/react(Ubuntu 18.04) = 1.2.0-3; = 1.2.0-3build1; All versions No fix listed No fix yet
ubuntu/react(Ubuntu 20.04) = 1.2.0-3build2; = 1.2.1-1build1; All versions No fix listed No fix yet
ubuntu/react(Ubuntu 22.04) = 1.2.1-1build2; = 1.2.2-1; All versions No fix listed No fix yet
ubuntu/react(Ubuntu 24.04) = 1.2.2-1; = 1.2.2-1build2; All versions No fix listed No fix yet
ubuntu/react(Ubuntu 25.10) = 1.2.2-1build4; = 1.2.2-1build5; All versions No fix listed No fix yet
ubuntu/react(Ubuntu 26.04) = 1.2.2-1build5; = 1.2.2-2; = 1.2.2-2build1; = 1.2.2-2build4 +1 more No fix listed No fix yet
ubuntu/react(Ubuntu 26.10) = 1.2.2-2build4; = 1.2.2-2build5; All versions No fix listed No fix yet
gatsbyjs gatsby-transformer-remark < 5.25.1; >= 6.0.0, < 6.3.2 5.25.1, 6.3.2 Fixed
npm gatsby-transformer-remark(npm) < 5.25.1; >= 6.0.0, < 6.3.2 5.25.1, 6.3.2 Fixed
gatsbyjs gatsby = < 5.25.1; = >= 6.0.0, < 6.3.2 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
npm gatsby-transformer-remark(npm) >= 6.0.0, < 6.3.2 6.3.2
npm gatsby-transformer-remark(npm) < 5.25.1 5.25.1
gatsbyjs gatsby = >= 6.0.0, < 6.3.2 No fix listed
gatsbyjs gatsby = < 5.25.1 No fix listed
ubuntu/react(Ubuntu:22.04) All versions No fix listed
ubuntu/react(Ubuntu:24.04) All versions No fix listed
ubuntu/react(Ubuntu:26.04) All versions No fix listed
ubuntu/react(Ubuntu:26.10) All versions No fix listed
gatsbyjs gatsby-transformer-remark < 5.25.1 5.25.1
gatsbyjs gatsby-transformer-remark >= 6.0.0, < 6.3.2 6.3.2
ubuntu/react(Ubuntu:16.04) All versions No fix listed
ubuntu/react(Ubuntu:16.04) = 0.9.4-3 No fix listed
ubuntu/react(Ubuntu:16.04) = 1.2.0-2build1 No fix listed
ubuntu/react(Ubuntu:18.04) All versions No fix listed
ubuntu/react(Ubuntu:18.04) = 1.2.0-3 No fix listed
ubuntu/react(Ubuntu:18.04) = 1.2.0-3build1 No fix listed
ubuntu/react(Ubuntu:20.04) All versions No fix listed
ubuntu/react(Ubuntu:20.04) = 1.2.0-3build2 No fix listed
ubuntu/react(Ubuntu:20.04) = 1.2.1-1build1 No fix listed
ubuntu/react(Ubuntu:22.04) = 1.2.1-1build2 No fix listed
ubuntu/react(Ubuntu:22.04) = 1.2.2-1 No fix listed
ubuntu/react(Ubuntu:24.04) = 1.2.2-1 No fix listed
ubuntu/react(Ubuntu:24.04) = 1.2.2-1build2 No fix listed
ubuntu/react(Ubuntu:25.10) All versions No fix listed
ubuntu/react(Ubuntu:25.10) = 1.2.2-1build4 No fix listed
Show 7 more
ProductAffected versionsFixed in
ubuntu/react(Ubuntu:25.10) = 1.2.2-1build5 No fix listed
ubuntu/react(Ubuntu:26.10) = 1.2.2-2build4 No fix listed
ubuntu/react(Ubuntu:26.10) = 1.2.2-2build5 No fix listed
ubuntu/react(Ubuntu:26.04) = 1.2.2-1build5 No fix listed
ubuntu/react(Ubuntu:26.04) = 1.2.2-2 No fix listed
ubuntu/react(Ubuntu:26.04) = 1.2.2-2build1 No fix listed
ubuntu/react(Ubuntu:26.04) = 1.2.2-2build4 No fix listed

References