Descrizione
In all versions of PyTorch's TorchServe, a predictable extraction directory in /tmp lets a local user swap the model handler and run code as the TorchServe service account leading to local privilege escalation.
Come correggere
Priorità: Media — correggere nel prossimo ciclo di patch. Motivazione: CVSS 7.8, EPSS 0.1% (percentile 4).
Versioni da aggiornare
- PyTorch TorchServe: vulnerabile la versione
0→ installare l'ultima release supportata dal vendor.
Indicazioni del vendor
Soluzione (testo originale del vendor):
The project is archived and currently no permanent solution is scheduled for release. See workaround section.
Workaround (testo originale del vendor):
Three independent fixes: * Set TEMP (or pass -Djava.io.tmpdir) to a directory the service account owns and that is not world-writable. * Harden the systemd unit with PrivateTmp=yes, so /tmp is namespaced per service. * At the code level, extract into a directory owned by the service account and refuse to reuse a pre-existing extraction root that the service does not own, instead of forceMkdir-ing into whatever is already there.
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 |
|---|---|---|---|
| PyTorch | TorchServe | 0 | — |
Riferimenti
- Riferimentohttps://christbowel.com/blog/torchserve-lpe/
- Riferimentohttps://github.com/Christbowel/torchserve-lpe