Android security tags, read closely by Lightrion

CVE-2024-0049 AI-generated analysis

platform/frameworks/av, media/libstagefright software VPx OMX encoders (SoftVP8Encoder, SoftVP9Encoder, SoftVPXEncoder)

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 isValidOMXParam() validation at the start of the six VP8/VP9/Android-VPx OMX get/set parameter handlers in the libstagefright software VPx encoders. When the caller-supplied parameter struct fails validation, they now return OMX_ErrorBadParameter and log a SafetyNet event.

Root cause

SoftVP8Encoder::internalGetParameter/internalSetParameter and SoftVP9Encoder::internalGetParameter/internalSetParameter cast the raw OMX_PTR param to OMX_VIDEO_PARAM_VP8TYPE or OMX_VIDEO_PARAM_VP9TYPE. The handlers that receive the cast struct (internalGetVp8Params, internalSetVp8Params, internalGetVp9Params, internalSetVp9Params, and also internalGetAndroidVpxParams and internalSetAndroidVpxParams, which take OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE) immediately read nPortIndex. They then read or write type-specific fields (eProfile, eLevel, nDCTPartitions, nTileColumns, nKeyFrameInterval, a memcpy into nTemporalLayerBitrateRatio, etc.) without first validating the struct with isValidOMXParam(). A parameter buffer that does not match the expected struct can therefore be accessed beyond its bounds.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to March 2024 · Findings