-
-
Notifications
You must be signed in to change notification settings - Fork 5
Add MASWE-0055: Sensitive Data Leaked via Screenshots #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- **Prevent screenshots using the `FLAG_SECURE` API**: On Android, use [`FLAG_SECURE`](https://developer.android.com/security/fraud-prevention/activities#flag_secure) to block screenshots and screen recordings of your app's content | ||
|
||
- **Detect taking a screenshot with `DETECT_SCREEN_CAPTURE` or `sceneCaptureState` API**: Use [`DETECT_SCREEN_CAPTURE`](https://developer.android.com/reference/android/Manifest.permission#DETECT_SCREEN_CAPTURE) on Android or [`sceneCaptureState`](https://developer.apple.com/documentation/uikit/uitraitcollection/scenecapturestate) on iOS to detect when a screenshot is taken, depending on the platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider generalizing this, we have the best practices:
- https://mas.owasp.org/MASTG/best-practices/MASTG-BEST-0014/ (and other related ones)
- iOS still TBD
Also, "detection" doesn't mitigate the weakness, I think. Only "prevention" does, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To append on @cpholguera 's suggestions, one way to mitigate the issue is to not display sensitive data on screen at all (e.g. redact)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for contributing! I have added a few comments to bring this closer to a ready-to-merge state!
@@ -1,5 +1,5 @@ | |||
--- | |||
title: Sensitive Data Leaked via Screenshots | |||
title: Sensitive Data Leaked via Screenshots or Screen Recording |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: Sensitive Data Leaked via Screenshots or Screen Recording | |
title: Sensitive Data Leaked via Screenshots or Screen Recordings |
|
||
## Overview | ||
|
||
Mobile platforms allow users and third-party tools to record screens, which can expose sensitive data and increase the risk of data leakage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's follow the title :) Let's emphasize that this weakness is rather a covert channel for confidentiality breaches.
Mobile platforms allow users and third-party tools to record screens, which can expose sensitive data and increase the risk of data leakage. | |
Mobile platforms allow users and third-party tools to capture screenshots or record screens. Those could act as covert channels that can expose sensitive data and increase the risk of data leakage. |
|
||
- **Loss of Confidentiality**: Under certain conditions, an attacker could access sensitive data previously displayed on the screen, potentially compromising confidentiality and enabling further attacks, such as identity theft or account takeover. | ||
|
||
## Modes of Introduction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This weakness needs a combination of 2 prerequisites:
- The first factor is to display sensitive information in the apps. If no sensitive data displayed, no headache :)
- The second is what you have written below. So I would suggest structuring something like:
## Modes of Introduction | |
## Modes of Introduction | |
- Display sensitive data on UI | |
plus one of the following: | |
- What you have below mode 1 | |
- Mode 2 | |
- ... |
|
||
## Modes of Introduction | ||
|
||
- **Third-party apps with a permission to recording record the screen**: Third-party apps may record the screen while sensitive content is displayed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Third-party apps with a permission to recording record the screen**: Third-party apps may record the screen while sensitive content is displayed. | |
- **Third-party apps with permission to capture or record the screen**: Third-party apps may record the screen while sensitive content is displayed. |
## Modes of Introduction | ||
|
||
- **Third-party apps with a permission to recording record the screen**: Third-party apps may record the screen while sensitive content is displayed. | ||
- **Third-party apps with a permission to access the whole storage**: Third-party apps may access screenshots saved in storage after they are taken by the user or a tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whole storage permission might not actually be required; partial access might be enough. So let's generalise the point to the minimum permission
- **Third-party apps with a permission to access the whole storage**: Third-party apps may access screenshots saved in storage after they are taken by the user or a tool. | |
- **Third-party apps with permission to access the screenshot and recording files**: Third-party apps may access screenshots or recordings saved in storage after they are taken by the user or a tool. |
|
||
- **Third-party apps with a permission to recording record the screen**: Third-party apps may record the screen while sensitive content is displayed. | ||
- **Third-party apps with a permission to access the whole storage**: Third-party apps may access screenshots saved in storage after they are taken by the user or a tool. | ||
- **External tools may record the screen**: Tools such as [scrcpy](https://github.com/Genymobile/scrcpy) and [QuickTime](https://support.apple.com/guide/quicktime-player/welcome/mac) can record the device's screen via a USB connection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might prefer to avoid naming tools in WEs to make them "even more agnostic" and future-proof (tools come and go, weaknesses would remain longer).
At a minimum, we should use markdown links @MASTG-TOOL-0024
- **Prevent screenshots using the `FLAG_SECURE` API**: On Android, use [`FLAG_SECURE`](https://developer.android.com/security/fraud-prevention/activities#flag_secure) to block screenshots and screen recordings of your app's content | ||
|
||
- **Detect taking a screenshot with `DETECT_SCREEN_CAPTURE` or `sceneCaptureState` API**: Use [`DETECT_SCREEN_CAPTURE`](https://developer.android.com/reference/android/Manifest.permission#DETECT_SCREEN_CAPTURE) on Android or [`sceneCaptureState`](https://developer.apple.com/documentation/uikit/uitraitcollection/scenecapturestate) on iOS to detect when a screenshot is taken, depending on the platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To append on @cpholguera 's suggestions, one way to mitigate the issue is to not display sensitive data on screen at all (e.g. redact)
This PR closes OWASP/mastg#2695
There is another MASTG PR that adds TESTs for this weakness.