Android security tags, read closely by Lightrion

CVE-2024-34721 AI-generated analysis

platform/packages/providers/MediaProvider, MediaProvider insert path generation (cross-user storage volume check)

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

Adds an assertFileColumnsConsistent(match, uri, values) call in MediaProvider.java right after FileUtils.computeDataFromValues(). This covers the case where DATA is generated from values such as RELATIVE_PATH and DISPLAY_NAME, so files can no longer be inserted into another user's storage volume.

Root cause

In MediaProvider.java, the block commented 'Generate path when undefined' runs when ContentValues has no DATA. There, FileUtils.computeDataFromValues() computes DATA from the resolved volume path plus caller-supplied values such as RELATIVE_PATH and DISPLAY_NAME. Per the commit message, inserting into other users' storage volumes was already blocked when DATA was set explicitly, but not when DATA was generated this way. A generated path could therefore land in another user's storage volume. The same file would then exist in both users' MediaProvider databases, and MediaProvider would falsely assume that the user has access to the file.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to July 2024 · Findings