CVE-2022-20540 Use after free in Android

High 7.8 Published Updated

A use-after-free flaw in Android's SurfaceFlinger allows local attackers to execute arbitrary code and escalate privileges without user interaction.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2022-20540?

CVE-2022-20540 is a high-severity use after free vulnerability in Google Android, published on 16 Dec 2022. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In SurfaceFlinger::doDump of SurfaceFlinger.cpp, there is possible arbitrary code execution due to a use after free. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.Product: AndroidVersions: Android-13Android ID: A-237291506

Weakness: CWE-416

Which versions are affected by CVE-2022-20540?

It affects 1 product.

Products include Google Android.

How do I fix CVE-2022-20540?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2022-20540 being exploited?

There is no known exploitation of CVE-2022-20540 in the wild and no public exploit code.

All Google Android vulnerabilities

Sources

Also known as A-237291506, GHSA-r82j-jh5g-vq2g, PUB-A-237291506.

Is CVE-2022-20540 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free