imgproxyのBMP読み込みで細工画像によりヒープ領域を超えて書き込まれる不具合
概要
imgproxy v4.0.11のカスタムBMPローダーに、ヒープバッファオーバーフローの脆弱性があります。細工されたBMP画像を処理させると、プロセスが異常終了してサービスが停止する可能性があります。修正版はv4.0.12以降ですので、アップデートしてください。
AI要約
外部の AI が作成した要約です。誤りを含むことがあります。重要な判断の前に、下の原文と参照URLを確認してください。
imgproxy v4.0.11のカスタムBMPローダーに、ヒープバッファオーバーフローの脆弱性があります。細工されたBMP画像を処理させると、プロセスが異常終了してサービスが停止する可能性があります。修正版はv4.0.12以降ですので、アップデートしてください。
影響パッケージ
| 種類 | パッケージ | 影響を受ける版 | 直った版 |
|---|---|---|---|
| go | github.com/imgproxy/imgproxy/v4 |
>= 4.0.0, <= 4.0.11 |
>= 4.0.12 |
原文の説明 取得元が公開している説明をそのまま載せています (多くは英語)。
The decoder accepts arbitrary BMP bit depths for uncompressed BI_RGB input, routes every value greater than or equal to 24 through its 24/32-bit row generator, allocates a row buffer sized for at most four bytes per pixel, and then reads a row sized from the attacker-controlled bit depth. The inconsistent allocation and read invariants allow source-image bytes to be written beyond the native heap allocation.
I confirmed the memory-safety defect by compiling the exact v4.0.11 loader with AddressSanitizer. At width 512, a valid 32-bpp BMP uses a 2,052-byte row buffer, reads 2,048 bytes, and completes normally. A matched 40-bpp input retains the same 2,052-byte allocation but performs a 2,560-byte write. ASan reports a 508-byte heap-buffer-overflow at the first byte after the allocation.
I separately reproduced terminal availability impact using the immutable official v4.0.11 container image and its documented HTTP processing route. One request for a crafted 65535-bpp BMP caused a fatal SIGSEGV in runtime.memmove, with the stack continuing through AsyncBuffer.ReadAt and vips.imgproxyReaderRead. The entire imgproxy process exited with status 2; both /health and processing of a safe image became unavailable. Restarting the same container restored normal processing. No live or third-party system was tested.
The overwrite bytes and length are attacker controlled. Two bounded, non-weaponized canonical-marker experiments against the unmodified official image did not dem…
出典: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV
参照URL
- GITHUB_REPO_ADVISORY imgproxy/imgproxy