Skip to content

fix(infra): remediate all HIGH-severity CVEs in infra images#220

Merged
sirdeggen merged 1 commit into
mainfrom
fix/infra-high-cves
Jun 20, 2026
Merged

fix(infra): remediate all HIGH-severity CVEs in infra images#220
sirdeggen merged 1 commit into
mainfrom
fix/infra-high-cves

Conversation

@sirdeggen

Copy link
Copy Markdown
Contributor

What

trivy scans of the published infra/ images surfaced HIGH findings. This PR clears all of them. Verified: every infra image rebuilds to 0 CRITICAL / 0 HIGH.

Findings & fixes

1. Bundled npm CLI (dominant source)

node:*-alpine ships an npm whose own deps (tar, glob, minimatch, cross-spawn, picomatch, undici) carry HIGH CVEs — found at usr/local/lib/node_modules/npm/node_modules/.... npm overrides can't touch these, and upgrading npm just swaps one bundled-dep CVE for another (npm@11.17.0 still bundles vulnerable undici 6.26.0).

Fix: strip npm/npx from each runtime image. No app needs npm at runtime — all start via node. overlay-server was using CMD ["npm","start"]; switched to CMD ["node","dist/index.js"] (its start script was already exactly that).

2. Real application deps (npm overrides + regenerated lockfiles)

Overrides on the other components (tar/minimatch/glob/cross-spawn/picomatch) are defense-in-depth — not in the shipped prod trees, but pinned patched should a future dep introduce them.

3. OS packages

  • chaintracks-server: apk upgrade libssl3 libcrypto3 → 3.5.7-r0 (CVE-2026-45447)

Before → after (HIGH count, trivy --severity CRITICAL,HIGH)

Image Before After
chaintracks-server 13 0
message-box-server 11 0
uhrp-server-cloud-bucket 3 0
wab 3 0
overlay-server 1 0
wallet-infra 1 0

CRITICAL was 0 throughout.

Verification

Rebuilt all six images locally and re-ran trivy — each reports 0 CRITICAL / 0 HIGH. Builds succeed; overlay's new node CMD resolves dist/index.js and npm is confirmed absent at runtime (command -v npm → not found).

🤖 Generated with Claude Code

trivy scan of the published infra images surfaced HIGH findings in three
buckets. This clears all of them (verified: every infra image rebuilds to
0 CRITICAL / 0 HIGH on trivy --severity CRITICAL,HIGH).

1. Bundled npm CLI (the dominant source) — node:*-alpine ships an npm whose
   own deps (tar, glob, minimatch, cross-spawn, picomatch, undici) carry HIGH
   CVEs. npm `overrides` cannot touch these; upgrading npm just trades one
   bundled-dep CVE for another. Fix: strip npm/npx from each runtime image.
   None of the apps need npm at runtime — all start via `node`. overlay-server
   previously used `CMD ["npm","start"]`; switched to `CMD ["node","dist/index.js"]`
   (its start script was already just `node dist/index.js`).

2. Real application deps — added npm `overrides` and regenerated lockfiles:
   - wab: form-data 4.0.5 -> 4.0.6 (CVE-2026-12143), undici 6.26.0 -> 6.27.0 (CVE-2026-12151)
   - uhrp-server-cloud-bucket: form-data 2.5.5 -> 2.5.6 (via @types/request) + 4.0.6 (CVE-2026-12143)
   Overrides on the other components (tar/minimatch/glob/cross-spawn/picomatch)
   are defense-in-depth — those packages are not in the shipped prod trees, but
   the overrides pin patched versions should a future dep pull them in.

3. OS packages — chaintracks-server: apk upgrade libssl3/libcrypto3 to
   3.5.7-r0 (CVE-2026-45447).

Verification: rebuilt all six images locally and re-ran trivy; each reports
0 CRITICAL and 0 HIGH (was: chaintracks 13 HIGH, message-box 11, uhrp 3,
wab 3, overlay 1, wallet-infra 1). Builds succeed; overlay's new node CMD
resolves dist/index.js and npm is confirmed absent at runtime.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sirdeggen sirdeggen merged commit 264da4e into main Jun 20, 2026
10 checks passed
@sonarqubecloud

Copy link
Copy Markdown

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