Remote Code Execution (RCE) Affecting sharp package, versions <0.30.5


0.0
medium

Snyk CVSS

    Attack Complexity Low
    Privileges Required High
    User Interaction Required
    Confidentiality High
    Integrity High
    Availability High

    Threat Intelligence

    EPSS 0.04% (6th percentile)
Expand this section
NVD
6.7 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-SHARP-2848109
  • published 26 May 2022
  • disclosed 26 May 2022
  • credit Dwi Siswanto

How to fix?

Upgrade sharp to version 0.30.5 or higher.

Overview

sharp is a High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images

Affected versions of this package are vulnerable to Remote Code Execution (RCE). There is a possible vulnerability in logic that is run only at npm install time when installing the package. If an attacker has the ability to set the value of the PKG_CONFIG_PATH environment variable in a build environment then they might be able to use this to inject an arbitrary command at npm install time. This is not part of any runtime code and does not affect Windows users at all.

References