Arbitrary Code Injection Affecting gatsby-transformer-remark package, versions <5.25.1 >=6.0.0 <6.3.2


0.0
high

Snyk CVSS

    Attack Complexity Low
    User Interaction Required
    Confidentiality High
    Integrity High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.06% (21st percentile)
Expand this section
NVD
5.4 medium

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

How 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.