Vulnerability DatabaseGHSA-fcj7-c534-vj7f

GHSA-fcj7-c534-vj7f: 
JavaScript vulnerability analysis and mitigation

Summary

maxParamLength is documented as a guard against ReDoS, but for regex parametric routes (/:id(<regex>)) find-my-way runs the route's regular expression on the full, unbounded path segment and only checks the length of the captured groups afterwards. When the regex does not match, the length check is never reached. An attacker can therefore send an arbitrarily long segment to a route whose regex backtracks badly and block the event loop, regardless of the configured maxParamLength. Plain parametric routes (/:id) are not affected: their length is checked before anything else.

Details

Both lookup paths have the same ordering problem:

  • Interpreter (index.js, Router.prototype.find): currentNode.regex.exec(param) is executed first; matchedParam.length > maxParamLength is only evaluated when the regex matched.
  • Compiled matcher (lib/compiler.js, emitRegexChild): the generated code calls regex.exec(value) and compares capture-group lengths to maxParamLength only inside the !== null branch.

safe-regex2 accepts patterns such as ^(a|aa)+$, so these routes register without needing allowUnsafeRegex. The regression was introduced in v6.0.0. v5.x checked the segment length before running the regex.

Proof of concept

const FindMyWay = require('find-my-way')
const router = FindMyWay({ maxParamLength: 10 })
router.on('GET', '/regex/:id(^(a|aa)+$)', () => {})
const url = '/regex/' + 'a'.repeat(38) + '!'
const t = Date.now()
router.find('GET', url) // null, after several seconds of backtracking
console.log(Date.now() - t, 'ms')

Locally, on main (9.10.0), a 33-byte segment takes about 100 ms and each added character multiplies the time by roughly 1.6, in both interpreter and compileRoutes() mode. The original Fastify report measured about 8.3 s for a 40-byte segment with maxParamLength: 10, compared with about 20 ms for a 414 on a normal parametric route of the same length.

Impact

Denial of service. One request can block the Node.js event loop for seconds, and a few concurrent requests can make the service unavailable. Exploitation requires the application to define a regex route whose pattern backtracks badly, but maxParamLength (and Fastify's routerOptions.maxParamLength) is documented to bound this and does not.

Remediation

Check the raw segment length against maxParamLength before calling regex.exec() in both the interpreter and the compiled matcher.

Credits

Originally reported to Fastify by @vinzabe in GHSA-q52c-7jrj-qxgx.


Source: NVD

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-g78f-3cr8-fhw5MEDIUM6.5
  • JavaScript logoJavaScript
  • imapflow
NoYesNov 15, 2026
GHSA-4j79-qhcg-f5wvMEDIUM6.4
  • JavaScript logoJavaScript
  • systeminformation
NoYesNov 15, 2026
GHSA-fcj7-c534-vj7fMEDIUM5.9
  • JavaScript logoJavaScript
  • find-my-way
NoNoNov 15, 2026
GHSA-chpj-828m-9wj6MEDIUM4.8
  • JavaScript logoJavaScript
  • karakeep
NoYesNov 15, 2026
GHSA-xcgp-hwgr-q92jLOW3.5
  • JavaScript logoJavaScript
  • karakeep
NoYesNov 15, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management