Skip to content

security: clear all npm advisories (27 → 0); Astro 6 → 7.3.8 - #76

Merged
mowens3 merged 1 commit into
masterfrom
chore/security-sweep
Oct 26, 2026
Merged

mowens3 merged 1 commit into
masterfrom
chore/security-sweep

Conversation

@mowens3

@mowens3 mowens3 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Security + dependency sweep

Clears every npm audit advisory in the project tree: 27 → 0. Dependency / lockfile / config changes only — no application logic changed (the one source edit is a compile-time type cast forced by the Astro 7 major; runtime unchanged).

npm audit before / after

critical high moderate low total
before 3 18 5 1 27
after 0 0 0 0 0

Key bumps

  • npm audit fix (no --force) cleared the transitive advisories: dompurify, tar, undici, vite, postcss, nanoid, js-yaml, svgo, brace-expansion, devalue, fast-uri, http-cache-semantics, smol-toml, source-map-js, and the yaml / @astrojs/language-server chain.
  • astro ^6.4.6 → ~7.3.8 (pinned). Clears the critical spread-attribute XSS and the sharp/libvips highs. Pinned to ~7.3.8 on purpose: astro 7.4.x requires Node ≥22.23.4 and the toolchain here is 22.20.0, so 7.4.x hard-fails the build.
  • @astrojs/node ^10 → ^11.1.9, @astrojs/vercel ^10 → ^11.0.16, @astrojs/check ^0.9.9 → ^0.9.12.
  • overrides.zod = 4.6.7 (new override, alongside the existing path-to-regexp). The @astrojs/vercel → @vercel/functions → @vercel/oidc → @vercel/cli-config chain pins zod@4.1.11 (vulnerable) and no newer @vercel/* release moves it, so a plain install can't fix it. Forcing the patched zod that astro 7 already resolves clears the chain and dedupes the whole tree to a single zod@4.6.7.

Compat shim forced by the Astro 7 major

  • src/pages/[...slug].astro: Astro 7 narrowed Astro.redirect()'s status argument from number to a union of valid HTTP redirect codes (300 | 301 | 302 | 303 | 304 | 307 | 308). The client's redirect.status is typed number, so it's cast to that union. Compile-time only — the cast compiles away and runtime behavior is unchanged, confirmed by the smoke test's 302 redirect assertion.

Verification (all green)

  • npm ci — clean install from the regenerated lockfile, 0 vulnerabilities.
  • npm run check (astro check) — 0 errors / 0 warnings / 0 hints.
  • npm run smoke — OK (both split_routing and nextjs_first scenarios build and pass their HTTP assertions). This is the PR CI gate (ci.yml = check + smoke).

Reverted / deferred

  • Nothing reverted. Every bump listed above is in the final tree; no bump had to be backed out.
  • E2E (test:e2e, Playwright) not run — deferred. It is a manual/weekly workflow (e2e.yml, workflow_dispatch + cron; not part of PR CI) that needs Docker, a built Drupal demo container, and Playwright browsers — out of scope for a dependency sweep here. No E2E-only code changed; the only runtime-reachable edit is the redirect cast, whose path is already exercised by the smoke 302 check.
  • GitHub Dependabot may still report alerts on a different count (it scans the full graph including the demo/ Docker tree and counts advisory/package pairs differently than npm audit). The project's npm audit is at 0.

Left alone (no advisory forces them)

  • typescript (^5), @types/node (^22), isomorphic-dompurify (^2), @playwright/test, @codewheel/jsonapi-frontend-client.

🤖 Generated with Claude Code

Dependency/security sweep only - no application-logic changes.

- npm audit fix (no --force): cleared the transitive advisories
  (dompurify, tar, undici, vite, postcss, nanoid, js-yaml, svgo,
  brace-expansion, devalue, fast-uri, http-cache-semantics, smol-toml,
  source-map-js, and the yaml / @astrojs/language-server chain).
- astro ^6.4.6 -> ~7.3.8 (pinned: 7.4.x requires Node >=22.23.4 and the
  local toolchain is 22.20.0). Clears the critical spread-attribute XSS
  and the sharp/libvips highs.
- @astrojs/node ^10 -> ^11.1.9, @astrojs/vercel ^10 -> ^11.0.16,
  @astrojs/check ^0.9.9 -> ^0.9.12.
- overrides: zod 4.6.7. The @astrojs/vercel -> @vercel/functions ->
  @vercel/oidc -> @vercel/cli-config chain pins zod 4.1.11 (vulnerable)
  and no newer @vercel release moves it, so force the patched zod that
  astro 7 already resolves. Tree dedupes to a single zod@4.6.7.
- src/pages/[...slug].astro: cast the redirect status to Astro 7's
  narrowed HTTP-code union (compile-time only; runtime unchanged).

npm audit: 27 (3 critical / 18 high / 5 moderate / 1 low) -> 0.
Verified green: npm ci, astro check, npm run smoke.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T00:59:13.997403Z 47e3191 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47e319104f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
"@astrojs/vercel": "^11.0.16",
"@codewheel/jsonapi-frontend-client": "^1.0.7",
"astro": "^6.4.6",
"astro": "~7.3.8",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Raise the declared Node minimum for Astro 7.3.8

For consumers on Node 22.0–22.11, the existing engines field and README advertise support, but the locked Astro 7.3.8 package requires Node >=22.12.0. Installation can fail when engine-strict is enabled, and Astro commands are outside the dependency's supported runtime range. Raise the project’s documented minimum or use an Astro version compatible with Node 22.0.

Useful? React with 👍 / 👎.

@mowens3
mowens3 merged commit 9df2ff7 into master Oct 26, 2026
3 checks passed
@mowens3
mowens3 deleted the chore/security-sweep branch October 26, 2026 02:17
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