Android security tags, read closely by Lightrion

CVE-2026-49921 AI-generated analysis

platform/packages/modules/Bluetooth, system/stack/sdp (SDP server: sdp_server.cc, sdp_utils.cc, sdp_db.cc)

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.

Replaces the fixed 400-byte (SDP_MAX_ATTR_LEN) heap buffer in sdpu_build_partial_attrib_entry with an allocation sized to the serialized attribute. It also rejects attributes whose payload exceeds SDP_MAX_ATTR_LEN in that helper, in both SDP server request handlers and at database insertion, and adds an offset-vs-length check before the partial memcpy.

Root cause

sdpu_build_partial_attrib_entry (system/stack/sdp/sdp_utils.cc) allocated exactly SDP_MAX_ATTR_LEN (400) bytes. It then called sdpu_build_attrib_entry to serialize the whole attribute (type/length header plus p_attr->len payload bytes) into that buffer, with no check that the serialized entry fits. The only guard was in the callers process_service_attr_req and process_service_search_attr_req (sdp_server.cc): a check 'attr_len >= SDP_MAX_ATTR_LEN' that existed only in the 'rem_len < attr_len' (first partial send) branch. It was absent from the continuation branch ('if (p_ccb->cont_info.attr_offset)'), which also calls sdpu_build_partial_attrib_entry. In addition, SDP_AddAttributeToRecord (sdp_db.cc) only truncated against the record pad (SDP_MAX_PAD_LEN - free_pad_ptr), so an attribute with a payload longer than SDP_MAX_ATTR_LEN could be stored in the local database. An oversized attribute reaching the helper overflowed the 400-byte heap buffer during serialization. The following memcpy from &p_attr_buff[*offset] could then read beyond the buffer, and the caller check (attr_len < attr_offset) did not reject *offset == attr_len.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to September 2026 · Findings