Android security tags, read closely by Lightrion

CVE-2025-0096 AI-generated analysis

platform/hardware/st/nfc, st21nfc NFC HAL (polling loop / firmware log TLV handling, st21nfc/hal/hal_fwlog.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 (4 corrections). Verify against the commit before relying on it.

Enlarges the heap buffer allocated for the FieldOn/FieldOff TLV in handlePollingLoopData from 8 to 9 bytes so that the nine bytes written into it no longer overflow the allocation.

Root cause

In st21nfc/hal/hal_fwlog.cc:handlePollingLoopData, the T_fieldOn/T_fieldOff case allocated *NewTlv with malloc(8 * sizeof(uint8_t)) but then wrote nine bytes into it: a 3-byte header (type, flag, value_len) followed by value_len = 6 payload bytes at indices 3 through 8. The store to (*NewTlv)[8] therefore wrote one byte past the end of the 8-byte heap allocation on every FieldOn/FieldOff event.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to February 2025 · Findings