security: close the last 5 advisories via verified resolution overrides - #112
Merged
Conversation
Takes open Dependabot alerts from 5 to 0. Each of these is pinned by an
upstream package rather than declared here, so no manifest or lockfile bump
could reach the patched version. A Yarn `resolutions` entry is the only
mechanism available — applied only after verifying the forced version works.
Root package.json:
esbuild ^0.28.1 tsup 8.5.1 (latest) declares esbuild ^0.27.0, so the
tree was stuck at 0.27.7, inside the vulnerable range
>= 0.27.3 < 0.28.1. #50
Forcing 0.28.1 collapses the tree to a single esbuild copy. Verified that
the packages that declared ^0.27.0 / ~0.27.0 still work: tsup builds the
library, tsx runs scripts, storybook builds, 286 tests pass at 92.9%
statement coverage, typecheck and lint clean.
examples/nextjs-demo/package.json:
postcss ^8.5.25 next depends on exactly postcss@8.4.31 — still true in
next 16.2.12, so even a major upgrade would not have
helped. #24, #102, #104
sharp ^0.35.3 next declares sharp ^0.34.5; the fix is 0.35.0, outside
that range. #87
Verified: next build compiles and prerenders all 3 static pages.
These overrides are liabilities, not fixes we own — they force versions the
upstream packages did not test against. SECURITY.md now documents each one
with what pins it, which advisory it answers, the exact condition for
removing it, and the commands to check whether upstream has caught up.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Takes open Dependabot alerts from 5 to 0.
I previously argued against
resolutionsfor these. That was the right default but the wrong final answer — I had not actually tested whether the forced versions work. I have now, and they do, so here they are with the evidence.Why a bump could not fix these
All five are pinned by an upstream package rather than declared in any manifest here, so there is no floor to raise:
esbuildtsup@8.5.1(latest) declaresesbuild@^0.27.0— cannot reach patched 0.28.1postcssnextdepends on exactlypostcss@8.4.31sharpnextdeclaressharp@^0.34.5; fix is 0.35.0, outside the rangeI checked
next@16.2.12(latest, a major upgrade): it still pinspostcss@8.4.31. So even upgrading Next by a major would not have closed those three.The overrides, and what verified them
Root —
esbuild: ^0.28.1. Forcing this collapses the tree to a single esbuild copy (0.27.7 is gone entirely). The risk was thattsupandtsx, which declared^0.27.0/~0.27.0, would break against 0.28. They do not:yarn build— tsup compiles the library (CJS + ESM + DTS)yarn clean— atsx-executed script runsyarn build-storybook— succeedsyarn test:coverage— 286 tests pass, 92.9% statements / 84.1% branchesyarn typecheck,yarn lint,yarn format:check— cleanexamples/nextjs-demo—postcss: ^8.5.25,sharp: ^0.35.3. The risk was Nexts CSS pipeline depending on postcss 8.4.31 internals. It does not:yarn build— compiles successfully, prerenders all 3 static pagesThese are liabilities, and the PR says so
An override forces a version upstream never tested against. Left undocumented that is exactly the debt worth avoiding, so
SECURITY.mdnow carries a Dependency overrides section recording, for each entry: what pins the package, which advisory it answers, the precise condition for removing it, and the commands to check whether upstream has caught up:They should be deleted the moment
tsupships againstesbuild@^0.28andnextmoves offpostcss@8.4.31.Verification of the outcome
Cross-checking every open alert against the resulting lockfiles:
Plus the standing invariant, re-run: every direct dependency across all four manifests still declares a floor at or above its patched version.