Possible vulnerability at 'npm install' time in sharp if an attacker has control over build environment
Key facts
- Attack vector
- Local
- Privileges required
- High
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-77.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| lovell | sharp | before 0.30.5 | 0.30.5 | Patch available | CNA |
| — | sharp (npm) | before 0.30.5 | 0.30.5 | Patch available | GHSA-gp95-ppv5-3jc5 |
- sharp Vendorlovell Affected before 0.30.5 Fixed in 0.30.5 Patch available CNA
- sharp (npm) Vendor— Affected before 0.30.5 Fixed in 0.30.5 Patch available GHSA-gp95-ppv5-3jc5
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:sharp_project:sharp:*:*:*:*:*:node.js:*:* | before 0.30.5 | Vulnerable | Sharp Project |
- cpe:2.3:a:sharp_project:sharp:*:*:*:*:*:node.js:*:* Versions before 0.30.5 Vulnerable ·Sharp Project
Remediation
- Fix · CNA sharp (lovell) Fixed in 0.30.5
- Fix · GHSA-gp95-ppv5-3jc5 sharp (npm) Fixed in 0.30.5 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2022-29256
- 2026-10-03 Alias added: GHSA-gp95-ppv5-3jc5
References
More lovell vulnerabilities
- TI-2026-78726 Bundled libvips flaws in Sharp expose apps to crafted images CVSS 4.0HIGH 8.4
- TI-2026-78725 Sharp image library's bundled libheif allows remote code execution CVSS 4.0HIGH 8.9
- TI-2026-78724 Use after free in sharp's bundled librsvg allows code execution CVSS 4.0HIGH 8.9
Sources
- CVE-2022-29256 · CVE Program
- CVE-2022-29256 · NVD
- FIRST EPSS
- GHSA-gp95-ppv5-3jc5 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences