Repository navigation
fix(site): update dependencies to clear audit advisories - #333
Merged
Merged
Conversation
npm audit reported 8 advisories, 3 high, in astro, vite, undici, zod, and related site packages. npm audit fix moves them to patched versions within the existing ranges, including Astro 7.4.2. Astro 7.4 requires http-cache-semantics ^4.3.0, which the vendored 4.2.0 no longer satisfied, so npm resolved Astro to the registry's 4.3.0. That release lacks the max-stale fix from upstream PR #58, and 7 of the 13 site cache security tests failed. The vendored copy is now 4.3.0 with the same patch reapplied, so Astro resolves the patched policy again.
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.
Summary
The "Site audit and build" CI job fails on every PR.
npm auditreports 8 advisories (3 high) in site dependencies: astro, vite, undici, zod, smol-toml, postcss-selector-parser, and @expressive-code/core. They were published aftermain's last CI run on 14 October.npm audit fixmoves all of them to patched versions within the current ranges, including Astro 7.3.2 → 7.4.2. No change tosite/package.jsonwas needed. But Astro 7.4 requireshttp-cache-semantics ^4.3.0, so npm stopped using our patched local copy:Upstream PR #58 closed without a merge, and 4.3.0 doesn't fix
max-stale. npm audit can't flag 4.3.0, because the advisory lists only<= 4.2.0as affected. This PR updates the local copy to 4.3.0 and reapplies the same patch, so Astro uses the patched code again:Evidence
npm --prefix site audit --audit-level=high→ 8 vulnerabilities (1 low, 4 moderate, 3 high), exit 1.After: found 0 vulnerabilities.
npm audit fix:npm --prefix site test→ 7 of 13 cache security tests fail. Examples: "max-stale cannot bypass another user's session cookie" and "stale-while-revalidate cannot bypass shared session-cookie restrictions".With patched local 4.3.0: 13 of 13 pass.
npm --prefix site run buildpasses and builds the same 18 pages asmain. It shows the same two content warnings (i18ncollection, 404 entry) thatmainalready shows.index.jsmatches upstream commitb1d4bd6byte for byte. The patch diff against it matches the old patch diff against 4.2.0 line for line.npm run lintandbin/package-files.test.tspass.Merge Danger
Door: two-way. Reverting brings back the old lockfile and patched 4.2.0.
Blast Radius: site-only. The lockfile changes 155 package versions, mostly from the Astro 7.4 and Vite 8.3 updates. The CLI package and its npm dependencies are unchanged.