ANT-2026-M5V8FQ8Z · osgeo/gdal

heap-buffer-overflow high

Severity Claude high · Security research firm high · Maintainer -

Discovered by Claude Mythos Preview

REPORT

Anthropic's analysis, sealed at approval. Disclosure to the maintainer was performed by Ada Logics.

ANT-2026-M5V8FQ8Z: Heap-buffer-overflow in jdcolor12.c:154

When GDAL's MRF driver decodes a 12-bit JPEG-compressed tile, DecompressJPEG12() passes a 52,000-byte page buffer (allocated via MRFDataset::SetPBuffer) to libjpeg12. During ycc_rgb_convert() the decoder writes 2 bytes immediately past the end of that heap buffer, indicating the output buffer was sized too small for the JPEG scanline dimensions/components embedded in the tile. An attacker who can supply a crafted MRF dataset controls the embedded JPEG parameters and thus the mismatch, yielding an out-of-bounds heap write on file open/read.

Target

Project: gdal
Location: jdcolor12.c:154

Technical Details

ASAN: "WRITE of size 2 at 0x755091cecf20 ... 0 bytes after 52000-byte region". The MRF page buffer allocated in SetPBuffer() is undersized relative to what jpeg_read_scanlines_12 → sep_upsample → ycc_rgb_convert emits, so the color-conversion loop writes past the allocation boundary.

Crash trace (truncated — full trace in attached crash.log):

INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 3168514504
INFO: Loaded 1 modules   (1158076 inline 8-bit counters): 1158076 [0x64883d0bfa60, 0x64883d1da61c), 
INFO: Loaded 1 PC tables (1158076 PCs): 1158076 [0x64883d1da620,0x64883e3861e0), 
/out/mrf_fuzzer: Running 1 inputs 1 time(s) each.
Running: /tmp/poc
EXIT_CODE:1


=== ASAN Report ===
=================================================================
==27==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x755091cecf20 at pc 0x6488361c5e2c bp 0x7ffe4e4f3f90 sp 0x7ffe4e4f3f88
WRITE of size 2 at 0x755091cecf20 thread T0
    #0 0x6488361c5e2b in ycc_rgb_convert /src/gdal/build/frmts/jpeg/libjpeg12/jdcolor12.c:154:24
    #1 0x6488361ca3ed in sep_upsample /src/gdal/build/frmts/jpeg/libjpeg12/jdsample12.c:129:3
    #2 0x6488361c8f9f in process_data_simple_main /src/gdal/build/frmts/jpeg/libjpeg12/jdmainct12.c:367:3
    #3 0x64883617faaa in jpeg_read_scanlines_12 /src/gdal/build/frmts/jpeg/libjpeg12/jdapistd12.c:173:3
    #4 0x648835c545a8 in GDAL_MRF::JPEG_Codec::DecompressJPEG12(GDAL_MRF::buf_mgr&, GDAL_MRF::buf_mgr const&) /src/gdal/frmts/mrf/JPEG_band.cpp:767:13
    #5 0x64883684ad15 in GDAL_MRF::MRFRasterBand::IReadBlock(int, int, void*) /src/gdal/frmts/mrf/mrf_band.cpp:1204:18
    #6 0x648835d1ed8e in GDALRasterBand::GetLockedBlockRef(int, int, int) /src/gdal/gcore/gdalrasterband.cpp:2048:20
    #7 0x648835e7bc2f in GDALRasterBand::IRasterIO(GDALRWFlag, int, int, int, int, void*, int, int, GDALDataType, long long, long long, GDALRasterIOExtraArg*) /src/gdal/gcore/rasterio.cpp:299:27
    [... 30 more frames — full trace in crash.log]

Reproduction

Reproduce against the target as described under Technical Details.

[No reproducer or sanitizer output attached — request from security-cvd@anthropic.com if needed.]

Acknowledgement

This vulnerability was discovered by Claude, Anthropic's AI assistant, and triaged by the Anthropic security team in collaboration with Anthropic Research. Please direct questions to security-cvd@anthropic.com and reference ANT-2026-M5V8FQ8Z.


Reference: ANT-2026-M5V8FQ8Z
Anthropic CVD Policy: https://www.anthropic.com/coordinated-vulnerability-disclosure

SECURITY RESEARCH FIRM ANALYSIS

Triage and disclosure were performed by Ada Logics.

Verdict
true positive
Severity
high
TIMELINE

Dates from discovery through public reveal.

  1. 2026-03-24 Reported to tracker
  2. 2026-05-13 Sent to maintainer
  3. 2026-05-13 Maintainer acknowledged
  4. 2026-06-04 Patch released
  5. 2026-08-17 Publicly revealed
PROVENANCE

SHA-3-512 hash:

e6cc19222dcb2ec3ff52e9fbb51725083e11624a3f053cbfb1bbad09c45964d75d34dfdca14a84f65528245fb490fa4180d100e492fb07c4572217b1b603363e

Committed 2026-05-13 10:55 PT

Revealed 2026-08-17 16:28 PT

Verify (download preimage.json)

Show preimage JSON
{
  "ant_id": "ANT-2026-M5V8FQ8Z",
  "bug_class": "Heap-buffer-overflow",
  "claude_severity": "high",
  "commit_sha": null,
  "created_at": "2026-03-24T18:45:05+00:00",
  "description": "When GDAL's MRF driver decodes a 12-bit JPEG-compressed tile, DecompressJPEG12() passes a 52,000-byte page buffer (allocated via MRFDataset::SetPBuffer) to libjpeg12. During ycc_rgb_convert() the decoder writes 2 bytes immediately past the end of that heap buffer, indicating the output buffer was sized too small for the JPEG scanline dimensions/components embedded in the tile. An attacker who can supply a crafted MRF dataset controls the embedded JPEG parameters and thus the mismatch, yielding an out-of-bounds heap write on file open/read.",
  "discovered_at": null,
  "location": "jdcolor12.c:154",
  "poc_sha256": null,
  "preimage_version": 1,
  "project": "gdal",
  "reproduction": null,
  "technical_details": "ASAN: \"WRITE of size 2 at 0x755091cecf20 ... 0 bytes after 52000-byte region\". The MRF page buffer allocated in SetPBuffer() is undersized relative to what jpeg_read_scanlines_12 → sep_upsample → ycc_rgb_convert emits, so the color-conversion loop writes past the allocation boundary.",
  "title": "Heap-buffer-overflow in jdcolor12.c:154",
  "vendor_severity": "high"
}