CVE-2022-29256

Possible vulnerability at 'npm install' time in sharp if an attacker has control over build environment

MEDIUM
6.7
CVSS Score
Published: May 25, 2022 at 09:20 PM UTC
Updated: June 17, 2026 at 04:39 AM UTC
2 products affected across 2 vendorsSharpProject Sharp

Using sharp by lovell?

Get instant alerts when new vulnerabilities affect sharp - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM6.7
Exploit prediction
EPSS 0.4%
SSVC
No known exploit

Description

sharp is an application for Node.js image processing. Prior to version 0.30.5, there is 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 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, does not affect Windows users at all, and is unlikely to affect anyone that already cares about the security of their build environment. This problem is fixed in version 0.30.5.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 0.30.5
Affected range stops below 0.30.5, so it looks safe — our inference, not a vendor statement
v < 0.30.5
Affected range stops below 0.30.5, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

SSVC — Action Prioritization

SSVCNo known exploitNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
HIGH
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-77CWE-78

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card