提出 #1050818: shader-slang slangpy 6b7c581f Out-of-bounds read情報

タイトルshader-slang slangpy 6b7c581f Out-of-bounds read
説明shader-slang/slangpy's EXR image loader (sgl::Bitmap::read_exr in src/sgl/core/bitmap.cpp, which calls LoadEXRImageFromMemory in the vendored external/include/tinyexr.h) contains a heap out-of-bounds read in tinyexr::DecodePixelData when decoding an uncompressed scanline OpenEXR image (TINYEXR_COMPRESSIONTYPE_NONE) with TINYEXR_PIXELTYPE_HALF channels. In external/include/tinyexr.h (lines 5600-5619), under the uncompressed pixel loop (compression == 0), the TINYEXR_PIXELTYPE_UINT (0) and TINYEXR_PIXELTYPE_FLOAT (2) cases both validate that the scanline read stays within the uncompressed input buffer before calling memcpy (if (line_ptr + width * 4 > data_ptr + data_len) return false;), and the HALF -> FLOAT conversion sub-branch also checks if ((x_stride * sizeof(uint16_t)) > data_len) return false;. However, the default HALF -> HALF sub-branch (requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF, which LoadEXRImageFromMemory selects whenever the file header declares a HALF channel) omits the bounds check and executes memcpy(outLine, line_ptr, sizeof(uint16_t) * width) directly. A crafted 295-byte OpenEXR file with compression = NONE, pixel_type = HALF, dataWindow width = 1024, and scanline chunk dataSize = 2 passes all outer header and chunk bounds checks and triggers a 2046-byte heap out-of-bounds read past the end of the input buffer into the decoded bitmap allocation. Fix PR https://github.com/shader-slang/slangpy/pull/1239 adds the missing line_ptr + width * sizeof(uint16_t) > data_ptr + data_len guard.
ソース⚠️ https://github.com/shader-slang/slangpy/pull/1239
ユーザー
 m00dy (UID 97162)
送信2026年10月21日 23:12 (30 日 ago)
モデレーション2026年11月20日 09:24 (29 days later)
ステータス承諾済み
VulDBエントリ441269 [shader-slang slangpy 迄 0.43.1 EXR Image Loader tinyexr.h tinyexr::DecodePixelData 情報漏えい]
ポイント20

Do you need the next level of professionalism?

Upgrade your account now!