Android security tags, read closely by Lightrion

CVE-2024-40658 AI-generated analysis

platform/frameworks/av, libstagefright OMX software video decoder (media/libstagefright/omx/SoftVideoDecoderOMXComponent.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 (6 corrections). Verify against the commit before relying on it.

Adds a size consistency check in SoftVideoDecoderOMXComponent::getConfig for kDescribeHdr10PlusInfoIndex. It rejects a client-supplied nParamSize larger than the trailing storage described by nSize, before the HDR10+ info is memcpy'd into outParams->nValue.

Root cause

In SoftVideoDecoderOMXComponent::getConfig, case kDescribeHdr10PlusInfoIndex, the only check on the client-supplied DescribeHDR10PlusInfoParams was isValidOMXParam(outParams). The code then treated the client-controlled outParams->nParamSize as the capacity of the trailing nValue array: if nParamSize >= info->size(), it ran memcpy(outParams->nValue, info->data(), info->size()). Nothing checked that offsetof(DescribeHDR10PlusInfoParams, nValue) + nParamSize fits within the declared structure size nSize. A caller could therefore claim an nParamSize larger than the space described by nSize, and the memcpy could write past the declared end of the params structure.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to September 2024 · Findings