Skip to content

Update dependency sharp to v0.35.4 [SECURITY] - #2441

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-sharp-vulnerability
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-sharp-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
sharp (source, changelog) 0.35.30.35.4 age confidence

sharp: 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.

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

Severity

  • CVSS Score: 8.9 / 10 (High)
  • Vector String: 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

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Release Notes

lovell/sharp (sharp)

v0.35.4

Compare Source

:::note[Dependency versions]
https://github.com/lovell/sharp-libvips/releases/tag/v1.3.3
:::


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added renovate Renovate bot did it security Security issue or advisory labels Sep 9, 2026
@renovate
renovate Bot force-pushed the renovate/npm-sharp-vulnerability branch from 8eb7a64 to 89d5c62 Compare September 9, 2026 17:25
@dex4er

dex4er commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

@claude check if CVEs affect our project

@claude

claude Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @dex4er's task in 1m 17s —— View job


CVE impact analysis: GHSA-rgj7-g3m4-5g8c (sharp / libheif)

  • Gather context (find where sharp is used)
  • Determine whether the advisory's attack path exists in this project
  • Report conclusion

Verdict: not exploitable in Freelens. Safe to merge as dependency hygiene, no urgency, no release needed on its own.

Where sharp lives

Exactly one importer in the whole workspace:

  • packages/generate-tray-icons/package.json:36"sharp": "catalog:"
  • 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:

build:resources:tray → generate-tray-icons --output static/build/tray \
  --input @freelensapp/icon/icons/logo-lens.svg ...

Why the vulnerable code path is never reached

  1. 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.
  2. 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.
  3. 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]

@renovate
renovate Bot force-pushed the renovate/npm-sharp-vulnerability branch 2 times, most recently from 9e83664 to 6cc42ee Compare September 15, 2026 14:14
@renovate renovate Bot changed the title Update dependency sharp to v0.35.4 [SECURITY] Update dependency sharp to v0.35.4 [SECURITY] - autoclosed Sep 17, 2026
@renovate renovate Bot closed this Sep 17, 2026
@renovate
renovate Bot deleted the renovate/npm-sharp-vulnerability branch September 17, 2026 17:16
@renovate renovate Bot changed the title Update dependency sharp to v0.35.4 [SECURITY] - autoclosed Update dependency sharp to v0.35.4 [SECURITY] Sep 17, 2026
@renovate renovate Bot reopened this Sep 17, 2026
@renovate
renovate Bot force-pushed the renovate/npm-sharp-vulnerability branch 2 times, most recently from 6cc42ee to 42609a2 Compare September 17, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

renovate Renovate bot did it security Security issue or advisory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant