Use after free in librsvg dependency of sharp can lead to code execution
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
The sharp npm package before 0.35.5 bundles a vulnerable version of the librsvg dependency. A use after free (CWE-416) in librsvg can lead to remote code execution on glibc-based Linux when certain runtime conditions apply. The advisory does not describe what an attacker must do beyond those runtime conditions.
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
Description from the GitHub advisory
### Impact A memory-related vulnerability has been discovered and fixed in the upstream librsvg dependency. When certain runtime-specific conditions apply, this vulnerability can lead to possible remote code execution (RCE) on glibc-based Linux. ### Patches #### Using prebuilt binaries provided by sharp? Most people rely on the prebuilt binaries provided by sharp. Please upgrade sharp to the latest version, currently 0.35.5, which provides librsvg 2.63.2. #### Using a globally-installed librsvg? Please ensure you are using the latest librsvg 2.63.2. ### Workarounds Add the following to your code to prevent sharp from decoding SVG images. ```js sharp.block({ operation: ["VipsForeignLoadSvg"] }); ``` To avoid RCE, ensure you are using a `node` executable binary compiled as a Position Independent Executable (PIE). Most Linux package managers already use this security-hardening feature however be warned that the "official" Node.js binaries do not. 1
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | sharp (npm) | before 0.35.5 | 0.35.5 | Patch available | GHSA-wq5f-xc86-pv6w |
- sharp (npm) Vendor— Affected before 0.35.5 Fixed in 0.35.5 Patch available GHSA-wq5f-xc86-pv6w
Remediation
Upgrade sharp to version 0.35.5, which provides librsvg 2.63.2. If librsvg is installed globally, upgrade it to librsvg 2.63.2. As a workaround, block SVG decoding by calling sharp.block with the VipsForeignLoadSvg operation. To avoid RCE, run node as a Position Independent Executable (PIE) binary, noting that the official Node.js binaries are not PIE.
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
- Fix · GHSA-wq5f-xc86-pv6w sharp (npm) Fixed in 0.35.5 Advisory →
Timeline
- 2026-10-06 Threatist record created from GHSA-wq5f-xc86-pv6w
References
Other 6
- https://github.com/lovell/sharp/security/advisories/GHSA-wq5f-xc86-pv6w
- https://github.com/lovell/sharp/commit/96de105d9d36ab04c76c2b78b97255171630d236
- https://github.com/lovell/sharp
- https://github.com/lovell/sharp/releases/tag/v0.35.5
- https://gitlab.gnome.org/GNOME/librsvg/-/work_items/1241
- https://www.cve.org/CVERecord?id=CVE-2026-96889
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences