本文へ移動
English version →
重大 9.8

imgproxy ICOローダーの整数オーバーフローで遠隔からコードを実行されるおそれ

GHSA-hff9-5pqw-6w9f SecPulse初出

概要

imgproxyのICO読み込み処理で整数オーバーフローが起き、ヒープバッファオーバーフローを経て、遠隔からサービス停止やコード実行を引き起こされるおそれがあります。影響を受けるのはgo向けのgithub.com/imgproxy/imgproxy/v4で、4.0.16以降に更新してください。

AI要約

外部の AI が作成した要約です。誤りを含むことがあります。重要な判断の前に、下の原文と参照URLを確認してください。

imgproxyのICO読み込み処理で整数オーバーフローが起き、ヒープバッファオーバーフローを経て、遠隔からサービス停止やコード実行を引き起こされるおそれがあります。影響を受けるのはgo向けのgithub.com/imgproxy/imgproxy/v4で、4.0.16以降に更新してください。

影響パッケージ

種類パッケージ影響を受ける版直った版
go github.com/imgproxy/imgproxy/v4
>= 4.0.0, <= 4.0.15
>= 4.0.16
原文の説明 取得元が公開している説明をそのまま載せています (多くは英語)。

Summary

The ICO loader allocates data_size + BMP_FILE_HEADER_LEN bytes after reading a 32-bit attacker-controlled data_size. For data_size > UINT32_MAX - BMP_FILE_HEADER_LEN, the addition wraps before allocation. imgproxy then writes the ICO prefix and reads up to the original declared size starting 14 bytes into the undersized allocation. A network client can turn this heap overflow into remote denial of service or remote code execution.

Technical details

The vulnerable path is in vips/icoload.c at commit f4fedbb:

uint32_t data_size = GUINT32_FROM_LE(largest_image_header.data_size);

VipsPel *data = (VipsPel *) VIPS_MALLOC(NULL, data_size + BMP_FILE_HEADER_LEN);
void *actual_data = data + BMP_FILE_HEADER_LEN;

if (vips_foreign_load_read_full(ico->source, actual_data, data_size) <= 0) {
  vips_error("vips_foreign_load_ico_header", "unable to read ICO image data from the source");
  return -1;
}

The crafted directory entry contains:

data_size       = 0xfffffff5 (4294967285)
data_offset     = 22
BMP header size = 14
32-bit result   = (0xfffffff5 + 14) mod 2^32 = 3

The allocation is therefore three bytes. actual_data points 14 bytes after the allocation base. The fixture contains 64 bytes after the ICO header, so the source callback copies those 64 bytes to an invalid destination before it can report that the declared multi-…

出典: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV

参照URL

当サイトでは、アクセス解析と広告の効果測定のために Cookie を使います。株式会社Game のサイト共通の設定です。 詳しく