Vulnerabilities in pkg:npm/sharp

PACKAGE
Advisory Summary

GHSA-wq5f-xc86-pv6w is a HIGH vulnerability vulnerability (CWE-1395: Dependency on Vulnerable Third-Party Component) affecting sharp libraries in the npm ecosystem. The issue involves vulnerability in librsvg dependency cve-2026-96889. Remediation is available by upgrading affected packages to version 0.35.5.

5 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/sharp

5 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/sharp. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-wq5f-xc86-pv6w - HIGH sharp : Vulnerability in librsvg dependency CVE-2026-96889
GHSA-rgj7-g3m4-5g8c - HIGH sharp: Vulnerabilities in libheif: GHSA-g89c-p67h-r497 and GHSA-2jg2-4ch7-h545
GHSA-f88m-g3jw-g9cj - HIGH sharp inherited vulnerabilities in libvips: CVE-2026-33327, CVE-2026-33328, CVE-2026-35590, CVE-2026-35591
GHSA-54xq-cgqr-rpm3 - HIGH sharp vulnerability in libwebp dependency CVE-2023-4863
GHSA-gp95-ppv5-3jc5 CVE-2022-29256 MODERATE sharp vulnerable to Command Injection in post-installation over build environment

GHSA-wq5f-xc86-pv6w at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-wq5f-xc86-pv6w
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-1395: Dependency on Vulnerable Third-Party Component
Affected Product sharp
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-wq5f-xc86-pv6w

To remediate this vulnerability, upgrade all affected sharp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sharp fixed: 0.35.5
npm install sharp@0.35.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls sharp

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-wq5f-xc86-pv6w, inspect your project dependencies using npm:

npm ls sharp

Analyze the terminal output to locate any version of sharp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.35.5), your application is affected.

Note: The npm ls sharp command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1395: Dependency on Vulnerable Third-Party Component, where the product has a dependency on a third-party component that contains one or more known vulnerabilities. In sharp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

GHSA-wq5f-xc86-pv6w Affected sharp Versions

1 component(s)
Fixed Versions:
0.35.5
Product / Package Ecosystem Affected Versions Fixed Version
sharp
npm
< 0.35.5
0.35.5

References

Frequently Asked Questions

What is GHSA-wq5f-xc86-pv6w?
GHSA-wq5f-xc86-pv6w is a security vulnerability in sharp involving Vulnerability in librsvg dependency CVE-2026-96889 under CWE-1395: Dependency on Vulnerable Third-Party Component.
Which sharp versions are affected?
Affected versions include releases prior to 0.35.5 across affected packages: sharp.
What version fixes GHSA-wq5f-xc86-pv6w?
Upgrading to 0.35.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sharp affected?
Yes, sharp is affected in releases prior to 0.35.5. Upgrade your dependency to 0.35.5 or later.
What CWE is associated with GHSA-wq5f-xc86-pv6w?
GHSA-wq5f-xc86-pv6w is classified under CWE-1395: Dependency on Vulnerable Third-Party Component (The product has a dependency on a third-party component that contains one or more known vulnerabilities.).
How can I check npm dependencies for GHSA-wq5f-xc86-pv6w?
Run the dependency tree command: 'npm ls sharp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wq5f-xc86-pv6w",
  "modified" : "2026-10-06T13:43:57Z",
  "published" : "2026-10-06T13:43:57Z",
  "aliases" : [ ],
  "summary" : "sharp : Vulnerability in librsvg dependency CVE-2026-96889",
  "details" : "### Impact\n\nA 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.\n\n### Patches\n\n#### Using prebuilt binaries provided by sharp?\n\nMost people rely on the prebuilt binaries provided by sharp.\n\nPlease upgrade sharp to the latest version, currently 0.35.5, which provides librsvg 2.63.2.\n\n#### Using a globally-installed librsvg?\n\nPlease ensure you are using the latest librsvg 2.63.2.\n\n### Workarounds\n\nAdd the following to your code to prevent sharp from decoding SVG images.\n```js\nsharp.block({ operation: [\"VipsForeignLoadSvg\"] });\n```\n\nTo 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.\n1",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "sharp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.35.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lovell/sharp/security/advisories/GHSA-wq5f-xc86-pv6w"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lovell/sharp/commit/96de105d9d36ab04c76c2b78b97255171630d236"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lovell/sharp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lovell/sharp/releases/tag/v0.35.5"
  }, {
    "type" : "WEB",
    "url" : "https://gitlab.gnome.org/GNOME/librsvg/-/work_items/1241"
  }, {
    "type" : "WEB",
    "url" : "https://www.cve.org/CVERecord?id=CVE-2026-96889"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1395", "CWE-416" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-06T13:43:57Z",
    "nvd_published_at" : null
  }
}