CVE-2021-39670: Local PDoS in WallpaperManager.java
Summary
CVE-2021-39670: In setStream of WallpaperManager.java, there is a possible way to cause a permanent DoS due to improper input validation. Affects platform/frameworks/base across 2 version ranges.
>= 12:0, < 12:2022-05-01
>= 12L:0, < 12L:2022-05-01
Fixed in 12:2022-05-01. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The WallpaperManager.java is a component of the Android platform's base framework. It is responsible for managing the device's wallpaper, allowing users to set and customize their device's background image. The WallpaperManager provides various methods for setting wallpapers, including setStream, which allows users to set a wallpaper from a data stream. This vulnerability affects the WallpaperManager's setStream method in Android versions 12 and 12L.
Vulnerability Detail
The setStream method in WallpaperManager.java lacks proper input validation, enabling an attacker with user execution privileges to cause a permanent denial of service (DoS) on the affected device. By setting a large wallpaper using setStream, an attacker can trigger a local DoS condition without requiring any user interaction. This vulnerability has a high severity rating and can lead to a complete loss of functionality on the affected device.
How To Fix
Minimum fixed version
12:2022-05-01
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a workaround, users can avoid setting large wallpapers using the setStream method. Instead, they can use other methods provided by the WallpaperManager to set wallpapers, such as setResource or setBitmap. These alternative methods have proper input validation and are not affected by this vulnerability. Here is an example of setting a wallpaper using the setResource method:
WallpaperManager wallpaperManager = WallpaperManager.getInstance(context);
wallpaperManager.setResource(R.drawable.wallpaper);
Conclusion
The WallpaperManager.java component in the Android platform's base framework is vulnerable to a local denial of service (DoS) attack. By setting a large wallpaper using the setStream method, an attacker with user execution privileges can cause a permanent DoS condition on the affected device. To mitigate this vulnerability, it is recommended to update the Android platform's base framework to version 12 or later. Users can also use alternative methods provided by the WallpaperManager to set wallpapers. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for platform/frameworks/base →
FAQ
This vulnerability allows an attacker to cause a permanent denial of service (DoS) on the affected device by setting a large wallpaper. The device may become unresponsive and require a reboot to recover.
No, user interaction is not required for exploitation. An attacker with user execution privileges can trigger the DoS condition by setting a large wallpaper using the setStream method.
This vulnerability affects Android versions 12 and 12L. Devices running these versions of the Android platform's base framework are vulnerable to the local denial of service (DoS) attack.
Yes, a fix for this vulnerability is available in the Android platform's base framework version 12 and later. It is recommended to update the affected devices to the fixed version to mitigate the risk.
Yes, users can avoid setting large wallpapers using the setStream method. Instead, they can use other methods provided by the WallpaperManager, such as setResource or setBitmap, which are not affected by this vulnerability.
Related vulnerabilities
Recent vulnerabilities recorded for platform/frameworks/base.