- 履歴一覧
- 差分 を表示
- 現在との差分 を表示
- ソース を表示
- CVE-2025-53101 へ行く。
- 1 (2025-07-16 (水) 17:22:44)
- 2 (2025-07-16 (水) 17:34:00)
- 3 (2025-07-17 (木) 13:59:22)
- CVE-2025-53101 mogrify で %d 記法を複数入れるとオーバーフロー。
- https://nvd.nist.gov/vuln/detail/CVE-2025-53101
ImageMagick is free and open-source software used for editing and manipulating digital images. In versions prior to 7.1.2-0 and 6.9.13-26, in ImageMagick's `magick mogrify` command, specifying multiple consecutive `%d` format specifiers in a filename template causes internal pointer arithmetic to generate an address below the beginning of the stack buffer, resulting in a stack overflow through `vsnprintf()`. Versions 7.1.2-0 and 6.9.13-26 fix the issue.
バージョン7.1.2-0および6.9.13-26より前のバージョンでは、ImageMagickの「magick mogrify」コマンドにおいて、ファイル名テンプレートに連続する「%d」フォーマット指定子を複数指定すると、内部ポインタ演算によってスタックバッファの先頭より下のアドレスが生成され、「vsnprintf()」によってスタックオーバーフローが発生していました。バージョン7.1.2-0および6.9.13-26ではこの問題が修正されています。
不具合再現†
# Clone source git clone --depth 1 --branch 7.1.1-47 https://github.com/ImageMagick/ImageMagick.git ImageMagick-7.1.1 cd ImageMagick-7.1.1 # Build with ASan CFLAGS="-g -O0 -fsanitize=address -fno-omit-frame-pointer" CXXFLAGS="$CFLAGS" LDFLAGS="-fsanitize=address" ./configure --enable-maintainer-mode --enable-shared && make -j$(nproc) && make install # Trigger crash ./utilities/magick mogrify %d%d
==4155==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffda834caae at pc 0x7f1ea367fb27 bp 0x7ffda834b680 sp 0x7ffda834ae10 WRITE of size 2 at 0x7ffda834caae thread T0 (...)
コード修正†
.†
% magick -version Version: ImageMagick 7.1.1-47 Q16-HDRI aarch64 22763 https://imagemagick.org (...) % magick convert rose: rose-%d.png rose-0.png % magick convert rose: rose-%d-%d.png rose0.png % magick convert rose: rose-%d-%d-%d.png ros0.png
% magick convert rose: rose-%d-%d-%d-%d-%d-%d.png 0.png % magick convert rose: rose-%d-%d-%d-%d-%d-%d-%d.png .png % magick convert rose: rose-%d-%d-%d-%d-%d-%d-%d-%d.png -%d.png.png % magick convert rose: rose-%d-%d-%d-%d-%d-%d-%d-%d-%d.png -%d-%d.png-%d.png.png