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


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.06% (28th 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 Remote Code Execution (RCE) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-SHARP-2848109
  • published26 May 2022
  • disclosed26 May 2022
  • creditDwi Siswanto

Introduced: 26 May 2022

CVE-2022-29256  (opens in a new tab)
CWE-77  (opens in a new tab)

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

CVSS Scores

version 3.1