GHSA-54xq-cgqr-rpm3: Sharp Sharp Vulnerability Vulnerability

HIGH
CVSS 7.8
Published
Advisory Summary

GHSA-54xq-cgqr-rpm3 is a HIGH (CVSS 7.8) sharp vulnerability vulnerability (General Security Weakness) affecting Sharp libraries in the npm ecosystem. The issue involves sharp vulnerability in libwebp dependency cve-2023-4863. Remediation is available by upgrading affected packages to version 0.32.6.

GHSA-54xq-cgqr-rpm3 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-54xq-cgqr-rpm3
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification General Security Weakness
Affected Product Sharp
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-54xq-cgqr-rpm3

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.32.6
npm install sharp@0.32.6
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-54xq-cgqr-rpm3, 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.32.6), 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 General Security Weakness. 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

## Overview sharp uses libwebp to decode WebP images and versions prior to the latest 0.32.6 are vulnerable to the high severity https://github.com/advisories/GHSA-j7hp-h8jx-5ppr. ## Who does this affect? Almost anyone processing untrusted input with versions of sharp prior to 0.32.6. ## How to resolve this? ### Using prebuilt binaries provided by sharp? Most people rely on the prebuilt binaries provided by sharp. Please upgrade sharp to the latest 0.32.6, which provides libwebp 1.3.2. ### Using a globally-installed libvips? Please ensure you are using the latest libwebp 1.3.2. ## Possible workaround Add the following to your code to prevent sharp from decoding WebP images. ```js sharp.block({ operation: ["VipsForeignLoadWebp"] }); ```

GHSA-54xq-cgqr-rpm3 Affected Sharp Versions

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

References

Frequently Asked Questions

What is GHSA-54xq-cgqr-rpm3?
GHSA-54xq-cgqr-rpm3 is a security vulnerability in Sharp involving sharp vulnerability in libwebp dependency CVE-2023-4863 under General Security Weakness.
Which Sharp versions are affected?
Affected versions include releases prior to 0.32.6 across affected packages: sharp.
What version fixes GHSA-54xq-cgqr-rpm3?
Upgrading to 0.32.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sharp affected?
Yes, sharp is affected in releases prior to 0.32.6. Upgrade your dependency to 0.32.6 or later.
What is the CVSS score of GHSA-54xq-cgqr-rpm3?
GHSA-54xq-cgqr-rpm3 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with GHSA-54xq-cgqr-rpm3?
GHSA-54xq-cgqr-rpm3 is classified under General Security Weakness.
How can I check npm dependencies for GHSA-54xq-cgqr-rpm3?
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-54xq-cgqr-rpm3",
  "modified" : "2023-11-16T17:14:15Z",
  "published" : "2023-11-16T17:14:15Z",
  "aliases" : [ ],
  "summary" : "sharp vulnerability in libwebp dependency CVE-2023-4863",
  "details" : "## Overview\n\nsharp uses libwebp to decode WebP images and versions prior to the latest 0.32.6 are vulnerable to the high severity https://github.com/advisories/GHSA-j7hp-h8jx-5ppr.\n\n## Who does this affect?\n\nAlmost anyone processing untrusted input with versions of sharp prior to 0.32.6.\n\n## How to resolve this?\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 0.32.6, which provides libwebp 1.3.2.\n\n### Using a globally-installed libvips?\n\nPlease ensure you are using the latest libwebp 1.3.2.\n\n## Possible workaround\n\nAdd the following to your code to prevent sharp from decoding WebP images.\n```js\nsharp.block({ operation: [\"VipsForeignLoadWebp\"] });\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "sharp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.32.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lovell/sharp/security/advisories/GHSA-54xq-cgqr-rpm3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lovell/sharp/commit/dbce6fab795ca4250bda9b1ef502c1fdb7d4a30c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lovell/sharp"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-11-16T17:14:15Z",
    "nvd_published_at" : null
  }
}