Android security tags, read closely by Lightrion

CVE-2024-40662 AI-generated analysis

platform/frameworks/base, core/java/android/net/Uri.java (Uri.Builder)

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

Uri.Builder.scheme(String) in android.net.Uri now removes every "://" sequence from a non-null scheme before storing it, so a caller-supplied scheme can no longer carry that scheme delimiter into the built Uri.

Root cause

Uri.Builder.scheme(String scheme) assigned the argument directly to this.scheme with no validation. A scheme value containing "://" (for example "http://https://evil.com:/te:st/", the value used in the new test) was accepted and ended up in the built Uri's scheme and in its serialized "<scheme>://<authority>..." form. That form then holds extra delimiters ahead of the real authority set with authority(). The material does not show how a consumer misuses this.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to September 2024 · Findings