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

- Severity: Medium 6.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.39%, higher than 34% of CVEs (2026-12-01)
- Published: 2022-05-25T21:20:12.000Z
- Modified: 2026-06-17T04:39:55.977Z
- Also known as: GHSA-gp95-ppv5-3jc5
- Weaknesses: CWE-77, CWE-78
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- lovell sharp: < 0.30.5
- sharp (npm): before 0.30.5
- sharp_project sharp: before 0.30.5

## Every score

- GitHub_M: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 6.7 Medium `CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 4.6 Medium `AV:L/AC:L/Au:N/C:P/I:P/A:P`

## References

- <https://github.com/lovell/sharp/security/advisories/GHSA-gp95-ppv5-3jc5> (patch, third-party-advisory, web)
- <https://github.com/lovell/sharp/commit/a6aeef612be50f5868a77481848b1de674216f0c> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-29256> (advisory)
- <https://advisory.dw1.io/54> (web)
- <https://github.com/lovell/sharp> (package)

## Sources

- CVE List: [CVE-2022-29256](https://www.cve.org/CVERecord?id=CVE-2022-29256), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-gp95-ppv5-3jc5](https://github.com/advisories/GHSA-gp95-ppv5-3jc5), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2022-29256](https://nvd.nist.gov/vuln/detail/CVE-2022-29256), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-29256 · Whole record: https://cve.day/CVE-2022-29256.json · Rebuilt by cve.day 2026-11-25T22:58:11.942Z
