Skip to content

🚨 [security] [js] Update sharp 0.29.1 → 0.35.3 (major) - #116

Open
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/yarn/sharp-0.35.3
Open

🚨 [security] [js] Update sharp 0.29.1 → 0.35.3 (major)#116
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/yarn/sharp-0.35.3

Conversation

@depfu

@depfu depfu Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ sharp (0.29.1 → 0.35.3) · Repo

Security Advisories 🚨

🚨 sharp inherited vulnerabilities in libvips: CVE-2026-33327, CVE-2026-33328, CVE-2026-35590, CVE-2026-35591

Impact

A number of vulnerabilities, two rated as "High" severity using CVSSv4, have been discovered and fixed in the upstream libvips dependency.

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

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.3, which provides libvips 8.18.3.

Using a globally-installed libvips?

Please ensure you are using the latest libvips 8.18.3.

Workarounds

Add the following to your code to prevent sharp from decoding GIF, TIFF and VIPS images.

sharp.block({ operation: ["VipsForeignLoadNsgif", "VipsForeignLoadTiff", "VipsForeignLoadVips"] });

🚨 sharp vulnerability in libwebp dependency CVE-2023-4863

Overview

sharp uses libwebp to decode WebP images and versions prior to the latest 0.32.6 are vulnerable to the high severity 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.

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

🚨 sharp vulnerable to Command Injection in post-installation over build environment

There's 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.

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. However, out of an abundance of caution, I've created this advisory.

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.

I've used the Common Vulnerability Scoring System (CVSS) calculator to determine the maximum possible impact, which suggests a "medium" score of 5.9, but for most people the real impact will be dealing with the noise from automated security tooling that this advisory will bring.

AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H/E:P/RL:O/RC:C/CR:X/IR:X/AR:X/MAV:X/MAC:X/MPR:X/MUI:R/MS:X/MC:X/MI:X/MA:X

This problem was fixed in commit a6aeef6 and published as part of sharp v0.30.5.

Thank you very much to @dwisiswant0 for the responsible disclosure.

Remember: if an attacker has control over environment variables in your build environment then you have a bigger problem to deal with than this issue.

Release Notes

0.35.3

  • Tighten verification of text dimensions, TIFF tile dimensions and extend values.

  • Improve code bundler support by resolving path to libvips binary.

  • Increase default concurrency when use of MALLOC_ARENA_MAX is detected.

  • Emit warning about binaries provided by Electron for use on Linux.

  • Add hasAlpha property to output info.
    #4500

  • TypeScript: Return more precise Buffer<ArrayBuffer> from toBuffer.
    #4520
    @Andarist

  • Bound clahe width and height to avoid signed overflow.
    #4551
    @metsw24-max

  • Bound trim margin to avoid signed overflow.
    #4552
    @metsw24-max

  • Reject infinite values when validating numbers.
    #4553
    @metsw24-max

  • Bound extract region to libvips coordinate limit.
    #4555
    @metsw24-max

  • Verify background colour values are numbers.
    #4556
    @metsw24-max

  • Bound create and raw input dimensions to coordinate limit.
    #4558
    @metsw24-max

  • Tighten recomb and affine matrix verification.
    #4560
    @chatman-media

  • Verify cache memory limit to avoid overflow.
    #4561
    @metsw24-max

0.35.2

  • TypeScript: Add mediaType to metadata response.
    #4492

  • Improve WebAssembly fallback detection.
    #4513

  • Improve code bundler support with stub binaries.
    #4543

  • Verify GIF effort option is an integer.
    #4544
    @metsw24-max

  • Verify recomb matrix entries are numbers.
    #4545
    @metsw24-max

  • TypeScript: Replace namespace with named exports for ESM.
    #4546

  • Bound dilate and erode width to avoid mask-size overflow.
    #4548
    @metsw24-max

  • Verify convolve kernel values are numbers.
    #4549
    @metsw24-max

0.35.1

  • TypeScript: Ensure type definitions are published for both ESM and CJS.
    #4537

  • WebAssembly: Ensure wrapper file is published.
    #4538

0.35.0

  • Breaking: Drop support for Node.js 18, now requires Node.js >= 20.9.0.

  • Breaking: Remove install script from package.json file.
    Compiling from source is now opt-in via the build script.

  • Breaking: Lossy AVIF output is now tuned using SSIMULACRA2-based iq quality metrics.

  • Breaking: Add limitInputChannels with a default value of 5.

  • Breaking: Remove deprecated failOnError constructor property.

  • Breaking: Remove deprecated paletteBitDepth from metadata response.

  • Breaking: Remove deprecated properties from sharpen operation.

  • Breaking: Rename format.jp2k as format.jp2 for API consistency.

  • Upgrade to libvips v8.18.3 for upstream bug fixes.

  • Remove experimental status from WebAssembly binaries.

  • Add prebuilt binaries for FreeBSD (WebAssembly).

  • Deprecate Windows 32-bit (win32-ia32) prebuilt binaries.

  • Ensure TIFF output bitdepth option is limited to 1, 2 or 4.

  • Add AVIF/HEIF tune option for control over quality metrics.
    #4227

  • Add keepGainMap and withGainMap to process HDR JPEG images with embedded gain maps.
    #4314

  • Add toUint8Array for output image as a TypedArray backed by a transferable ArrayBuffer.
    #4355

  • Require prebuilt binaries using static paths to aid code bundling.
    #4380

  • TypeScript: Ensure FormatEnum keys match reality.
    #4475

  • Add margin option to trim operation.
    #4480
    @eddienubes

  • Ensure HEIF primary item is used as default page/frame.
    #4487

  • Add image Media Type (MIME Type) to metadata response.
    #4492

  • Add withDensity to set output density in EXIF metadata.
    #4496

  • Improve pkg-config path discovery.
    #4504

  • Add WebP exact option for control over transparent pixel colour values.

  • Add support for ECMAScript Modules (ESM).
    #4509
    @florian-lefebvre

0.34.5

  • Upgrade to libvips v8.17.3 for upstream bug fixes.

  • Add experimental support for prebuilt Linux RISC-V 64-bit binaries.

  • Support building from source with npm v12+, deprecate --build-from-source flag.
    #4458

  • Add support for BigTIFF output.
    #4459
    @throwbi

  • Improve error messaging when only warnings issued.
    #4465

  • Simplify ICC processing when retaining input profiles.
    #4468

0.34.4

  • Upgrade to libvips v8.17.2 for upstream bug fixes.

  • Ensure TIFF subifd and OpenSlide level input options are respected (regression in 0.34.3).

  • Ensure autoOrient occurs before non-90 angle rotation.
    #4425

  • Ensure autoOrient removes existing metadata after shrink-on-load.
    #4431

  • TypeScript: Ensure KernelEnum includes linear.
    #4441
    @BayanBennett

  • Ensure unlimited flag is passed upstream when reading TIFF images.
    #4446

  • Support Electron memory cage when reading XMP metadata (regression in 0.34.3).
    #4451

  • Add sharp-libvips rpath for yarn v5 support.
    #4452
    @arcanis

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants