-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Port MASTG-TEST-0005: Determining Whether Sensitive Data Is Shared with Third Parties via Notifications (android) #3464
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: master
Are you sure you want to change the base?
Conversation
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.
Thank you for the creation of this new test case, that looks really good! The code works in the testing app, I could build it in Android Studio and the semgrep rules work too.
I made a few suggestions, please let me know what you think.
Regarding your note:
Note: For the demo notification to be visible (doesn't affect test functionality), we need to grant the POST_NOTIFICATIONS permission, i.e. adb shell pm grant org.owasp.mastestapp android.permission.POST_NOTIFICATIONS (or manually). This does not affect testability. Should that be visible?
It would make sense to point this out in the steps of the demo, in case someone wants to verify the notifications when running the app.
title: App Leaking Sensitive Data via Notifications | ||
id: MASTG-DEMO-xxx // TODO replace with real ID | ||
code: [kotlin] | ||
test: MASTG-TEST-00x05 // TODO replace with real ID |
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.
Including changing the file-name of the demo and test
- L2 | ||
profiles: [L1, L2] | ||
status: deprecated | ||
covered_by: [MASWE-00x05] |
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 test ID also need to be updated.
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.
Thanks! This is intentional. We wait until the PR is about to be merged otherwise we keep having collisions and conflicts.
Co-authored-by: Sven <sven@bsddaemon.org>
Co-authored-by: Sven <sven@bsddaemon.org>
Co-authored-by: Sven <sven@bsddaemon.org>
Co-authored-by: Sven <sven@bsddaemon.org>
Co-authored-by: Sven <sven@bsddaemon.org>
Co-authored-by: Sven <sven@bsddaemon.org>
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.
@sushi2k thanks for the review! Please check my comments.
@sushi2k + @cpholguera Let's allocate the final ID for both demo + test when all other topics are resolved.
rules/mastg-android-sensitive-data-in-notifications-manifest.yml
Outdated
Show resolved
Hide resolved
Co-authored-by: Sven <sven@bsddaemon.org>
Co-authored-by: Sven <sven@bsddaemon.org>
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 test and the corresponding demo should be in PRIVACY (even though it was in Platform before) and we should give them a "privacy" focus. The fact that the app puts PII in notifications isn't considered a leak, the developer is adding that very much intentionally, right? It's not like they could have done something (e.g., configure something) to prevent a "leak". Therefore, this seems like a privacy concern to me.
We consider sensitive data (this page needs improvement): PII, authenticators and cryptographic material. Many (if not most apps) have a legitimate reason to add PII such as contact names, message content, transaction amounts, etc. to notifications. Please consider this when going through the test and demo again.
Suggestion for the test title "PII Exposure via Notifications"
@cpholguera, I see your points. There was the suggestion by @sushi2k to move this to PLATFORM, with whom (based on my best knowledge) I tend to agree. But let's analyse it! Our basis definition is: "sensitive data" = "PIIs" + "other data that a company has defined that should not be public" I tried to think of a few notification examples for the "2nd category":
All those notifications are not PIIs but should be treated confidentially (depending on the company's policy). Now, regarding moving this to PRIVACY, I quote from PLATFORM MASVS:
This fits exactly with the demo/test. Wdyt? |
This means the title could be changed to: "App Exposing Sensitive Data via Notifications", instead of "leaking". As pointed out by Carlos there is no leak as this is purposefully exposed by the developer and is supposed to be read by the user.
But what is the countermeasure against shoulder surfing and showing such data in the UI? You want to mask it, specifically for passwords or credit card data or make an overlay for auto generated screenshots. These are platform mechanisms where a leak would happen if you have no other compensating controls in place. Such data like passwords wouldn't be in a notification, but an OTP and the information you listed in your examples above would be and that need to be readable in a notification which is the context here. It's not really an accidental exposure, but this information is displayed on purpose. Therefore I agree with Carlos that Platform might not be the right choice here, but Privacy is a better solution for it. |
This PR closes #2939
Description
Port mastg test 0005 from v1 to v2 incl. demo
TODO:
Note:✅For the demo notification to be visible (doesn't affect test functionality), we need to grant the POST_NOTIFICATIONS permission, i.e.
adb shell pm grant org.owasp.mastestapp android.permission.POST_NOTIFICATIONS
(or manually). This does not affect testability. Should that be visible?