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. Learn more

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 Learn

Learn about Arbitrary Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-GATSBYTRANSFORMERREMARK-3228581
  • published12 Jan 2023
  • disclosed11 Jan 2023
  • creditUnknown

Introduced: 11 Jan 2023

CVE-2023-22491  (opens in a new tab)
CWE-94  (opens in a new tab)

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