Skip to content

ci: audit dependencies on every PR + bump happy-dom past RCE CVE#28

Merged
BartM82 merged 1 commit into
mainfrom
chore/ci-npm-audit
May 15, 2026
Merged

ci: audit dependencies on every PR + bump happy-dom past RCE CVE#28
BartM82 merged 1 commit into
mainfrom
chore/ci-npm-audit

Conversation

@sebdraven
Copy link
Copy Markdown
Member

Summary

Ajoute un step npm audit --audit-level=high à la CI et bump happy-dom qui portait une CVE critique.

Ce qui change

1. Step audit dans .github/workflows/ci.yml

- name: Audit dependencies
  run: npm audit --audit-level=high

Fail la CI si une vulnérabilité high ou critical est connue dans l'arbre de dépendances (base GitHub Advisory consultée à chaque run). Filet large, auto-maintenu, rien à entretenir côté repo.

2. Bump happy-dom ^15.11.7 → ^20.9.0

L'audit a immédiatement levé une CVE critical sur happy-dom <= 20.8.8 (GHSA-37j7-fg3j-429f — VM Context Escape → RCE) ainsi que deux autres GHSA moderate sur la même range. Bump vers ^20.9.0 qui les corrige.

happy-dom n'est utilisé que par les tests Vitest. La surface qu'on consomme (createElement, KeyboardEvent, document.title, document.head.innerHTML, getComputedStyle, URL) n'a pas bougé sur le major.

Tests

  • npm install → OK
  • npm audit --audit-level=high → exit 0 (les vulnérabilités résiduelles sont moderate, sous le seuil)
  • npm run ci → lint propre + 96/96 tests passent avec happy-dom 20

Vulnérabilités restantes

6 moderate dans la chain vite-nodevite (côté outil de test uniquement, pas dans le code livré). Sous le seuil high, l'audit les laisse passer. À revisiter si elles montent en gravité.

🤖 Generated with Claude Code

Adds an `npm audit --audit-level=high` step after the test run. It
fails the build if any package in our graph has a known high or
critical vulnerability (GitHub Advisory). Cheap, generic supply-chain
guardrail — no list to maintain on our side.

Running the audit immediately exposed a critical CVE in our existing
happy-dom range (^15.11.7 — VM Context Escape leading to RCE,
GHSA-37j7-fg3j-429f). Bumped to ^20.9.0 which carries the fix. Local
`npm run ci` is green on 96/96 tests with the new happy-dom; the API
surface we use (createElement, KeyboardEvent, document.title,
document.head.innerHTML) is unchanged across the major.

Six moderate vulnerabilities remain in the vite/vitest chain — those
sit below the high threshold and don't fail the audit. We can revisit
if they get re-classified.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sebdraven sebdraven requested a review from BartM82 May 15, 2026 10:02
@BartM82 BartM82 merged commit 34e241b into main May 15, 2026
1 check passed
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.

2 participants