Sensitive Screens Not Protected From Capture

Screens showing sensitive data are not protected, so their content can be captured in screenshots, screen recordings or the app switcher's preview image.

SeverityLow
CVSS 3.12.4 CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N Open in the calculator
CVSS 4.02.4 CVSS:4.0/AV:P/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-212: Improper Removal of Sensitive Information Before Storage or Transfer
MITRE ATT&CKT1113 Screen Capture
CategoryInformation Disclosure

Description

Screens that display sensitive information, such as account details, card numbers, personal data, one-time codes or recovery phrases, are not protected from the operating system's screen capture features. Their content can therefore be recorded in screen recordings and casting sessions, by applications the user has allowed to capture the screen, which may include a malicious one, and in user screenshots, which are saved to the photo library and often synchronised to cloud storage, where anyone who later sees them can obtain the data.

Both platforms also keep an image of each application's last screen for the recent apps or app switcher view, which shows the content to anyone who later sees the switcher. On iOS, the system takes this snapshot as the application moves to the background and stores it in the application's data container, so a sensitive screen that is not hidden first is shown in the switcher and remains on disk, where someone with access to the device's file system, for example through a forensic extraction, can recover it. Exploitation needs physical access, access to the user's photo storage or a malicious application with screen capture consent, so the risk is low for most applications and higher for those showing payment card data, credentials or recovery phrases.

On Android, the weakness is confirmed when screenshots of sensitive screens succeed and the recent apps view shows their content; the decompiled code shows whether FLAG_SECURE is set on the relevant windows. On iOS, it is confirmed by sending the application to the background from a sensitive screen and checking the app switcher, and by examining the stored snapshot images on a test device. The OWASP MASVS covers this under secure use of the user interface.

Remediation

Protect every screen and window that displays sensitive data:

  • On Android, set FLAG_SECURE on the window of each sensitive activity before its content is shown. This blocks screenshots and screen recording, keeps the content off non-secure displays and blanks the recent apps preview. Dialogues and pop-up windows created with the classic view system have their own windows, so check that the flag reaches them too.
  • On iOS, hide or blur sensitive views when the scene is about to resign active or enter the background (sceneWillResignActive(_:) and sceneDidEnterBackground(_:), or the application delegate equivalents), and restore them when it becomes active again, so that the stored snapshot contains no sensitive data.
  • On iOS, watch the screen's isCaptured state and hide sensitive content while the screen is being recorded or mirrored. Apple provides no supported way to block user screenshots, and workarounds that rely on undocumented behaviour can break with any update, so mask the most sensitive values and reveal them only on request.
  • Avoid showing full values where they are not needed, such as complete card numbers.
// Android, in the activity's onCreate, before setContentView window.setFlags( WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE )

Confirm the fix by attempting screenshots and screen recordings on each sensitive screen, and by checking the recent apps view and, on iOS, the stored snapshots.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Mobile Applications Findings

Every Mobile Applications finding