fix(security): patch HIGH/CRITICAL container image vulnerabilities #74
Loading…
Reference in a new issue
No description provided.
Delete branch "security/2026-10-image-patching"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The vulan/Grype scan of the running
rollnote-apicontainer found 81 HIGH/CRITICAL findings. 47 of them came from esbuild binaries (Go 1.20.7 / 1.23.12 stdlib) that should never have been in the runtime image.What changed
Dev tooling leaking into prod (
.pnpmfile.cjs, new)better-authdeclaresdrizzle-kitas an optional peer. pnpm resolved that peer to ourdrizzle-kitdevDependency and kept it inpnpm install --prod, so the runtime shippeddrizzle-kit,tsx,@esbuild-kit/*and three esbuild binaries (0.18.20, 0.25.12, 0.28.0).readPackagehook drops that peer. Only better-auth's CLI schema generator uses it, and nothing in better-auth's dist or insrc/imports it at runtime.pnpm why --prod esbuild drizzle-kit tsxnow returns nothing..pnpmfile.cjswith the manifests, because its checksum is in the lockfile..fallowrc.jsonlists it as an entry, otherwise the fallow audit flags it as an unused file.Direct deps
better-auth,@better-auth/passkey:~1.6.33.@better-auth/expo:1.6.33. The tilde keeps them on the 1.6 line, because^resolved to 1.7.13.adm-zip^0.6.1. It now ships its own types, so@types/adm-zipis dropped. It also rejects archives with duplicate entry names; see the release notes.nodemailer^10.2.1(8 → 10). The breaking changes are Node ≥ 20 and TLS checks when fetching remote attachments/OAuth; we only callcreateTransport+sendMail.zod^4.6.7.Transitive deps (
overridesinpnpm-workspace.yaml, where this repo keeps its pnpm settings)multer@2→ ^2.5.0,body-parser@2→ ^2.4.0,proxy-addr@2→ ^2.0.8,js-yaml@4→ ^4.3.2,brace-expansion@2→ ^2.1.7.qs6.16.1 and@simplewebauthn/server13.3.3 (Medium/Low).Image
NODE_IMAGEnode:24.21-alpine→node:24.22-alpine(24.22.1, Alpine 3.24.3, zlib 1.3.2-r1).node dist/src/main.jsand never uses them. This clears the npm-bundledtar/undici/ip-address/brace-expansionfindings.Scan: before → after
podman build)--only-fixed, HIGH/CRITICAL--only-fixed, any severityVerification (local)
pnpm lint,tsc --noEmit,pnpm build: pass.pnpm openapi:generate: no drift.fallow audit2.88.3: no issues.pnpm test: 302/302 pass.pnpm test:int(testcontainers on rootless podman): 34 suites, 333/333 pass.podman build: OK. The runtimenode_modulesholds no esbuild, drizzle-kit or tsx, and/usr/local/binhas onlynode./healthreturns{"status":"ok"}.What to check after deploy
node:24.22-alpine, and the build log shows therm -rf …npm…step.Follow-ups (not done here)
@nestjs/*12.x,@nestjs/swagger12 with js-yaml 5, multer/express bumped upstream). That is a framework major; once on it, the multer/body-parser/proxy-addr/js-yaml overrides can go.drizzle-kitstill pulls the deprecated@esbuild-kit/*(dev only, no longer in the image).typescriptand@types/node/@types/pgstill reach the prod tree as peers of@thallesp/nestjs-better-authanddrizzle-orm. They are harmless (no binaries, no findings) and can be dropped with the same pnpmfile hook if wanted.https://claude.ai/code/session_011Qbv9zPFHL8Ax1zQWXSov3