Descrizione
stable-diffusion.cpp is a pure C/C++ library for running diffusion model (Stable Diffusion, Flux, Wan, Qwen Image, Z-Image, and more) inference. Prior to master-764-e22272e, the safetensors loader in src/model_io/safetensors_io.cpp trusts each tensor's data_offsets after checking only that nbytes equals end - begin. A crafted .safetensors file can declare a byte range beyond the file's data section, causing src/model_loader.cpp to consume an attacker-chosen length from an unchecked mapped-file offset. Loading the model can read adjacent process memory into tensor buffers or crash the process. This issue is fixed in master-764-e22272e.
Come correggere
Priorità: Bassa — correggere con la manutenzione ordinaria. Motivazione: CVSS 6.9, EPSS 0.1% (percentile 3).
Versioni da aggiornare
Il record non riporta ancora i prodotti e le versioni corrette (analisi NVD in corso). Consultare l'advisory del vendor nei riferimenti.
Mitigazioni temporanee
Da applicare solo se non è possibile aggiornare subito:
- Ridurre la superficie esposta (disattivare servizi e funzionalità inutilizzati), mantenere attive le protezioni del sistema operativo (ASLR, DEP/NX) e segmentare la rete.
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.
Riferimenti
- Riferimentohttps://github.com/leejet/stable-diffusion.cpp/commit/e22272ee631b742dab4440c18eb8fcafb0689402
- Riferimentohttps://github.com/leejet/stable-diffusion.cpp/pull/1754
- Riferimentohttps://github.com/leejet/stable-diffusion.cpp/releases/tag/master-764-e22272e
- Riferimentohttps://github.com/leejet/stable-diffusion.cpp/security/advisories/GHSA-v2m4-h57v-fr6w
- Riferimentohttps://github.com/leejet/stable-diffusion.cpp/security/advisories/GHSA-v2m4-h57v-fr6w