Platform & Code (PC2)

Platform & Code
2

जब ऐप बैकग्राउंड में जाता है, तो ऐप द्वारा स्वतः उत्पन्न स्क्रीनशॉट के माध्यम से Andrew संवेदनशील डेटा को उजागर कर सकता है

How to play?

## Scenario: Andrew can expose sensitive data through the app's auto-generated screenshots when the app moves to the background

Consider a scenario where Andrew works at a busy co-working space and uses a banking app on his phone. Like most people, Andrew switches between apps frequently - checking messages, jumping on calls, and occasionally glancing at his bank balance. What Andrew does not know is that every time he presses the home button, the OS kindly takes a screenshot of whatever was on his screen and stores it as a preview thumbnail for the app switcher. It is a smooth UX feature. It is also a smooth data leak.

There are various ways Andrew's sensitive data can be exposed through these cached screenshots.

  1. If Andrew's phone is left on the desk unlocked, a curious colleague can simply swipe up to the app switcher and see a pixel-perfect snapshot of Andrew's last banking screen - account number, balance and all - without ever opening the app or needing a password.
  2. On a rooted Android or jailbroken iOS device, an attacker or a piece of malware can silently extract these cached screenshots from the filesystem without triggering any authentication prompt.
  3. If Andrew's phone is lost or stolen, the thief does not need to break into the banking app. A quick swipe through the app switcher can reveal sensitive data from multiple apps at once.

Example

Andrew had just checked his salary slip on his banking app when his phone buzzed with a meeting notification. He hit the home button and rushed to the conference room, leaving his phone unlocked on his desk. His colleague Priya, who had been eyeing Andrew's snack drawer for weeks, picked up his phone to borrow a charger. While doing so, she accidentally swiped into the app switcher and was greeted by a crisp screenshot of Andrew's banking screen, complete with his account balance and last three transactions. Priya now knows exactly how many snacks Andrew can afford. Andrew's dignity did not survive the standup meeting that followed.

Threat Modeling

STRIDE

This scenario falls under the Information Disclosure category in the STRIDE threat modeling framework.

Sensitive data is exposed passively through the OS screenshot caching mechanism without any active exploitation of authentication or encryption controls. The app fails to prevent the OS from capturing and storing its screen contents during the background transition, causing an unintended data leak.

What can go wrong?

If the app does not suppress screenshots or clear sensitive UI content before moving to the background, the OS will cache a snapshot of the last visible screen. This image can be accessed through the app switcher by anyone holding an unlocked device, or extracted programmatically from storage on a rooted or jailbroken device. The exposed data could include account numbers, messages, medical records, credentials or any other sensitive information visible at the time the app was backgrounded.

What are we going to do about it?

  • On Android, set the FLAG_SECURE window flag to prevent the OS from capturing screenshots of the app at any time, including during background transitions.
  • On iOS, add a privacy overlay view in the applicationWillResignActive lifecycle method and remove it in applicationDidBecomeActive to ensure the OS snapshot captures only a blank or branded screen.
  • Alternatively, navigate the app to a neutral or login screen before it enters the background state so that no sensitive content is visible when the snapshot is taken.
  • Test for this vulnerability explicitly during security reviews by backgrounding the app mid-session on both rooted and non-rooted devices and inspecting the app switcher preview.

Mappings

MASVS: PLATFORM-3

MASTG: TEST-0010,TEST-0059

CAPEC™: 37,155,498,648

SAFECode™: -

No attacks registered!

OWASP Cornucopia

OWASP Cornucopia is a mechanism in the form of a card game to assist software development teams identify security requirements in Agile, conventional and formal development processes. It is language, platform and technology-agnostic, and is free to use. OWASP Cornucopia is licensed under the Creative Commons Attribution-ShareAlike 4.0 license, so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar licence to this one.

© 2012-2025 OWASP Foundation. The Open Worldwide Application Security Project (OWASP) is a nonprofit foundation that works to improve the security of software.