You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.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.
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.
packages/generate-tray-icons/src/index.ts:15 — the only import sharp in the repo (verified by grepping all .ts/.tsx/.js/.mjs/.cjs outside node_modules/dist)
That package is "private": true and is a devDependency of the app (freelens/package.json:116). It runs once at build time:
No HEIF/AVIF decoding. The advisory is in libheif, reached only via VipsForeignLoadHeif (AVIF/HEIC/HEIF input). generate-tray-icons feeds sharp() only SVG buffers built from @freelensapp/icon (index.ts:93, :116, :153) — that is librsvg, a different loader — and writes PNG (index.ts:100). Grepping the repo for avif|heif|heic returns nothing.
No untrusted input. The advisory scopes impact to "those processing untrusted input". The inputs are three SVG files checked into this repository, resolved by import.meta.resolve from @freelensapp/icon. There is no path by which a user, a cluster, or a network peer supplies bytes to sharp — Freelens does no image decoding at runtime at all.
Not shipped to users.sharp is not a dependency of the freelens package, and electron-builder packs only production dependencies, so neither sharp nor its bundled libvips/libheif native binaries ever enter app.asar or the installers. The tray PNGs are generated during pnpm build and only the resulting PNGs ship.
So the exposure is limited to developer and CI machines, at build time, on repo-controlled SVGs.
The non-security fixes in 0.35.4
Worth a glance since the release also changes resize/composite bounds handling, both of which this code uses — but index.ts:96-143 passes only hard-coded sizes (16/32/…/128) and offsets (top: 64/66, left: 64/66), well inside any coordinate limit. No behaviour change expected; the generated tray icons should be byte-identical modulo any libvips PNG-encoder differences.
Recommendation
Merge it. It clears the pnpm audit / Dependabot finding and keeps the catalog current, but nothing in this advisory is reachable from Freelens, so it does not warrant an out-of-band release or a backport.
| Branch: renovate/npm-sharp-vulnerability | Model: claude-opus-5[1m]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.35.3→0.35.4sharp: Vulnerabilities in libheif: GHSA-g89c-p67h-r497 and GHSA-2jg2-4ch7-h545
GHSA-rgj7-g3m4-5g8c
More information
Details
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.
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.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.
Ensure you are using a
nodeexecutable 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
Severity
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
lovell/sharp (sharp)
v0.35.4Compare Source
:::note[Dependency versions]
https://github.com/lovell/sharp-libvips/releases/tag/v1.3.3
:::
Bound resize dimensions to coordinate limit.
Bound composite left and top to coordinate limit.
#4564
@metsw24-max
Round palette bit depth up for png and gif colours.
#4569
@metsw24-max
Ensure tiff.subifd input option is used.
#4572
@metsw24-max
Ensure
info.pagesis correct when limiting input page range.#4578
@metsw24-max
Improve support for input Streams finishing before output is requested.
#4584
@Jaybhade
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.