fix(deps): update dependency @fastify/middie to v9 [security] #151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^8.3.0→^9.0.0GitHub Vulnerability Alerts
CVE-2026-22031
Summary
A security vulnerability exists in
@fastify/middiewhere middleware registered with a specific path prefix can be bypassed using URL-encoded characters (e.g.,/%61dmininstead of/admin). While the middleware engine fails to match the encoded path and skips execution, the underlying Fastify router correctly decodes the path and matches the route handler, allowing attackers to access protected endpoints without the middleware constraints.Details
The vulnerability is caused by how
middiematches requests against registered middleware paths.middieusespath-to-regexpto generate a regular expression for the path/admin.middieexecutes this regular expression againstreq.url(orreq.originalUrl).req.urlin Fastify contains the raw, undecoded path string./admin)./%61dmin, the regex comparison fails (/^\/admin/does not match/%61dmin).middieassumes the middleware does not apply and callsnext()./%61dminas/adminand executes the corresponding route handler.Incriminated Source Code:
In the provided
middiesource:PoC
Step 1: Run the following Fastify application (save as
app.js):Step 2: Execute the attack.
curl http://localhost:3008/admin # Output: Forbidden: Access to /admin is blockedcurl http://localhost:3008/%61dmin # Output: {"message":"Admin panel"}Impact
@fastify/middieto apply security controls (auth, rate limiting, IP filtering) to specific route prefixes.Release Notes
fastify/middie (@fastify/middie)
v9.1.0Compare Source
What's Changed
New Contributors
Full Changelog: fastify/middie@v9.0.3...v9.1.0
v9.0.3Compare Source
What's Changed
varwithletby @Fdawgs in #218node:prefix for builtins by @Fdawgs in #223Full Changelog: fastify/middie@v9.0.2...v9.0.3
v9.0.2Compare Source
What's Changed
Full Changelog: fastify/middie@v9.0.1...v9.0.2
v9.0.1Compare Source
Security
path-to-regexpis updated to 8.1.0 to prevent ReDOS attack, it is recommended to use the latest version of this package.What's Changed
Full Changelog: fastify/middie@v9.0.0...v9.0.1
v9.0.0Compare Source
What's Changed
nextintomasterby @jsumners in #203New Contributors
Full Changelog: fastify/middie@v8.3.1...v9.0.0
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.