Skip to content

chore(deps): move to Node 24 for CVE-2026-111497 (Brotli RCE) - #121

Merged
amrit110 merged 3 commits into
mainfrom
chore/node-24-cve-2026-111497
Oct 25, 2026
Merged

amrit110 merged 3 commits into
mainfrom
chore/node-24-cve-2026-111497

Conversation

@amrit110

@amrit110 amrit110 commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Why

CVE-2026-111497 ("node2shell") is an out-of-bounds write in the Brotli decoder bundled with Node.js. A crafted br-compressed stream can lead to remote code execution. Node 18 and 20 are end of life and will not get a fix. The fix is in Node 24.22.1 (and 22.23.4 / 26.12.1), from the Node.js security release of Oct 21, 2026.

The live catalog-analytics Cloud Run service runs on Node 20.20.2. It is still the Oct 5 build, because every Deploy Catalog Analytics (Cloud Run) run since Oct 11 has failed: #119 bumped tailwindcss from 3.4.19 to 4.3.3 without migrating the config, so next build stops with "It looks like you're trying to use tailwindcss directly as a PostCSS plugin ... install @tailwindcss/postcss". This PR fixes that too, so merging it gets the live service onto Node 24.

What changed

Node 24:

  • catalog-analytics/Dockerfile: node:20-alpine to node:24-alpine (resolves to v24.22.1 today).
  • .github/workflows/deploy-catalog-gcp.yml: node-version: '20' to '24' (builds the static catalog site).
  • .github/workflows/code_checks.yml: node-version: '22' to '24'.

Tailwind CSS 4 migration in catalog-analytics (done with the official @tailwindcss/upgrade tool, then adjusted so the pages look the same as before):

  • postcss.config.js uses @tailwindcss/postcss. autoprefixer is removed because Tailwind 4 does its own prefixing.
  • tailwind.config.ts is gone. Its brand colors, font, animations and gradients now live in app/globals.css (@import "tailwindcss", @theme, @utility). The .card, .card-highlight and gradient helper classes moved to @utility; the CSS variables and body styles moved to @layer base.
  • Utilities renamed in v4: shadow-sm to shadow-xs, flex-shrink-0 to shrink-0, bg-gradient-to-* to bg-linear-to-*, focus:outline-none to focus:outline-hidden, break-words to wrap-break-word. These are the same CSS under the new names.
  • Kept the v3 look where v4 changed defaults:
    • Gradients use /srgb (for example bg-linear-to-r/srgb). v4 blends gradients in OKLab by default, which made the header gradient visibly lighter in the middle.
    • The v3 hex values are pinned for the gray, slate, blue, green, red and yellow palettes this app uses. v4 switched its palette to OKLCH, which shifted these shades slightly.
    • Default border color stays gray-200 (v4 uses currentcolor), and buttons keep the pointer cursor (v4 preflight dropped it).

