gatsby-transformer-remark vulnerable to unsanitized JavaScript code injection
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- SQL injection, Cross-site scripting
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-89 and CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| gatsbyjs | gatsby | 6.0.0 to before 6.3.2; before 5.25.1 | 6.3.2, 5.25.1 | Patch available | CNA |
| — | gatsby-transformer-remark (npm) | 6.0.0 to before 6.3.2 | 6.3.2 | Patch available | GHSA-7ch4-rr99-cqcw |
| — | gatsby-transformer-remark (npm) | before 5.25.1 | 5.25.1 | Patch available | GHSA-7ch4-rr99-cqcw |
- gatsby Vendorgatsbyjs Affected 6.0.0 to before 6.3.2; before 5.25.1 Fixed in 6.3.2, 5.25.1 Patch available CNA
- gatsby-transformer-remark (npm) Vendor— Affected 6.0.0 to before 6.3.2 Fixed in 6.3.2 Patch available GHSA-7ch4-rr99-cqcw
- gatsby-transformer-remark (npm) Vendor— Affected before 5.25.1 Fixed in 5.25.1 Patch available GHSA-7ch4-rr99-cqcw
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:gatsbyjs:gatsby-transformer-remark:*:*:*:*:*:node.js:*:* | before 5.25.1; 6.0.0 to before 6.3.2 | Vulnerable | gatsbyjs |
- cpe:2.3:a:gatsbyjs:gatsby-transformer-remark:*:*:*:*:*:node.js:*:* Versions before 5.25.1; 6.0.0 to before 6.3.2 Vulnerable ·gatsbyjs
Remediation
- Fix · CNA gatsby (gatsbyjs) Fixed in 6.3.2, 5.25.1
- Fix · GHSA-7ch4-rr99-cqcw gatsby-transformer-remark (npm) Fixed in 6.3.2 Advisory →
- Fix · GHSA-7ch4-rr99-cqcw gatsby-transformer-remark (npm) Fixed in 5.25.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2023-22491
- 2026-10-03 Alias added: GHSA-7ch4-rr99-cqcw
References
Sources
- CVE-2023-22491 · CVE Program
- CVE-2023-22491 · NVD
- FIRST EPSS
- GHSA-7ch4-rr99-cqcw · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences