GHSA-RGJ7-G3M4-5G8C

GHSA-RGJ7-G3M4-5G8C is a high-severity security vulnerability in sharp (npm), affecting versions < 0.35.4. It is fixed in 0.35.4.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

sharp: Vulnerabilities in libheif: GHSA-g89c-p67h-r497 and GHSA-2jg2-4ch7-h545

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.4, which provides libheif 1.23.2.

Using a globally-installed libheif?

Please ensure you are using the latest libheif 1.23.2.

Workarounds

Add the following to your code to prevent sharp from decoding AVIF images.

sharp.block({ operation: ["VipsForeignLoadHeif"] });

Ensure you are using a node executable binary compiled as a Position Independent Executable (PIE). Most Linux package managers already do this for protection against RCE however be warned that the "official" Node.js binaries do not.

References

Impact

A number of vulnerabilities, two rated as "Critical" severity using CVSSv3, have been discovered and fixed in the upstream libheif dependency. These can lead to possible remote code execution (RCE) on glibc-based Linux when run under certain conditions.

The attack vector for these claims to be "network" however sharp does not provide any networking features so this vulnerability is down-rated to a "High" severity using CVSSv4 but please note its Subsequent System Impact.

Those processing untrusted input with versions of sharp prior to 0.35.4 are affected.

Affected versions

sharp (< 0.35.4)

Security releases

sharp → 0.35.4 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade sharp to 0.35.4 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is GHSA-RGJ7-G3M4-5G8C? GHSA-RGJ7-G3M4-5G8C is a high-severity security vulnerability in sharp (npm), affecting versions < 0.35.4. It is fixed in 0.35.4.
  2. Which versions of sharp are affected by GHSA-RGJ7-G3M4-5G8C? sharp (npm) versions < 0.35.4 is affected.
  3. Is there a fix for GHSA-RGJ7-G3M4-5G8C? Yes. GHSA-RGJ7-G3M4-5G8C is fixed in 0.35.4. Upgrade to this version or later.
  4. Is GHSA-RGJ7-G3M4-5G8C exploitable, and should I be worried? Whether GHSA-RGJ7-G3M4-5G8C is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether GHSA-RGJ7-G3M4-5G8C is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix GHSA-RGJ7-G3M4-5G8C? Upgrade sharp to 0.35.4 or later.

Stop the waste.
Protect your environment with Kodem.