Security patches (lockfile and version bumps only, no code changes):

  • uv.lock: certifi 2026.7.22 to 2026.10.23, filelock 4.1.0 to 4.2.4, virtualenv 21.14.6 to 21.14.13. These are what pip-audit in code checks flagged (PYSEC-2026-4320, six filelock CVEs, eight virtualenv CVEs), and why that check was red. Locked with uv 0.9.11, the version CI pins; nothing else in the lock changed.
  • next 16.3.8 to 16.4.3 in both catalog and catalog-analytics, for three advisories published Oct 22 (GHSA-2464-fhr4-w9xw and GHSA-673q-mjm6-r5xr are unauthenticated remote code execution, GHSA-p3m5-59mp-jv5r is a denial of service; fixed in 16.4.1).
  • catalog: nanoid 3.3.17 to 3.3.20 (Dependabot alert #194), ajv 6.12.6 to 6.15.0, tar 7.5.20 to 7.5.22.
  • catalog-analytics: zod 4.4.3 to 4.6.7 (GHSA-mrhx-c7xc-m3w5).

After this, npm audit reports 0 vulnerabilities in both apps, pip-audit reports none (with the workflow's existing ignore of GHSA-4xh5-x5gv-qwph), and #194 was the only open Dependabot alert.

npm run lint in catalog-analytics works again: Next 16 removed next lint, so the script is now eslint . with a new eslint.config.mjs built from eslint-config-next. It pins the React version for eslint-plugin-react, which cannot detect it under ESLint 10. Lint reports 0 errors and 13 warnings (unused variables and hook dependency hints that were already in the code).

How I verified it

All checks below were rerun after the dependency bumps (Next 16.4.3).

catalog-analytics under node:24-alpine (v24.22.1): npm ci, npm run lint (0 errors), npx tsc --noEmit and npm run build all exit 0. There is no test script.

Docker image, built the way deploy-catalog-analytics.yml builds it (copy catalog/public/data into catalog-analytics/public/data, then docker build catalog-analytics/):

  • node --version in the image prints v24.22.1.
  • Run with a 32+ character SESSION_SECRET and dummy Google settings: GET /analytics/ returns 307 to /analytics/login, GET /analytics/login/ returns 200 (/analytics/login without the slash returns 308 to it, same as before).

Before and after style comparison. I built the last commit before #119 (a843b35, Node 20, Tailwind 3.4.19, same as what is live) and this branch, ran both with the same data, and compared:

  • Generated CSS: 23.7 KB before, 34.2 KB after (v4 also emits its theme variables and @property rules). Every class selector in the old CSS is in the new one after accounting for the renames above, except .table, which v3 generated only because its scanner saw the word "table" in <table> tags; no element uses it as a class.
  • Screenshots with headless Chromium (Playwright) at 1440 px wide, light and dark mode, of the login page and of both dashboard tabs (GitHub Metrics, PyPI Metrics) using a signed test session cookie. Pixel diff against the old build: the login page is identical, and the dashboard tabs differ by at most 1/255 in color on about 0.01 to 0.02 percent of pixels (anti-aliasing). Page heights are identical.
  • The screenshot run with Next 16.4.3 once showed empty charts in one dark dashboard shot; two reruns matched the old build again, so that was chart animation timing in the headless browser, not a style change.
  • Before adding /srgb and the pinned palette, the same diff showed the header gradient and text colors visibly shifted (up to 28/255), which is why those two adjustments are in.

catalog/ under Node 24 (node:24-alpine, v24.22.1), with Next 16.4.3: npm ci ok, npm run lint exit 0, npm run build exit 0 (includes the pagefind index step). This is what deploy-catalog-gcp.yml and code_checks.yml run.

Python: uv sync --all-extras --dev with uv 0.9.11, then pip-audit on .venv with the workflow's ignore list: "No known vulnerabilities found". The repo has no Python unit tests.

pre-commit run --all-files from the project venv, as CI runs it: every hook passed.

Deploy note

  • deploy-catalog-gcp.yml runs on push to main when its own file changes, so merging this redeploys the static catalog site to GCS, built on Node 24.
  • deploy-catalog-analytics.yml triggers on catalog-analytics/**, so merging this builds and deploys catalog-analytics on Node 24. Its "Verify deployment" step checks /analytics/login/.
  • CI on this PR does not build catalog-analytics (only catalog/), so the build check above is from local runs.

…uild works

PR #119 bumped tailwindcss from 3.4.19 to 4.3.3 without migrating the
config, so `next build` failed with "use @tailwindcss/postcss" and every
catalog-analytics deploy since Oct 11 has failed.

- Use @tailwindcss/postcss in postcss.config.js (autoprefixer dropped; v4
  handles prefixing).
- Move the theme from tailwind.config.ts into CSS (@import "tailwindcss",
  @theme, @Utility), via the official @tailwindcss/upgrade tool.
- Rename utilities that changed in v4 (shadow-sm -> shadow-xs,
  flex-shrink-0 -> shrink-0, bg-gradient-to-* -> bg-linear-to-*,
  outline-none -> outline-hidden, break-words -> wrap-break-word).
- Keep the v3 look: gradients interpolate in sRGB (/srgb), the v3 hex
  values are pinned for the gray, slate, blue, green, red and yellow
  palettes, the default border color stays gray-200, and buttons keep the
  pointer cursor.
- Restore `npm run lint`: Next 16 removed `next lint`, so run `eslint .`
  with a flat config from eslint-config-next.
- uv.lock: certifi 2026.7.22 -> 2026.10.23, filelock 4.1.0 -> 4.2.4,
  virtualenv 21.14.6 -> 21.14.13 (pip-audit: PYSEC-2026-4320, six filelock
  CVEs, eight virtualenv CVEs).
- next 16.3.8 -> 16.4.3 in catalog and catalog-analytics
  (GHSA-2464-fhr4-w9xw, GHSA-p3m5-59mp-jv5r, GHSA-673q-mjm6-r5xr).
- catalog: nanoid 3.3.17 -> 3.3.20 (Dependabot alert #194),
  ajv 6.12.6 -> 6.15.0, tar 7.5.20 -> 7.5.22.
- catalog-analytics: zod 4.4.3 -> 4.6.7 (GHSA-mrhx-c7xc-m3w5).
@amrit110
amrit110 merged commit 893a2a8 into main Oct 25, 2026
5 checks passed
@amrit110
amrit110 deleted the chore/node-24-cve-2026-111497 branch October 25, 2026 00:36
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