Descrizione
@fastify/multipart is the official Fastify plugin for handling multipart/form-data uploads. In versions 3.0.0 through 10.1.3, temporary files written by the saveRequestFiles helper are removed only by a response hook that runs when the response finishes or errors. When a client completes an upload and then disconnects before the handler writes the reply, for example while the handler scans, hashes or forwards the file, the response only emits a close event, the cleanup hook never runs, and the saved files are left on disk. An unauthenticated client can repeat this cheaply to exhaust disk space and deny service to applications that save uploaded files to disk. The issue is fixed in @fastify/multipart 10.1.4, and users should upgrade to 10.1.4 or later. As a workaround, avoid saving request files for untrusted clients, or clean the saved files from a close handler on the raw response so removal also happens when the client disconnects.
Come correggere
Priorità: Media — correggere nel prossimo ciclo di patch. Motivazione: CVSS 7.5, EPSS 0.4% (percentile 37).
Versioni da aggiornare
- @fastify/multipart @fastify/multipart: vulnerabili le versioni dalla
3.0.0precedenti alla10.1.4→ aggiornare alla10.1.4o successiva. - @fastify/multipart @fastify/multipart: versione corretta
10.1.4(o successiva).
Mitigazioni temporanee
Da applicare solo se non è possibile aggiornare subito:
- Ridurre l'esposizione del componente vulnerabile (segmentazione, accesso solo da reti fidate) finché la patch non è applicata.
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/multipart | @fastify/multipart | ≥ 3.0.0 < 10.1.4 | 10.1.4 |
| @fastify/multipart | @fastify/multipart | — | 10.1.4 |