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


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.06% (26th percentile)

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.

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
7.3 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    Required
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    None
Expand this section

NVD

5.4 medium