Android security tags, read closely by Lightrion

CVE-2026-59031 AI-generated analysis

platform/frameworks/native, inputflinger InputDispatcher (services/inputflinger/dispatcher/InputDispatcher.cpp)

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.

Replaces the manual erase-while-iterating loop in InputDispatcher::flushSensor with std::erase_if so the iterator is never advanced past end() after erasing the tail element, and restricts the erase to SensorEntry items whose deviceId and sensorType match the arguments.

Root cause

In InputDispatcher::flushSensor, the loop `for (auto it = mInboundQueue.begin(); it != mInboundQueue.end(); it++)` did `it = mInboundQueue.erase(it)` for every entry of type EventEntry::Type::SENSOR and then still ran the loop's `it++`. When the erased sensor entry was the last element of mInboundQueue, erase() returned end() and the increment moved the iterator past end(). The next iteration then dereferenced an invalid iterator (out-of-bounds read / use-after-free, per the commit message). A second logic defect: the loop ignored the deviceId and sensorType parameters and removed every sensor entry in the queue. Because of the double advance, it also skipped the entry right after each erased one.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to November 2026 · Findings