PT-2022-19504 · Npm · Sharp

Dwisiswant0

·

Published

2022-05-25

·

Updated

2023-06-28

·

CVE-2022-29256

CVSS v3.1

6.5

Medium

VectorAV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions sharp versions prior to 0.30.5
Description The issue is related to a possible vulnerability in logic that is run only at npm install time when installing versions of sharp prior to the latest v0.30.5. If an attacker has the ability to set the value of the PKG CONFIG PATH environment variable in a build environment, they might be able to use this to inject an arbitrary command at npm install time. This is not part of any runtime code, does not affect Windows users at all, and is unlikely to affect anyone that already cares about the security of their build environment.
Recommendations For sharp versions prior to 0.30.5, update to version 0.30.5 to resolve the issue. As a temporary workaround, consider restricting access to the PKG CONFIG PATH environment variable in the build environment to minimize the risk of exploitation.

Exploit

Fix

OS Command Injection

Command Injection

Weakness Enumeration

Related Identifiers

CVE-2022-29256
GHSA-GP95-PPV5-3JC5

Affected Products

Sharp