stable-diffusion.cppの脆弱性、細工したsafetensorsで メモリ外の読み取りのおそれ
Summary
stable-diffusion.cppのsafetensors読み込み処理に、テンソルのデータ範囲を検証しない脆弱性が見つかりました。細工したモデルファイルを読み込むと、範囲外のメモリが読まれたり、プロセスが異常終了したりするおそれがあります。master-764-e22272e以降で修正されているため、最新の情報を確認してください。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
stable-diffusion.cppのsafetensors読み込み処理に、テンソルのデータ範囲を検証しない脆弱性が見つかりました。細工したモデルファイルを読み込むと、範囲外のメモリが読まれたり、プロセスが異常終了したりするおそれがあります。master-764-e22272e以降で修正されているため、最新の情報を確認してください。
Original description The description as published by the source.
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.
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory github.com
- advisory nvd.nist.gov
- patch github.com
- patch github.com
- REDHAT Red Hat
- web github.com