Arbitrary Code Injection Affecting gatsby-transformer-remark package, versions <5.25.1 >=6.0.0 <6.3.2
Threat Intelligence
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-JS-GATSBYTRANSFORMERREMARK-3228581
- published 12 Jan 2023
- disclosed 11 Jan 2023
- credit Unknown
Introduced: 11 Jan 2023
CVE-2023-22491 Open this link in a new tabHow to fix?
Upgrade gatsby-transformer-remark
to version 5.25.1, 6.3.2 or higher.
Overview
gatsby-transformer-remark is a Gatsby transformer plugin for Markdown using the Remark library and ecosystem
Affected versions of this package are vulnerable to Arbitrary Code Injection due to improper user-input sanitization when passing input in data mode (querying MarkdownRemark nodes via GraphQL). In order to exploit this vulnerability untrusted/unsanitized input would need to be sourced by or added into a file processed by gatsby-transformer-remark
.
PoC
---javascript ((require("child_process")).execSync("id >> /tmp/rce"))
Workaround
Users who are unable to upgrade to the fixed version should sanitize the input ahead of processing.