A screenshot of the current activity is taken when an app goes into background and displayed for aesthetic purposes when the app returns to the foreground. However, this may leak sensitive information.
- Leak sensitive information.
Be sure to configure the FLAG_SECURE option in the WindowsManager for android apps. For IOS apps include a default background image each time the application is in the background, overriding the current view.
Attacker with access to the unlocked physical device.
⌚ 3600 minutes.
Default score using CVSS 3.1. It may change depending on the context of the src.
Default score using CVSS 4.0. It may change depending on the context of the src.
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE);
setContentView(R.layout.activity_main);
private var backgroundImage: UIImageView?
func applicationDidEnterBackground(_ application: UIApplication) {
let myBanner = UIImageView(image: #imageLiteral(resourceName: "overlayImage"))
myBanner.frame = UIScreen.main.bounds
backgroundImage = myBanner
window?.addSubview(myBanner)
}
func applicationWillEnterForeground(_ application: UIApplication) {
backgroundImage?.removeFromSuperView()
}