Skip to content

Temporarily override Miniflare Sharp security advisory - #50

Merged
kcsfelty merged 1 commit into
mainfrom
agent/sharp-0353-security
Jul 21, 2026
Merged

Temporarily override Miniflare Sharp security advisory#50
kcsfelty merged 1 commit into
mainfrom
agent/sharp-0353-security

Conversation

@kcsfelty

Copy link
Copy Markdown
Collaborator

Summary

  • pin a root npm override from Miniflare's exact development-only sharp@0.34.5 to patched sharp@0.35.3
  • regenerate only the Sharp/libvips portion of the lockfile; keep Miniflare 4.20260714.0 and Wrangler 4.112.0 unchanged
  • preserve the raw npm audit --audit-level=high gate instead of suppressing the advisory
  • document that the override is outside Miniflare's declared dependency contract, that Images/AVIF are not a Diamond support claim, and the exact removal trigger

Tracks #49. Upstream supported resolution: cloudflare/workers-sdk#14493.

Qualification evidence

Windows x64 and Linux x64 Node 22:

  • clean npm ci
  • npm ls sharp miniflare wrangler --all resolves sharp@0.35.3 overridden
  • npm audit --audit-level=high reports zero vulnerabilities
  • complete npm run check passes all 159 main-branch tests plus real workerd D1, bundled/local Worker, packed consumer, licensing, coverage, and readiness
  • npm run conformance passes 490/490
  • npm run conformance:earl writes 490 passing assertions

Windows Node 24 also passed. An isolated cross-platform compatibility probe confirmed that Miniflare itself dynamically loaded the 0.35.3 native addon and transformed a known 4×3 PNG to a checked 3×2 WebP. This is override qualification, not an Images feature claim.

AVIF/HEIF boundary

No AVIF regression is claimed. Sharp 0.35 reports AVIF metadata as heif, and pinned Miniflare lacks Cloudflare's corresponding mapping fix. Upstream #14493 updates the dependency and mapping together. Miniflare Images remain outside Diamond's supported package surface.

Removal trigger

Remove this override and regenerate the lock as soon as a released Miniflare/Wrangler pair declares a non-vulnerable Sharp version and the unchanged audit, real-D1, Worker, packed-consumer, and W3C gates pass.

Strongest counterargument

Miniflare pins exactly 0.34.5 rather than a compatible range, so this override is outside upstream's tested contract. The risk is bounded to development tooling, qualified on the two CI operating-system families and supported Node lines, explicitly excludes Images/AVIF, and is temporary. Independent review should reject this PR if that evidence is not sufficient.

@kcsfelty
kcsfelty merged commit 5e694bc into main Jul 21, 2026
10 checks passed
@kcsfelty
kcsfelty deleted the agent/sharp-0353-security branch July 21, 2026 23:01
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.

1 participant