Android security tags, read closely by Lightrion

CVE-2023-45781 AI-generated analysis

platform/packages/modules/Bluetooth, system/main/shim (GD shim utilities, GAP/advertising data parsing)

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

Adds a bounds check in parse_gap_data (system/main/shim/utils.cc). If a GAP data element's length byte points past the end of raw_data, parsing now stops instead of copying out of bounds.

Root cause

parse_gap_data walks raw_data as a sequence of length-prefixed GAP elements. For each element it read len = raw_data[offset], built iterators begin = raw_data.begin() + offset and end = begin + len + 1, and copied [begin, end) into a new vector. The only check was the loop condition offset < raw_data.size(). The per-element length was never compared against the remaining bytes. So a len larger than the remaining buffer produced an end iterator past raw_data.end(), and the copy (std::vector range construction) read out of bounds.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to December 2023 · Findings