-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Port MASTG-TEST-0006: Determining Whether the Keyboard Cache Is Disabled for Text Input Fields (android) (by @guardsquare) #3055
base: master
Are you sure you want to change the base?
Changes from all commits
d9d3836
a049567
91c26bf
b67cb94
ea448df
13d066c
d441896
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have any demos / could you add one? |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,37 @@ | ||||||||||
--- | ||||||||||
platform: android | ||||||||||
title: Sensitive Data Not Excluded From Keyboard Caching | ||||||||||
id: MASTG-TEST-0224 | ||||||||||
type: [static] | ||||||||||
weakness: MASWE-0053 | ||||||||||
--- | ||||||||||
|
||||||||||
## Overview | ||||||||||
|
||||||||||
This test checks whether the target app prevents the caching of sensitive information entered into text fields. The keyboard may suggest previously entered text when typing in any app on the device. | ||||||||||
|
||||||||||
The following attributes, if present, will prevent the caching mechanism for text inputs. | ||||||||||
|
||||||||||
| XML `android:inputType` | Code `InputType` | API level | | ||||||||||
| -- | --- | - | | ||||||||||
| [`textNoSuggestions`](https://developer.android.com/reference/android/widget/TextView#attr_android:inputType:~:text=the%20performance%20reasons.-,textNoSuggestions,-80001) | [`TYPE_TEXT_FLAG_NO_SUGGESTIONS`](https://developer.android.com/reference/android/widget/TextView#attr_android:inputType:~:text=TYPE_TEXT_FLAG_NO_SUGGESTIONS. "Text input type") | 3 | | ||||||||||
| [`textPassword`](https://developer.android.com/reference/android/widget/TextView#attr_android:inputType:~:text=_SUGGESTIONS.-,textPassword,-81) | [`TYPE_TEXT_VARIATION_PASSWORD`](https://developer.android.com/reference/android/text/InputType#TYPE_TEXT_VARIATION_PASSWORD "Text password input type") | 3 | | ||||||||||
| [`textVisiblePassword`](https://developer.android.com/reference/android/widget/TextView#attr_android:inputType:~:text=_URI.-,textVisiblePassword,-91) | [`TYPE_TEXT_VARIATION_VISIBLE_PASSWORD`](https://developer.android.com/reference/android/text/InputType#TYPE_TEXT_VARIATION_VISIBLE_PASSWORD "Text visible password input type") | 3 | | ||||||||||
| [`numberPassword`](https://developer.android.com/reference/android/widget/TextView#attr_android:inputType:~:text=_DECIMAL.-,numberPassword,-12) | [`TYPE_NUMBER_VARIATION_PASSWORD`](https://developer.android.com/reference/android/text/InputType#TYPE_NUMBER_VARIATION_PASSWORD "A numeric password field") | 11 | | ||||||||||
| [`textWebPassword`](https://developer.android.com/reference/android/widget/TextView#attr_android:inputType:~:text=_ADDRESS.-,textWebPassword,-e1) | [`TYPE_TEXT_VARIATION_WEB_PASSWORD`](https://developer.android.com/reference/android/text/InputType#TYPE_TEXT_VARIATION_WEB_PASSWORD "Text web password input type") | 11 | | ||||||||||
|
||||||||||
Android apps can use XML or code to create the UI. Many apps use both techniques simultaneously. So you should test both. After unpacking the APK with @MASTG-TOOL-0011, the XML files are in `/res/layout` directory. You can search for the code attributes with @MASTG-TOOL-0018. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The section isn't super useful but just for the sake of keeping track of it. We can improve that section later.
Suggested change
|
||||||||||
|
||||||||||
## Steps | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from the original test:
Shouldn't we add this? Maybe we see the constants but the app can be installed on older OS versions where they won't apply. |
||||||||||
|
||||||||||
1. Statically search for the above XML attributes with @MASTG-TOOL-0011 | ||||||||||
|
||||||||||
2. Statically search for above code attributes with @MASTG-TOOL-0018 | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also from the original:
Shouldn't we also check for this here? |
||||||||||
|
||||||||||
## Observation | ||||||||||
|
||||||||||
The output should indicate whether the app uses no-caching attributes. | ||||||||||
|
||||||||||
## Evaluation | ||||||||||
|
||||||||||
The test case fails if any of the text fields in your app accepts sensitive data but do not use no-caching attributes. If the app doesn't use the no-caching attributes at all, this may indicate that it doesn't provide any keyboard caching prevention. |
cpholguera marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
there's an explanation potentially missing here
we need to indicate that these attributes can appear as e.g.
textPassword
orTYPE_TEXT_VARIATION_PASSWORD
depending on ...This is sth. I would not have in the theory but rather in the test because it directly affect how we're going to test.
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.
I added the explanation in the latest commit. PLease have a look