Skip to content

chore(security): bump Dockerfile.dev base image node:20.9.0 → node:22 - #238

Open
dex-the-ai wants to merge 1 commit into
mainfrom
chore/security-node-base-image-2026-11
Open

dex-the-ai wants to merge 1 commit into
mainfrom
chore/security-node-base-image-2026-11

Conversation

@dex-the-ai

Copy link
Copy Markdown
Contributor

Summary

The monthly security audit (2026-11) found no high or critical advisories in the npm dependency tree. The only high-severity exposure is the dev container base image: Dockerfile.dev pins node:20.9.0, a 2023 Node.js release.

  • That Node.js runtime has several known high-severity CVEs, fixed in later Node releases.
  • Node 20 reached end-of-life on 2026-04-30, so it no longer gets security fixes.

Anyone who runs docker build -f Dockerfile.dev today gets that vulnerable runtime. This PR changes the single FROM line to node:22, the same major version CI already tests with (actions/setup-node node-version: "22"). No application code, manifests or other files change.

Advisories

Advisory Component Current Fixed / suggested Severity Path Source
CVE-2024-27983 (HTTP/2 server race / crash) Node.js runtime (Dockerfile.dev base) 20.9.0 ≥20.12.2 → node:22 High container base image Node Apr 2024
CVE-2024-22019 (unbounded chunk-extension DoS) Node.js runtime 20.9.0 ≥20.11.1 → node:22 High container base image Node Feb 2024
CVE-2024-21892 (Linux capabilities code injection) Node.js runtime 20.9.0 ≥20.11.1 → node:22 High container base image Node Feb 2024
CVE-2024-21896 (path traversal via Buffer monkey-patching) Node.js runtime 20.9.0 ≥20.11.1 → node:22 High container base image Node Feb 2024
CVE-2025-23166 (crypto async error handling crash) Node.js runtime 20.9.0 ≥20.19.2 → node:22 High container base image Node May 2025
Node 20 EOL (2026-04-30) Node.js runtime 20.x node:22 (LTS) — container base image Node releases
GHSA-g3hv-75wg-m249 minimatch (via next-swagger-doc → swagger-jsdoc → glob, and swagger-ui-react → swagger-client → apidom-reference) 10.2.6 ≥11.0.1 Moderate transitive GHSA
GHSA-3g3m-2fjr-6pw4 glob (via next-swagger-doc → swagger-jsdoc) 11.1.0 ≥14.0.2 Moderate transitive GHSA

The two moderate npm advisories are informational only and are not fixed here. They come in through swagger-jsdoc@6.3.0 and @swagger-api/apidom-reference, and npm audit offers only semver-major downgrades (next-swagger-doc@0.4.1, swagger-ui-react@4.16.1) as fixes. Both packages affect only API-doc tooling. They belong to the monthly dependency-update workflow.

Commands run and validation

# Audit (repo gitignores lockfiles, so resolve fresh like CI's `npm install` does)
npx npm@10 install --package-lock-only --ignore-scripts
npx npm@10 audit --json            # 0 critical, 0 high, 7 moderate (2 unique advisories)
osv-scanner scan source -L package-lock.json   # glob GHSA-3g3m-2fjr-6pw4 (6.3), minimatch GHSA-g3hv-75wg-m249 (6.9)

# Validate the changed image
docker build -f Dockerfile.dev -t nextjs-capella-secsweep:node22 .     # OK, node v22.23.5
docker run --rm -e DB_CONN_STR=couchbase://<cb> ... nextjs-capella-secsweep:node22 npx vitest run
#   Test Files 8 passed (8) | Tests 44 passed (44)   (Couchbase Server 8.0.3 + travel-sample)
docker run -d -p 3917:3000 -e DB_CONN_STR=... nextjs-capella-secsweep:node22   # CMD npm run dev
curl /api/v1/airline/list?country=France&limit=2   # 200, returns airlines

The first Vitest run had one failure in hotel/filter, because the app had just created the hotel_search FTS index and it was still building. After the index reached 917 docs, the rerun was 44/44 green.

UI evidence (container from Dockerfile.dev on node:22, Swagger UI at /)

Swagger UI on node:22

Walkthrough video: https://res.cloudinary.com/dhwqj0ps2/video/upload/v1795661966/pr-evidence/couchbase-examples/nextjs-capella-quickstart/chore-security-node-base-image-2026-11/swagger-root-node22.webm

Risk and rollback

  • Risk: low. Only the dev container base changes. Next.js 16 supports Node ≥20.9, and CI already runs on Node 22. node:22 is a floating major tag, so rebuilds pick up future 22.x security patches.
  • Rollback: revert this PR to restore FROM node:20.9.0.
  • Unrelated and unchanged: the README's docker build -t couchbase-nextjs-quickstart . expects a file named Dockerfile, but the repo ships Dockerfile.dev, so -f Dockerfile.dev is needed.

Tracking

  • Hermes Kanban task: t_e2899a8a (board couchbase-examples, monthly security audit 2026-11)
  • Reviewer: @ejscribner (owner per Hermes manifest; the repo has no CODEOWNERS)
  • Slack: owner notification sent via the dependency-review webhook after this PR opened

🤖 Generated with Claude Code

…ode:22

node:20.9.0 (Oct 2023) carries several high-severity Node.js runtime CVEs
(e.g. CVE-2024-27983, CVE-2024-22019, CVE-2024-21892, CVE-2025-23166) and
Node 20 reached end-of-life on 2026-04-30. node:22 matches the Node version
CI already tests with (actions/setup-node node-version: "22").

Hermes Kanban: t_e2899a8a

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nextjs-capella-quickstart Ready Ready Preview Nov 26, 2026 3:00am UTC

This branch was successfully deployed

1 active deployment
Preview — e8a9029f Deployed Nov 26, 2026 by vercel[bot]
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