Skip to content

fix(deps): clear the three advisories failing the Security workflow - #166

Merged
jdevalk merged 1 commit into
mainfrom
fix/audit-advisories-2026-08-08
Aug 8, 2026
Merged

fix(deps): clear the three advisories failing the Security workflow#166
jdevalk merged 1 commit into
mainfrom
fix/audit-advisories-2026-08-08

Conversation

@jdevalk

@jdevalk jdevalk commented Aug 8, 2026

Copy link
Copy Markdown
Owner

npm audit --audit-level=high has been failing on main and on every PR again — every check run this week carried a red npm Audit job while gating nothing. Same shape as #144.

What changed

npm audit fix resolved all three within existing semver ranges. No package.json change, no --force.

Package Severity Advisory
dompurify 3.4.12 → 3.4.13 moderate IN_PLACE hook removal leaves a detached subtree executable, causing XSS
js-yaml 4.3.0 → 4.3.1 high Quadratic CPU consumption in !!omap resolution
nanoid 3.3.16 → 3.3.18 high Custom generators can loop indefinitely when size is zero

Why this is not lockfile-only

js-yaml and nanoid are transitive build-toolchain deps, so for those a lockfile bump is the whole fix. dompurify is not. It is a direct dependency that scripts/generate-assets.mjs vendors to public/vendor/purify.min.js and ships to browsers, where it backs the Trusted Types default policy in public/trusted-types-policy.js.

The vendored file is tracked in git and does not rebuild on deploy. After npm audit fix it still carried /*! @license DOMPurify 3.4.12, so a lockfile-only commit would have cleared CI while continuing to serve the vulnerable build to visitors — the advisory that actually reaches a user, rather than a runner. npm run assets re-vendors it, so public/vendor/purify.min.js is in this PR.

The SRI hash is computed at build time by sri() in BaseLayout.astro rather than hand-pinned, so it tracks the new bytes automatically. Verified rather than assumed: the built tag's sha384 matches a fresh hash of the shipped file.

Verified

npm audit now reports 0 vulnerabilities.

  • lint, format:check, check:skill (168 pages, digest ✓), astro check (0 errors), test:websub, build (168 indexed) — all pass.
  • Loaded the built site in a browser, since bumping a library that ships to browsers is the risk here:
    • DOMPurify.version3.4.13, isSupported true; the script executes at all, which means the browser validated the SRI.
    • DOMPurify.sanitize('<img src=x onerror=alert(1)>ok')<img src="x">ok.
    • trustedTypes.defaultPolicy registers; createHTML('<b>hi</b><script>bad()</script>')<b>hi</b>.
    • ⌘K search overlay still renders sanitised results.
    • No console errors.

🤖 Generated with Claude Code

`npm audit --audit-level=high` has been failing on main and on every PR
again, so every check run this week showed a red job while gating
nothing. Same shape as #144.

Three advisories, all resolved by `npm audit fix` within the existing
semver ranges — no package.json change, no --force:

  dompurify 3.4.12 -> 3.4.13  (moderate) IN_PLACE hook removal leaves a
                              detached subtree executable, causing XSS
  js-yaml   4.3.0  -> 4.3.1   (high) quadratic CPU in !!omap resolution
  nanoid    3.3.16 -> 3.3.18  (high) custom generators can loop
                              indefinitely when size is zero

dompurify is the one that matters beyond CI: it is a direct dependency
that gets vendored to /vendor/purify.min.js and shipped to browsers,
where it backs the Trusted Types default policy. `npm run assets`
re-vendors it, so that file is in this commit too — a lockfile-only fix
would have left 3.4.12 serving to visitors. The SRI hash is computed at
build time from the file, so it tracks automatically; verified the
built tag's sha384 matches the shipped bytes.

Verified: lint, format:check, check:skill (168 pages), astro check
(0 errors), test:websub, build (168 indexed). Loaded the built site and
confirmed DOMPurify reports 3.4.13, the script passes SRI, the Trusted
Types default policy registers and strips <script>, and the search
overlay still renders sanitised results. No console errors.

`npm audit` now reports 0 vulnerabilities.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying specification-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3cc0665
Status: ✅  Deploy successful!
Preview URL: https://6a6efc08.specification-website.pages.dev
Branch Preview URL: https://fix-audit-advisories-2026-08.specification-website.pages.dev

View logs

@jdevalk
jdevalk merged commit 737789c into main Aug 8, 2026
8 checks passed
@jdevalk
jdevalk deleted the fix/audit-advisories-2026-08-08 branch August 8, 2026 09:59
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