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 で、PyTorch の ckpt モデルファイルを解析する際にヒープバッファオーバーフローが起きる脆弱性です。細工されたファイルを読み込むとプロセスがクラッシュするおそれがあり、状況によってはコードが実行される可能性もあります。修正版は master-584-0a7ae07 です。それまでは信頼できない配布元の ckpt ファイルを読み込まず、safetensors 形式の利用をご検討ください。
ヒープバッファオーバーフローが発生する脆弱性です。
stable-diffusion.cppのPyTorch checkpointファイルのSHORT_BINUNICODEパーサー。
悪意のある.ckptファイルを使用することでプロセスがクラッシュし、場合によってはコード実行が可能になります。
バージョンmaster-584-0a7ae07にアップデートしてください。
信頼できないソースから.ckptファイルをロードしないでください。
脆弱性を持つバージョンのstable-diffusion.cppを使用している場合、信頼できない.ckptファイルをロードすると影響を受けます。
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. Versions prior to master-584-0a7ae07 are vulnerable to heap buffer overflow in SHORT_BINUNICODE parsing for PyTorch checkpoint files. The pickle .ckpt parser in src/model.cpp contained a heap buffer overflow vulnerability in the SHORT_BINUNICODE opcode handler. The issue was caused by sign confusion on the opcode length field. A crafted .ckpt file could trigger memcpy with a very large length derived from a negative signed value, causing immediate heap corruption. Any application using affected stable-diffusion.cpp releases to load untrusted .ckpt model files could be vulnerable. A malicious checkpoint file could cause heap corruption through memcpy with an attacker-controlled length. This may lead to process crash and could potentially be leveraged for code execution depending on heap layout. The attack requires the victim or application to load a .ckpt file from an untrusted source, such as a downloaded model from a model sharing site. The issue has been resolved in version master-584-0a7ae07. If developers are unable to immediately update their applications they can work around this issue by not loading .ckpt checkpoint files from untrusted sources, and referring to trusted model sources and safer formats such as .safetensors where possible.
Source: NIST National Vulnerability Database NVD GitHub Advisory
References
- advisory github.com
- advisory github.com
- advisory nvd.nist.gov
- patch github.com
- patch github.com