Android security tags, read closely by Lightrion

CVE-2025-65018 AI-generated analysis

platform/external/libpng, simplified read API (pngread.c: png_image_finish_read, png_image_read_direct)

AI-generated: written from the bulletin and the fixing diffs by claude-fable-5-1, then checked against the code by claude-opus-5-5 (5 corrections). Verify against the commit before relying on it.

Fixes a heap buffer overflow in libpng's simplified read API (png_image_finish_read / png_image_read_direct) when a 16-bit PNG is read into an 8-bit output buffer: first by rejecting IHDR/output bit-depth mismatches, then (rearchitected) by routing interlaced 16-to-8 conversions through an intermediate local_row buffer in a new png_image_read_direct_scaled routine.

Root cause

In pngread.c png_image_read_direct, when the PNG's IHDR bit depth is 16 and the caller requests a non-LINEAR (8-bit) output format, png_set_scale_16 is applied and rows are read into the caller's buffer, which was sized with PNG_IMAGE_SIZE(image) for 8-bit components. Per the fix commits, for interlaced images png_combine_row writes into that buffer using the IHDR (16-bit) depth before the 16-to-8 transformation completes, so writes exceed the 8-bit-sized destination (the commit gives 6144 vs 4096 bytes for a 32x32 16-bit RGB to 8-bit RGBA read).

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to June 2026 · Findings