Skip to content

chore: fix path-to-regexp vulnerabilities#475

Merged
peppescg merged 4 commits intomainfrom
chore/fix-path-to-regexp-vulns
Mar 30, 2026
Merged

chore: fix path-to-regexp vulnerabilities#475
peppescg merged 4 commits intomainfrom
chore/fix-path-to-regexp-vulns

Conversation

@peppescg
Copy link
Copy Markdown
Collaborator

Summary

Fix 3 Grype vulnerability findings via pnpm overrides with parent-selector targeting:

Package From To CVE Severity
path-to-regexp (via @koa/router) 8.3.0 ≥8.4.0 GHSA-j3q9-mxjg-w52f High
path-to-regexp (via @koa/router) 8.3.0 ≥8.4.0 GHSA-27v5-c462-wpq7 Medium
path-to-regexp (via express@4) 0.1.12 0.1.13 GHSA-37ch-88jc-xwx2 High

Parent-selector overrides (@koa/router>path-to-regexp, router>path-to-regexp, express>path-to-regexp) are used intentionally to avoid bumping MSW's internal path-to-regexp@6.x, which would break test mocking.

Test plan

  • grype . reports "No vulnerabilities found"
  • pnpm test — 194/194 tests pass

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 30, 2026 16:55
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Mar 30, 2026
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Mar 30, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates pnpm dependency overrides to remediate reported path-to-regexp CVEs while keeping MSW’s path-to-regexp@6.x in place (per PR description).

Changes:

  • Add pnpm.overrides parent-selector rules to force patched path-to-regexp versions for express, @koa/router, and router.
  • Regenerate pnpm-lock.yaml to reflect path-to-regexp upgrades (0.1.13, 8.4.0) in the resolved dependency graph.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
package.json Adds pnpm override rules targeting transitive path-to-regexp dependencies to address vulnerabilities.
pnpm-lock.yaml Updates lockfile overrides and resolved versions for path-to-regexp to match the new override constraints.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread package.json Outdated
Comment thread pnpm-lock.yaml Outdated
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Mar 30, 2026
@peppescg peppescg force-pushed the chore/fix-path-to-regexp-vulns branch from 39f4255 to 8beee29 Compare March 30, 2026 17:01
@github-actions github-actions bot added size/L Large PR: 600-999 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Mar 30, 2026
peppescg and others added 3 commits March 30, 2026 19:12
Pin path-to-regexp to fixed versions to address:
- GHSA-j3q9-mxjg-w52f / GHSA-27v5-c462-wpq7 (High/Medium) via @koa/router and router → path-to-regexp 8.3.0 → 8.4.0
- GHSA-37ch-88jc-xwx2 (High) via express@4 → path-to-regexp 0.1.12 → 0.1.13

Use parent-selector overrides to avoid bumping MSW's path-to-regexp@6.x,
which would break test mocking.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prevent Renovate from bumping pnpm-lock.yaml directly; only
package.json version ranges should be updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use rangeStrategy: bump so Renovate updates version ranges in
package.json only, without dedicated lock file maintenance PRs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@peppescg peppescg force-pushed the chore/fix-path-to-regexp-vulns branch from 8beee29 to 92076c4 Compare March 30, 2026 17:12
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/L Large PR: 600-999 lines changed labels Mar 30, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Large PR Detected

This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.

How to unblock this PR:

Add a section to your PR description with the following format:

## Large PR Justification

[Explain why this PR must be large, such as:]

- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformation

Alternative:

Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.

See our Contributing Guidelines for more details on the pull request process.


This review will be automatically dismissed once you add the justification section.

Replace parent-selector overrides with version-range selectors,
matching the pattern used in toolhive-studio.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 30, 2026
@peppescg peppescg enabled auto-merge (squash) March 30, 2026 17:27
@peppescg peppescg merged commit 04a70f8 into main Mar 30, 2026
10 checks passed
@peppescg peppescg deleted the chore/fix-path-to-regexp-vulns branch March 30, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Extra large PR: 1000+ lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants