Android security tags, read closely by Lightrion

CVE-2024-34740 AI-generated analysis

platform/frameworks/libs/modules-utils (BinaryXmlSerializer), platform/frameworks/base (BinaryXmlTest, services/core pm ApkChecksums / PackageInstallerSession)

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

BinaryXmlSerializer.attributeBytesHex and attributeBytesBase64 now throw IOException when the byte array is longer than 65535 (MAX_UNSIGNED_SHORT) instead of writing a truncated 16-bit length followed by the full payload; a later commit linked by the same bug id caps the checksum signature in ApkChecksums.verifySignature at 35 * 1024 bytes.

Root cause

In java/com/android/modules/utils/BinaryXmlSerializer.java, attributeBytesHex() and attributeBytesBase64() emitted the attribute as: type byte, interned name, then mOut.writeShort(value.length) followed by mOut.write(value). The length was never validated against the 16-bit field, so a byte[] longer than 65535 produced a length prefix that did not match the number of bytes actually written. The commit message ("avoid Integer overflow") and the diff show the missing check; the bulletin rates the issue High/EoP.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to August 2024 · Findings