Android security tags, read closely by Lightrion

CVE-2024-34727 AI-generated analysis

platform/packages/modules/Bluetooth, Bluetooth stack SDP (system/stack/sdp)

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.

Adds discovery-attribute length checks to sdpu_compare_uuid_with_attr (system/stack/sdp/sdp_utils.cc). A UUID is now compared with a tSDP_DISC_ATTR only when SDP_DISC_ATTR_LEN matches the UUID size (2, 4 or 16 bytes). Otherwise the function logs an error and returns false.

Root cause

sdpu_compare_uuid_with_attr chose the comparison width only from the local Uuid's shortest representation size (GetShortestRepresentationSize). It never checked the discovery attribute's encoded length (SDP_DISC_ATTR_LEN(p_attr->attr_len_type)). On the 128-bit path it ran memcmp over Uuid::kNumBytes128 (16) bytes of p_attr->attr_value.v.array whatever the attribute's actual size. The commit message says a fuzzer found a heap-buffer overflow (an out-of-bounds comparison) and that it comes from comparing a 128-bit UUID with a discovery attribute of some other, invalid size. The 16-bit and 32-bit paths also read attr_value.v.u16 and v.u32 without checking that the attribute held a 2-byte or 4-byte value.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to August 2024 · Findings