Android security tags, read closely by Lightrion

CVE-2026-58971 AI-generated analysis

platform/packages/services/BuiltInPrintService, jni libwfds mupdf decode plugin (jni/plugins/wprint_mupdf.c)

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 (4 corrections). Verify against the commit before relying on it.

Adds validation in _mupdf_get_hdr (jni/plugins/wprint_mupdf.c) of the page dimensions returned by the pdf renderer and of pdf_render_resolution so that the scaled width, height and width*height*3 byte count cannot wrap a 32-bit integer before the pixel buffer is malloc'ed, plus NULL checks and a bitmap_ptr allocation-failure path, with a new gtest (libwfds_test).

Root cause

In _mupdf_get_hdr, pageWidth/pageHeight (the page dimensions from the pdf renderer; the test mocks them through getPageAttributes, but the lines that fill them are not shown in the diff) were multiplied by zoom (pdf_render_resolution / 72) and truncated to unsigned int with no range check. The resolution itself was not checked for being positive. The buffer size was then computed as `size = imageWidth * imageHeight * 3` in 32-bit unsigned arithmetic and stored in an int. Large page dimensions or a large resolution therefore wrap the product, and malloc((size_t) size) returns a buffer smaller than the width*height*3 pixel area that image_info->width/height later describe. The second allocation, bitmap_ptr = malloc(width * 3), also had no NULL check.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to November 2026 · Findings