Skip to content

fix(deps): update body-parser, path-to-regexp and qs under express - #975

Merged
unhappychoice merged 1 commit into
unhappychoice:mainfrom
JMR-dev:fix-security-vulns
Sep 30, 2026
Merged

unhappychoice merged 1 commit into
unhappychoice:mainfrom
JMR-dev:fix-security-vulns

Conversation

@JMR-dev

@JMR-dev JMR-dev commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Why

npm audit --omit=dev reported advisories in 3 packages that mdts users install, all reached through express 5.2.1:

Advisory Severity Package Issue
GHSA-j3q9-mxjg-w52f high path-to-regexp 8.2.0 DoS via sequential optional groups
GHSA-27v5-c462-wpq7 moderate path-to-regexp 8.2.0 ReDoS via multiple wildcards
GHSA-4mjr-xmp4-gh2g moderate qs 6.14.1 DoS via attacker-controlled isBuffer
GHSA-q8mj-m7cp-5q26 moderate qs 6.14.1 qs.stringify crash on null entries in comma-format arrays
GHSA-w7fw-mjwx-w883 low qs 6.14.1 arrayLimit bypass in comma parsing
GHSA-v422-hmwv-36x6 low body-parser 2.2.1 invalid limit value silently disables size enforcement

The full npm audit reported 35 findings (19 high, 9 moderate, 7 low); the rest are dev-only.

npm audit fix alone does not clear path-to-regexp: the locked 8.2.0 still satisfies router's ^8.0.0, so npm leaves it in place. It needed an explicit npm update path-to-regexp.

What changed

Lockfile only. package.json and source are unchanged.

body-parser        2.2.1  -> 2.3.0
path-to-regexp     8.2.0  -> 8.4.2
qs                 6.14.1 -> 6.16.0
type-is            2.0.1  -> 2.1.0
iconv-lite         0.7.0  -> 0.7.3
side-channel       1.1.0  -> 1.1.1
side-channel-list  1.0.0  -> 1.0.1

npm audit --omit=dev:   3 -> 0
npm audit:             35 -> 17

The other 53 version changes are dev-only: Babel 7.29, picomatch, minimatch, brace-expansion, js-yaml, yaml, lodash, browserslist, @humanfs/node, and netlify-lambda's own Express 4 dependencies. No package crosses a major version, and every new version sits inside the range its dependent already declares.

How it was verified

path-to-regexp is the router's pattern parser, and the server's catch-all routes use its *splat wildcard syntax, so a running server was checked as well as the supertest suites.

  • Routes on a running server: node dist/index.js example_documents returns 200 for /api/config, /api/filetree, /api/outline?filePath=features/mermaid.md, /api/markdown/features/mermaid.md, /api/markdown/mdts-welcome-markdown.md, /api/diff/features/mermaid.md, /api/diff-prev/features/mermaid.md and the SPA catch-all for /features/mermaid.md. A missing non-markdown path reaches the catch-all and gets its designed 404 File not found (src/server/server.ts:126).
  • Build: npm run build && npm run build:frontend pass after npm ci from the new lockfile. Webpack reports 37 warnings, the same count as on main.
  • Tests and lint: npm test 142/142, npm run lint 32/32, the same as main.
  • Audit: npm audit --omit=dev reports 0 and npm audit reports 17.

Reviewer note

The 17 findings left are all dev-only, and all come through netlify-lambda 2.0.16: webpack 4 (braces, micromatch, chokidar 2, watchpack, terser-webpack-plugin with serialize-javascript 4, node-libs-browser with elliptic) and toml 3.0.0. None has a fix available, so they are out of scope here. Whether netlify-lambda is still needed is raised in #977.

npm audit reported 35 findings in the root lockfile, 3 of them in
packages that ship to users: body-parser 2.2.1, path-to-regexp 8.2.0
and qs 6.14.1, all pulled in by express 5.2.1. Each has a patched
release inside the ranges express and its router already declare, so
only the lockfile changes; package.json is untouched.

npm audit fix skipped path-to-regexp because the locked 8.2.0 still
satisfies router's ^8.0.0, and it left a stale browserslist nested
under core-js-compat, so both were updated explicitly. No package
crosses a major version.

npm audit --omit=dev now reports 0. The 17 dev-only findings left all
come through netlify-lambda's webpack 4 and toml dependencies and have
no fix available.
@netlify

netlify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for mdts-unhappychoice ready!

Name Link
🔨 Latest commit adae02f
🔍 Latest deploy log https://app.netlify.com/projects/mdts-unhappychoice/deploys/6aba9962c49db70008ccef65
😎 Deploy Preview https://deploy-preview-975--mdts-unhappychoice.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: d0dfb617-398e-47a4-8552-0d65d5680277

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.33%. Comparing base (283b39f) to head (adae02f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #975   +/-   ##
=======================================
  Coverage   99.33%   99.33%           
=======================================
  Files          71       71           
  Lines        1663     1663           
  Branches      397      404    +7     
=======================================
  Hits         1652     1652           
  Misses         10       10           
  Partials        1        1           
Flag Coverage Δ
frontend 99.47% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@unhappychoice unhappychoice left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Verified locally: clean npm ci, tests, lint and builds pass.

@unhappychoice
unhappychoice merged commit e29fe43 into unhappychoice:main Sep 30, 2026
11 checks passed
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.

2 participants