Android security tags, read closely by Lightrion

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

Adds a bounds check in parse_gap_data (system/main/shim/utils.cc). When a GAP data element's declared length is larger than the bytes left in the buffer, parsing now stops instead of copying past the end of raw_data.

Root cause

parse_gap_data walks raw_data as a sequence of length-prefixed GAP elements. It read the length byte at raw_data[offset], then built a copy from raw_data.begin() + offset to begin + len + 1. It never checked that offset + len + 1 fits within raw_data.size(). A malformed length value therefore made the vector copy (std::make_shared<std::vector<uint8_t>>(begin, end)) read past the end of the input buffer. The bulletin classifies this as information disclosure.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to December 2023 · Findings