Skip to content

Security update: bump sharp and other dependencies - #40

Merged
smellman merged 2 commits into
mainfrom
dev/issue-39
Jul 30, 2026
Merged

Security update: bump sharp and other dependencies#40
smellman merged 2 commits into
mainfrom
dev/issue-39

Conversation

@smellman

Copy link
Copy Markdown
Collaborator

Closes #39

Summary

  • Upgrade sharp to ^0.35.3 (plus commander ^15, @types/node ^26, and jest/ts-jest/prettier) as part of a dependency refresh.
  • Pin brace-expansion to ^5.0.8 via overrides to resolve the brace-expansion DoS advisory (GHSA-mh99-v99m-4gvg) that surfaced through the jest dependency tree. npm audit now reports 0 vulnerabilities.
  • Bump CI to Node 26.x and actions/checkout / actions/setup-node v7.

Test fixtures

  • Regenerated the SDF fixtures (test6.png, test6@2x.png) with sharp 0.35. The decoded pixels are identical to the previous fixtures (same dimensions, metadata, PNG chunk structure, and IDAT length); only the compressed PNG byte stream changed due to the bundled libvips/zlib update.
  • Switched checkFileMatchesFixture from an md5 byte comparison to a sharp(...).raw() pixel comparison, so future PNG encoder changes no longer break the tests as long as the image is pixel-identical.

Verification

  • npm test → 16/16 passing (4 suites).
  • npm audit → 0 vulnerabilities.

Note: remaining npm install peer-dependency warnings originate from an optional wasm binding in unrs-resolver (pulled in transitively by jest) and are harmless upstream noise; nothing in this repo can address them.

Address security advisories by updating dependencies:

- Upgrade sharp to ^0.35.3 (and commander ^15, @types/node ^26,
  jest/ts-jest/prettier) as part of the dependency refresh.
- Pin brace-expansion to ^5.0.8 via `overrides` to resolve the
  brace-expansion DoS advisory (GHSA-mh99-v99m-4gvg) that surfaced
  through the jest dependency tree. `npm audit` now reports 0
  vulnerabilities.
- Bump CI to Node 26.x and actions/checkout & actions/setup-node v7.

Update the SDF test fixtures (test6.png, test6@2x.png), regenerated
with sharp 0.35. The decoded pixels are identical to the previous
fixtures; only the PNG encoder byte stream changed.

Switch checkFileMatchesFixture from an md5 byte comparison to a
sharp(...).raw() pixel comparison so that PNG encoder changes (such as
a bundled libvips/zlib update in sharp) no longer break the tests as
long as the resulting image is pixel-identical.

Refs #39
@smellman
smellman requested review from hfu and yuiseki July 29, 2026 10:06

@yuiseki yuiseki left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@smellman
smellman merged commit 178abac into main Jul 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security update: update sharp, etc

2 participants