| Título | shader-slang slangpy 6b7c581f Out-of-bounds read |
|---|
| Descrição | 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. |
|---|
| Fonte | ⚠️ https://github.com/shader-slang/slangpy/pull/1239 |
|---|
| Utilizador | m00dy (UID 97162) |
|---|
| Submissão | 21/10/2026 23h12 (há 30 dias) |
|---|
| Moderação | 20/11/2026 09h24 (29 days later) |
|---|
| Estado | Aceite |
|---|
| Entrada VulDB | 441269 [shader-slang slangpy até 0.43.1 EXR Image Loader tinyexr.h tinyexr::DecodePixelData Divulgação de Informação] |
|---|
| Pontos | 20 |
|---|