إرسال #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)
ارسال21/10/2026 11:12 PM (30 أيام منذ)
الاعتدال20/11/2026 09:24 AM (29 days later)
الحالةتمت الموافقة
إدخال VulDB441269 [shader-slang slangpy حتى 0.43.1 EXR Image Loader tinyexr.h tinyexr::DecodePixelData الكشف عن المعلومات]
النقاط20

Want to stay up to date on a daily basis?

Enable the mail alert feature now!