Skip to content

chore(deps): run on Node 24 and apply npm audit fixes - #70

Open
npozs77 wants to merge 6 commits into
Jeanball:developfrom
npozs77:chore/node-24
Open

npozs77 wants to merge 6 commits into
Jeanball:developfrom
npozs77:chore/node-24

Conversation

@npozs77

@npozs77 npozs77 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Node 20 has reached end of life, so the project moves to Node 24 (the version #45 asked for), and npm audit fix is applied to the three lockfiles. Testing the new axios showed a regression, a credential leak in the logs, which is fixed here.

Changes

  • chore: run on Node 24: .nvmrc, engines, both Dockerfiles (node:24-alpine) and the CI workflow (reads .nvmrc).
  • fix(deps) ×3: npm audit fix without --force, one commit per lockfile. No version range in any package.json changed.
    • backend: 3 critical, 11 high, 6 moderate, 4 low → 0 (express, mongoose, multer, axios, express-rate-limit)
    • root: 2 critical, 3 high → 0
    • frontend: 2 critical, 13 high, 6 moderate, 2 low → 1 moderate
  • test(backend): tests that run the real Express, multer and express-rate-limit stack over HTTP (cover and CSV uploads, the login rate limit). Mocked requests would not notice a dependency bump changing these.
  • fix(logger): with axios 1.21 the error carries the raw request, so a failed Discogs call logged the Discogs key and secret from the URL (about 700 lines per error). With 1.10 nothing leaked. The existing redact paths do not reach it. Axios errors now go through an allow-list serializer (status, method, redacted URL and params, short response body).

How it was verified

  • npm run check passes: lint (0 errors), 201 frontend and 366 backend tests, both builds.
  • npm ci works for all three lockfiles on Node 24.
  • Both real images built and booted on Node 24 against a throwaway MongoDB holding a copy of a real dev database (1,509 albums, 1,506 items):
    • API smoke run, 31 of 31 passed: login, cookie, cover upload served back through nginx, 5 MB and wrong-type limits, CSV import, a live Discogs search and price sync, admin user create, edit and delete, and the rate limiter.
    • Reads on the full collection: 1,506 items listed in about 240 ms; 1,506 CSV rows exported.
    • A 5-row CSV import from the real export completed: 5 of 5, covers included.
  • Leak check: the real app, fake credentials, old axios (1.10) against new (1.21). 0 leaks before, 11 each for key and secret on 1.21 without the fix, 0 with it. The new tests fail without the fix (6 of 16).
  • Clicked through the UI in a browser against the Docker stack, including phone width. The old and new frontend builds behave the same.
  • Not covered: a full 1,506-row import (one Discogs call per row, over an hour); only 5 rows.

Notes for review

  • Node 24 or 26? 26 is also LTS now. I kept 24 to match Proposal: code quality baseline (lint/format, tests, CI checks on PRs) #45; moving later is the same four edits (.nvmrc, engines, two Dockerfiles).
  • i18next left at one moderate finding. The fix needs i18next 27 (a major bump), so it should be its own change.
  • Known, not caused by this PR: the 2026-03-15_migrate-indexes migration sometimes logs ns does not exist on a brand-new empty database (about 2 runs in 6 on both the old and the new dependencies). It is caught and the index is still created.
  • Seen while testing, existing behaviour, not changed here: after login you always land on /app, not on the page you were sent to login from.

Checklist

  • Targets develop (not main)
  • Title follows Conventional Commits with a scope
  • Line added to CHANGELOG.md under ## [Unreleased]
  • npm run check passes (lint, tests and build, frontend and backend)
  • New UI strings added to all locales (none added)
  • Data changes come with a migration (no data changes)
  • Screenshots attached for UI changes (no UI changes)

Node 20 has reached end of life. Node 24 is an active LTS (Node 26 is one too,
and moving to it later is the same four edits). .nvmrc says 24, engines in the
three package.json files says >=24, both Dockerfiles use node:24-alpine and the
CI workflow reads its Node version from .nvmrc, so there is one place to bump.

npm ci works on Node 24 with the existing lockfiles, so the fsevents lockfile
problem seen on the first npm 11 release is gone.
No version range in package.json changes, only what the lockfile resolves to.
npm audit goes from 3 critical, 11 high, 6 moderate and 4 low to none; in
production code that includes express, body-parser, path-to-regexp, proxy-addr,
mongoose, multer, express-rate-limit, axios and form-data. express is 4.22, mongoose
8.24, multer 2.5. The lockfile also records the engines field.
No version range in package.json changes. npm audit goes from 2 critical, 13
high, 6 moderate and 2 low to one moderate: i18next needs 27, a major bump, so
it is left for its own change. Includes axios, react-router, form-data, vite,
vitest and typescript-eslint. The lockfile also records the engines field.
Dev tooling only (concurrently, wait-on, playwright): npm audit goes from 2
critical and 3 high to none. The root version in the lockfile is brought in line
with package.json, and it records the engines field.
Run the real Express, multer and express-rate-limit stack on an ephemeral port instead of mocked requests, so a dependency upgrade that changes multipart handling, size limits or throttling is noticed. Cover and CSV uploads (type, size, field name, memory against disk) and the rate limit (100 attempts, then 429 with a JSON body and the audit line; shared by login and signup; /verify and /config never throttled).
…fails

With axios 1.21 the error carries the raw request, so a failed Discogs call logged the key and secret from the URL (and the TLS socket, ~700 lines). The redact paths on err.config.params do not reach it. Log axios errors through an allow-list serializer instead: status, method, URL and params with credentials redacted, a short response body.
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