CVE-2026-112403 is a heap buffer overflow in Pillow's JPEG decoder. The root cause is a mismatch between the buffer size Pillow allocates and the row width libjpeg-turbo actually produces when decoding lossless (SOF3) JPEGs. JpegImageFile.draft() (called automatically by Image.thumbnail()) requests 1/2, 1/4, or 1/8 scaling and shrinks the image size and tile extents accordingly. _setimage() then allocates a single-row decode buffer sized for ceil(W/s) samples. However, libjpeg-turbo 3.x hardwires lossless streams to no scaling and silently discards the requested scale_denom, so it returns full-width W-sample rows. ImagingJpegDecode() calls jpeg_read_scanlines() into the undersized buffer without comparing cinfo.output_width/output_components against state->xsize/state->bytes, causing a contiguous out-of-bounds write of (W - ceil(W/s)) x components bytes per scanline. The fix commit 242a059aedc1935097d9aa1dc3f099750467ba75 adds the missing geometry check in ImagingJpegDecode after jpeg_start_decompress(), confirming that function as the vulnerable code path. The three functions identified are the ones that would appear in a runtime profile or ASan stack trace during exploitation: JpegImageFile.draft (Python setup), _setimage (undersized allocation), and ImagingJpegDecode (overflowing write).