Skip to content

CI: fail on High or Critical vulnerabilities in shipped packages (2.5) - #40

Merged
ltc870 merged 3 commits into
mainfrom
ci/vulnerable-packages
Nov 19, 2026
Merged

ltc870 merged 3 commits into
mainfrom
ci/vulnerable-packages

Conversation

@ltc870

@ltc870 ltc870 commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Hardening step 4, item 2.5: CI fails on known High or Critical vulnerabilities in what ships.

.github/workflows/ci.yml:

  • NEW step in Frontend build: npm audit --omit=dev --audit-level=high after npm ci. --omit=dev checks only packages that end up in the browser bundle; build and test tools stay with Dependabot alerts and security updates.
  • CHANGED Restore in Backend build and migration check: dotnet restore -p:NuGetAuditMode=all "-p:WarningsAsErrors=NU1903%3BNU1904". NuGet audits direct and transitive packages; High (NU1903) and Critical (NU1904) become errors in CI only, so a deploy on homeserver is never blocked by an overnight advisory. Moderate and Low stay warnings.
  • Both are inside jobs the main ruleset already requires.

Proven (commits 2 and 3 of this PR, net zero change):

  • Clean commit: both new steps passed.
  • A temporary commit added lodash 4.17.20 to frontend and System.Text.Json 8.0.4 to backend. Both jobs failed at the new steps: error NU1903: Warning As Error: Package 'System.Text.Json' 8.0.4 has a known high severity vulnerability and npm audit's 1 high severity vulnerability (lodash <=4.17.23).
  • The next commit reverts it; the PR's diff against main is only ci.yml.

Trade-off: if a High or Critical hole appears in a shipped package before a fix exists, every PR is blocked until it's fixed or the step is switched off for a while. npm audit asks npm's servers, so an npm outage can fail the step; re-run the job.

Nothing here runs on the server, so this doesn't need a test deploy.


Generated by Claude Code

Frontend: npm audit --omit=dev --audit-level=high after npm ci.
Backend: dotnet restore audits all packages and treats NU1903 (High)
and NU1904 (Critical) as errors, in CI only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtHpE5ByGuWvM7LpsNqxvn
…son 8.0.4

CI should fail at both new audit steps. Reverted in the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtHpE5ByGuWvM7LpsNqxvn
The test proved both audit steps fail CI: NU1903 for System.Text.Json 8.0.4
and npm audit's high finding for lodash 4.17.20.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtHpE5ByGuWvM7LpsNqxvn
@ltc870
ltc870 merged commit 0a61766 into main Nov 19, 2026
7 checks passed
@ltc870
ltc870 deleted the ci/vulnerable-packages branch November 19, 2026 10:52
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