Descrizione
@fastify/express is a compatibility layer that lets Express middleware run inside the Fastify web framework. In versions 4.0.0 through 4.0.9, the plugin joins a path-scoped middleware's mount path to the Fastify plugin prefix by string concatenation, so when the plugin prefix ends with a slash or the mount path omits its leading slash, the resulting Express mount path does not line up with the route the Fastify router serves. Express then fails to match and passes the request on while the Fastify router still dispatches the route, so the middleware is silently skipped. An application that uses path-scoped Express middleware for authentication or authorization inside a prefixed plugin can expose protected routes to unauthenticated clients, with no crafted request and no non-default option required, and string, array, and regular-expression mount paths are all affected. The issue is fixed in @fastify/express 4.0.10, and users should upgrade to 4.0.10 or later.
Come correggere
Priorità: Alta — pianificare la correzione entro pochi giorni. Motivazione: CVSS 9.1, EPSS 0.5% (percentile 38).
Versioni da aggiornare
- @fastify/express @fastify/express: vulnerabili le versioni dalla
4.0.0precedenti alla4.0.10→ aggiornare alla4.0.10o successiva. - @fastify/express @fastify/express: versione corretta
4.0.10(o successiva).
Mitigazioni temporanee
Da applicare solo se non è possibile aggiornare subito:
- Restringere l'accesso al componente, applicare il principio del minimo privilegio e controllare i log per operazioni non autorizzate.
Verifica
- Individuare tutti gli asset con il prodotto interessato (inventario, scanner di vulnerabilità, CMDB).
- Confrontare la versione installata con quelle indicate sopra.
- Applicare l'aggiornamento in un ambiente di test, poi in produzione; riavviare i servizi se richiesto.
- Ripetere la scansione per confermare la correzione.
Configurazioni interessate
| Vendor | Prodotto | Versioni vulnerabili | Corretta in |
|---|---|---|---|
| @fastify/express | @fastify/express | ≥ 4.0.0 < 4.0.10 | 4.0.10 |
| @fastify/express | @fastify/express | — | 4.0.10 |