#5238·WasmEdge

错误: stable-diffusion image_to_image 缩放中存在 32 位溢出,允许堆缓冲区溢出

作者: prerak09创建于 2026年7月31日更新于 2026年8月6日
标签bug

`SDImageToImage::body` takes `Width` and `Height` as `uint32_t` host-function parameters. The only validation is `parameterCheck`, which requires each to be a multiple of 64 but sets no upper bound. The resize path then computes the output allocation as `ResizedHeight * ResizedWidth * 3` in `int` arithmetic, so a guest can wrap the product to 0, get a non-NULL `malloc(0)` pointer past the null check, and reach `stbir_resize` with a zero-sized destination buffer.

内容来源: WasmEdge/WasmEdge