chore(deps): update dependency path-to-regexp to v1 [security]#5385
chore(deps): update dependency path-to-regexp to v1 [security]#5385
Conversation
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Code Review: Dependency Security Update — path-to-regexp 0.2.5 → 1.9.0
This is a Renovate-generated security PR updating the express/path-to-regexp resolution in docs/package.json to address CVE-2024-45296 (ReDoS vulnerability).
What the change does
Pins the scoped Yarn resolution express/path-to-regexp from 0.2.5 to 1.9.0. The 1.9.0 release adds backtrack protection that prevents the catastrophic backtracking regex case (e.g. /:a-:b pattern with a crafted long input).
Assessment: Safe to merge ✓
The lockfile diff is correct and internally consistent. The deduplication of the ^1.7.0 and pinned 1.9.0 entries into a single lockfile entry is expected Yarn behaviour. The 0.1.13 entry (used by other packages) remains unchanged and is already patched.
Minor observations (non-blocking)
-
Scoped resolution may not be active — The key
express/path-to-regexponly overridespath-to-regexpwhen Express itself is a dependent. In a Docusaurus docs site that doesn't directly depend on Express, this resolution may be a no-op. It's harmless, but if Express is not in the actual dependency tree, a future cleanup could remove the key entirely. -
Major version jump —
0.2.x→1.9.0is a major bump with some API differences (key population,strict/endoption behaviour). In the context of a Yarn resolution override (the consuming code lives inside Express/other packages), this is low risk, but worth confirming the docs build still passes CI. -
CVE advisory recommends
8.0.0— The advisory's preferred long-term path is8.x, which removes the vulnerable feature entirely.1.9.0applies a backtrack guard but doesn't remove the problematic capture-group feature. For a static docs site this residual risk is negligible, and staying on1.xavoids breaking downstream API consumers — a pragmatic tradeoff.
Bottom line
This is a correct, low-risk security remediation appropriate for a documentation site. No application logic is affected. Good to merge.
1ba497d to
06ddf73
Compare
There was a problem hiding this comment.
Security Dependency Update Review
This PR updates the resolution in from to to address CVE-2024-45296 (ReDoS vulnerability).
Summary
The change is correct and appropriate. The vulnerability allows a crafted URL path to trigger catastrophic backtracking in generated regular expressions when two parameters appear in a single path segment (e.g., /:a-:b), potentially causing a Denial of Service in JavaScript-based routing.
What looks good
- The fix targets the right package and bumps to a patched version (1.9.0 is listed as a safe version for the 1.x series).
- The yarn.lock consolidation is clean: the separate
path-to-regexp@0.2.5entry is removed and the^1.7.0range and1.9.0pin are merged into a single resolved entry, reducing lock file duplication. - The
path-to-regexp@3.3.0entry (used by other dependents) is left untouched since it was already a separately patched version.
One observation worth noting
The security advisory recommends upgrading to 8.0.0 as the most complete fix (it removes the problematic features entirely), while 1.9.0 adds backtrack protection but still retains legacy behavior. However, since this dependency lives under docs/ (the documentation site, not the core .NET test framework), the attack surface is limited to the docs build/serve tooling rather than production runtime code. Jumping to a major version like 8.x would require API migration work and is likely not worth the effort for a docs-only dependency. The 1.9.0 choice is pragmatic and appropriate for this context.
Verdict
Good to merge. The fix addresses the CVE without introducing unnecessary churn.
There was a problem hiding this comment.
Security Dependency Update Review
This PR updates the path-to-regexp resolution in docs/package.json from 0.2.5 to 1.9.0 to address CVE-2024-45296 (ReDoS vulnerability).
Summary
The change is correct and appropriate. The vulnerability allows a crafted URL path to trigger catastrophic backtracking in generated regular expressions when two parameters appear in a single path segment (e.g., /:a-:b), potentially causing a Denial of Service in JavaScript-based routing.
What looks good
- The fix targets the right package and bumps to a patched version (1.9.0 is listed as a safe version for the 1.x series).
- The yarn.lock consolidation is clean: the separate
path-to-regexp@0.2.5entry is removed and the^1.7.0range and1.9.0pin are merged into a single resolved entry, reducing lock file duplication. - The
path-to-regexp@3.3.0entry (used by other dependents) is left untouched since it was already a separately patched version.
One observation worth noting
The security advisory recommends upgrading to 8.0.0 as the most complete fix (it removes the problematic features entirely), while 1.9.0 adds backtrack protection but still retains legacy behavior. However, since this dependency lives under docs/ (the documentation site, not the core .NET test framework), the attack surface is limited to the docs build/serve tooling rather than production runtime code. Jumping to a major version like 8.x would require API migration work and is likely not worth the effort for a docs-only dependency. The 1.9.0 choice is pragmatic and appropriate for this context.
Verdict
Good to merge. The fix addresses the CVE without introducing unnecessary churn.
Security Dependency Update ReviewThis PR updates the SummaryThe change is correct and appropriate. The vulnerability allows a crafted URL path to trigger catastrophic backtracking in generated regular expressions when two parameters appear in a single path segment (e.g., What looks good
One observation worth notingThe security advisory recommends upgrading to VerdictGood to merge. The fix addresses the CVE without introducing unnecessary churn. |
06ddf73 to
53f5a62
Compare
There was a problem hiding this comment.
Code Review
This is a security patch PR generated by Renovate Bot, upgrading path-to-regexp from 0.2.5 to 1.9.0 to address CVE-2024-45296 (ReDoS vulnerability).
Summary
The change is limited to the docs/ directory tooling — it does not touch the core .NET TUnit library at all. The risk surface here is low (would require malicious requests to the docs server), but patching known CVEs is still good hygiene.
Changes Look Correct
docs/package.json: Theresolutionsoverride forexpress/path-to-regexpis bumped from0.2.5→1.9.0. Using a Yarn resolution override is the right approach here sinceexpressitself depends on this transitively.docs/yarn.lock: The oldpath-to-regexp@0.2.5entry is removed andpath-to-regexp@^1.7.0now resolves to1.9.0(which includes the backtrack protection fix). Thepath-to-regexp@3.3.0entry is retained unchanged — just reordered alphabetically, which is expected lockfile churn.
One Minor Note
The CVE advisory recommends upgrading to 8.0.0 for the most complete fix (version 8.x removes the problematic features entirely), while 1.9.0 adds backtrack protection as a patch to the 1.x line. For a resolutions override of a transitive express dependency, jumping to 8.0.0 could cause breaking API changes if express actually calls path-to-regexp APIs that were removed in v8. 1.9.0 is the appropriate conservative choice here — it resolves the vulnerability without risking runtime breakage in the docs toolchain.
Verdict
The change is correct, minimal, and addresses the reported vulnerability appropriately. Looks good to merge.
There was a problem hiding this comment.
Security patch for CVE-2024-45296 (ReDoS in path-to-regexp). Change is correct, scoped to docs tooling only, and uses an appropriate conservative version bump. Looks good to merge.
53f5a62 to
ff11df2
Compare
There was a problem hiding this comment.
Code Review (follow-up)
This PR has already received thorough reviews and an approval from prior runs. No new changes have been introduced since the last review. The previous analysis stands:
- The resolution bump from → correctly addresses CVE-2024-45296 (ReDoS).
- The yarn.lock changes are clean and internally consistent.
- Scope is limited to tooling — no impact on the core .NET TUnit library.
- is the appropriate conservative choice for a transitive dependency resolution override (avoids API breakage that could introduce).
No new issues found. Good to merge.
Updated [TUnit.Core](https://github.com/thomhurst/TUnit) from 1.23.7 to 1.28.7. <details> <summary>Release notes</summary> _Sourced from [TUnit.Core's releases](https://github.com/thomhurst/TUnit/releases)._ ## 1.28.7 <!-- Release notes generated using configuration in .github/release.yml at v1.28.7 --> ## What's Changed ### Other Changes * fix: prevent StringBuilder race in console interceptor during parallel tests by @thomhurst in thomhurst/TUnit#5414 ### Dependencies * chore(deps): update tunit to 1.28.5 by @thomhurst in thomhurst/TUnit#5415 **Full Changelog**: thomhurst/TUnit@v1.28.5...v1.28.7 ## 1.28.5 <!-- Release notes generated using configuration in .github/release.yml at v1.28.5 --> ## What's Changed ### Other Changes * perf: eliminate redundant builds in CI pipeline by @thomhurst in thomhurst/TUnit#5405 * perf: eliminate store.ToArray() allocation on mock behavior execution hot path by @thomhurst in thomhurst/TUnit#5409 * fix: omit non-class/struct constraints on explicit interface mock implementations by @thomhurst in thomhurst/TUnit#5413 ### Dependencies * chore(deps): update tunit to 1.28.0 by @thomhurst in thomhurst/TUnit#5406 **Full Changelog**: thomhurst/TUnit@v1.28.0...v1.28.5 ## 1.28.0 <!-- Release notes generated using configuration in .github/release.yml at v1.28.0 --> ## What's Changed ### Other Changes * fix: resolve build warnings in solution by @thomhurst in thomhurst/TUnit#5386 * Perf: Optimize MockEngine hot paths (~30-42% faster) by @thomhurst in thomhurst/TUnit#5391 * Move Playwright install into pipeline module by @thomhurst in thomhurst/TUnit#5390 * perf: optimize solution build performance by @thomhurst in thomhurst/TUnit#5393 * perf: defer per-class JIT via lazy test registration + parallel resolution by @thomhurst in thomhurst/TUnit#5395 * Perf: Generate typed HandleCall<T1,...> overloads to eliminate argument boxing by @thomhurst in thomhurst/TUnit#5399 * perf: filter generated attributes to TUnit-related types only by @thomhurst in thomhurst/TUnit#5402 * fix: generate valid mock class names for generic interfaces with non-built-in type args by @thomhurst in thomhurst/TUnit#5404 ### Dependencies * chore(deps): update tunit to 1.27.0 by @thomhurst in thomhurst/TUnit#5392 * chore(deps): update dependency path-to-regexp to v8 by @thomhurst in thomhurst/TUnit#5378 **Full Changelog**: thomhurst/TUnit@v1.27.0...v1.28.0 ## 1.27.0 <!-- Release notes generated using configuration in .github/release.yml at v1.27.0 --> ## What's Changed ### Other Changes * Fix Dependabot security vulnerabilities in docs site by @thomhurst in thomhurst/TUnit#5372 * fix: use 0.0.0-scrubbed sentinel version in snapshot scrubber to avoid false Dependabot alerts by @thomhurst in thomhurst/TUnit#5374 * Speed up Engine.Tests by removing ProcessorCount parallelism cap by @thomhurst in thomhurst/TUnit#5379 * ci: add concurrency groups to cancel redundant workflow runs by @thomhurst in thomhurst/TUnit#5373 * Add scope-aware initialization and disposal OpenTelemetry spans to trace timeline and HTML report by @Copilot in thomhurst/TUnit#5339 * Add WithInnerExceptions() for fluent AggregateException assertion chaining by @thomhurst in thomhurst/TUnit#5380 * Drop net6.0 and net7.0 TFMs, keep net8.0+ and netstandard2.x by @thomhurst in thomhurst/TUnit#5387 * Remove all [Obsolete] members and migrate callers by @thomhurst in thomhurst/TUnit#5384 * Add AssertionResult.Failed overload that accepts an Exception by @thomhurst in thomhurst/TUnit#5388 ### Dependencies * chore(deps): update dependency mockolate to 2.3.0 by @thomhurst in thomhurst/TUnit#5370 * chore(deps): update tunit to 1.25.0 by @thomhurst in thomhurst/TUnit#5371 * chore(deps): update dependency minimatch to v9.0.9 by @thomhurst in thomhurst/TUnit#5375 * chore(deps): update dependency path-to-regexp to v0.2.5 by @thomhurst in thomhurst/TUnit#5376 * chore(deps): update dependency minimatch to v10 by @thomhurst in thomhurst/TUnit#5377 * chore(deps): update dependency picomatch to v4 by @thomhurst in thomhurst/TUnit#5382 * chore(deps): update dependency svgo to v4 by @thomhurst in thomhurst/TUnit#5383 * chore(deps): update dependency path-to-regexp to v1 [security] by @thomhurst in thomhurst/TUnit#5385 **Full Changelog**: thomhurst/TUnit@v1.25.0...v1.27.0 ## 1.25.0 <!-- Release notes generated using configuration in .github/release.yml at v1.25.0 --> ## What's Changed ### Other Changes * Fix missing `default` constraint on explicit interface implementations with unconstrained generics by @thomhurst in thomhurst/TUnit#5363 * feat(mocks): add ReturnsAsync typed factory overload with method parameters by @thomhurst in thomhurst/TUnit#5367 * Fix Arg.IsNull<T> and Arg.IsNotNull<T> to support nullable value types by @thomhurst in thomhurst/TUnit#5366 * refactor(mocks): use file-scoped types for generated implementation details by @thomhurst in thomhurst/TUnit#5369 * Compress HTML report JSON data and minify CSS by @thomhurst in thomhurst/TUnit#5368 ### Dependencies * chore(deps): update tunit to 1.24.31 by @thomhurst in thomhurst/TUnit#5356 * chore(deps): update dependency mockolate to 2.2.0 by @thomhurst in thomhurst/TUnit#5357 * chore(deps): update dependency polyfill to 9.24.1 by @thomhurst in thomhurst/TUnit#5365 * chore(deps): update dependency polyfill to 9.24.1 by @thomhurst in thomhurst/TUnit#5364 **Full Changelog**: thomhurst/TUnit@v1.24.31...v1.25.0 ## 1.24.31 <!-- Release notes generated using configuration in .github/release.yml at v1.24.31 --> ## What's Changed ### Other Changes * Fix Aspire 13.2.0+ timeout caused by ProjectRebuilderResource being awaited by @Copilot in thomhurst/TUnit#5335 * chore(deps): update dependency polyfill to 9.24.0 by @thomhurst in thomhurst/TUnit#5349 * Fix nullable IParsable type recognition in source generator and analyzer by @Copilot in thomhurst/TUnit#5354 * fix: resolve race condition in HookExecutionOrderTests by @thomhurst in thomhurst/TUnit#5355 * Fix MaxExternalSpansPerTest cap bypass when Activity.Parent chain is broken by @Copilot in thomhurst/TUnit#5352 ### Dependencies * chore(deps): update tunit to 1.24.18 by @thomhurst in thomhurst/TUnit#5340 * chore(deps): update dependency stackexchange.redis to 2.12.14 by @thomhurst in thomhurst/TUnit#5343 * chore(deps): update verify to 31.15.0 by @thomhurst in thomhurst/TUnit#5346 * chore(deps): update dependency polyfill to 9.24.0 by @thomhurst in thomhurst/TUnit#5348 **Full Changelog**: thomhurst/TUnit@v1.24.18...v1.24.31 ## 1.24.18 <!-- Release notes generated using configuration in .github/release.yml at v1.24.18 --> ## What's Changed ### Other Changes * feat(mocks): shorter, more readable generated mock type names by @thomhurst in thomhurst/TUnit#5334 * Fix DisposeAsync() ordering for nested property injection by @Copilot in thomhurst/TUnit#5337 ### Dependencies * chore(deps): update tunit to 1.24.13 by @thomhurst in thomhurst/TUnit#5331 **Full Changelog**: thomhurst/TUnit@v1.24.13...v1.24.18 ## 1.24.13 <!-- Release notes generated using configuration in .github/release.yml at v1.24.13 --> ## What's Changed ### Other Changes * perf(mocks): optimize MockEngine for lower allocation and faster verification by @thomhurst in thomhurst/TUnit#5319 * Remove defunct `UseTestingPlatformProtocol` reference for vscode by @erwinkramer in thomhurst/TUnit#5328 * perf(aspnetcore): prevent thread pool starvation during parallel WebApplicationTest server init by @thomhurst in thomhurst/TUnit#5329 * fix TUnit0073 for when type from from another assembly by @SimonCropp in thomhurst/TUnit#5322 * Fix implicit conversion operators bypassed in property injection casts by @Copilot in thomhurst/TUnit#5317 * fix(mocks): skip non-virtual 'new' methods when discovering mockable members by @thomhurst in thomhurst/TUnit#5330 * feat(mocks): IFoo.Mock() discovery with generic fallback and ORP resolution by @thomhurst in thomhurst/TUnit#5327 ### Dependencies * chore(deps): update tunit to 1.24.0 by @thomhurst in thomhurst/TUnit#5315 * chore(deps): update aspire to 13.2.1 by @thomhurst in thomhurst/TUnit#5323 * chore(deps): update verify to 31.14.0 by @thomhurst in thomhurst/TUnit#5325 ## New Contributors * @erwinkramer made their first contribution in thomhurst/TUnit#5328 **Full Changelog**: thomhurst/TUnit@v1.24.0...v1.24.13 ## 1.24.0 <!-- Release notes generated using configuration in .github/release.yml at v1.24.0 --> ## What's Changed ### Other Changes * perf: optimize TUnit.Mocks hot paths by @thomhurst in thomhurst/TUnit#5304 * fix: resolve System.Memory version conflict on .NET Framework (net462) by @thomhurst in thomhurst/TUnit#5303 * fix: resolve CS0460/CS0122/CS0115 when mocking concrete classes from external assemblies by @thomhurst in thomhurst/TUnit#5310 * feat(mocks): parameterless Returns() and ReturnsAsync() for async methods by @thomhurst in thomhurst/TUnit#5309 * Fix typo in NUnit manual migration guide by @aa-ko in thomhurst/TUnit#5312 * refactor(mocks): unify Mock.Of<T>() and Mock.OfPartial<T>() into single API by @thomhurst in thomhurst/TUnit#5311 * refactor(mocks): clean up Mock API surface by @thomhurst in thomhurst/TUnit#5314 * refactor(mocks): remove generic/untyped overloads from public API by @thomhurst in thomhurst/TUnit#5313 ### Dependencies * chore(deps): update tunit to 1.23.7 by @thomhurst in thomhurst/TUnit#5305 * chore(deps): update dependency mockolate to 2.1.1 by @thomhurst in thomhurst/TUnit#5307 ## New Contributors * @aa-ko made their first contribution in thomhurst/TUnit#5312 **Full Changelog**: thomhurst/TUnit@v1.23.7...v1.24.0 Commits viewable in [compare view](thomhurst/TUnit@v1.23.7...v1.28.7). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This PR contains the following updates:
0.2.5→1.9.0GitHub Vulnerability Alerts
CVE-2024-45296
Impact
A bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (
.). For example,/:a-:b.Patches
For users of 0.1, upgrade to
0.1.10. All other users should upgrade to8.0.0.These versions add backtrack protection when a custom regex pattern is not provided:
They do not protect against vulnerable user supplied capture groups. Protecting against explicit user patterns is out of scope for old versions and not considered a vulnerability.
Version 7.1.0 can enable
strict: trueand get an error when the regular expression might be bad.Version 8.0.0 removes the features that can cause a ReDoS.
Workarounds
All versions can be patched by providing a custom regular expression for parameters after the first in a single segment. As long as the custom regular expression does not match the text before the parameter, you will be safe. For example, change
/:a-:bto/:a-:b([^-/]+).If paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length. For example, halving the attack string improves performance by 4x faster.
Details
Using
/:a-:bwill produce the regular expression/^\/([^\/]+?)-([^\/]+?)\/?$/. This can be exploited by a path such as/a${'-a'.repeat(8_000)}/a. OWASP has a good example of why this occurs, but the TL;DR is the/aat the end ensures this route would never match but due to naive backtracking it will still attempt every combination of the:a-:bon the repeated 8,000-a.Because JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and can lead to a DoS. In local benchmarks, exploiting the unsafe regex will result in performance that is over 1000x worse than the safe regex. In a more realistic environment using Express v4 and 10 concurrent connections, this translated to average latency of ~600ms vs 1ms.
References
Release Notes
pillarjs/path-to-regexp (path-to-regexp)
v1.9.0: Fix backtracking in 1.xCompare Source
Fixed
925ac8ere.exec(&#​39;/test/route&#​39;)result (#267)32a14b0v1.8.0: Backport token to function optionsCompare Source
Added
TokensToFunctionOptionsv1.7.0Compare Source
delimiteroption to be passed in withtokensToRegExpwhich will be used for "non-ending" token match situationsv1.6.0Compare Source
RegExp.keyswhen using thetokensToRegExpmethod (making it consistent with the main export)delimiteroption to be passed in withparseKeysandOptionsupdatedv1.5.3Compare Source
\\to the ignore character group to avoid backtracking on mismatched parensv1.5.2Compare Source
\\in string segments of regexpv1.5.1Compare Source
index.d.tsto NPM packagev1.5.0Compare Source
v1.4.0Compare Source
v1.3.0Compare Source
/:foo?-bar)v1.2.1Compare Source
v1.2.0Compare Source
*) as an unnamed match everything group ((.*))v1.1.1Compare Source
v1.1.0Compare Source
v1.0.3Compare Source
filestopackage.jsonv1.0.2Compare Source
Array.isArrayshimv1.0.1Compare Source
v1.0.0Compare Source
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.