Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions tests-beta/android/MASVS-PRIVACY/MASTG-TEST-0224.md
Copy link
Collaborator

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 or TYPE_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.

Copy link
Collaborator Author

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

Copy link
Collaborator

Choose a reason for hiding this comment

The 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,31 @@
---
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.

- [`textNoSuggestions`](https://developer.android.com/reference/android/widget/TextView#attr_android:inputType:~:text=the%20performance%20reasons.-,textNoSuggestions,-80001)
- [`textPassword`](https://developer.android.com/reference/android/widget/TextView#attr_android:inputType)
- [`textVisiblePassword`](https://developer.android.com/reference/android/widget/TextView#attr_android:inputType:~:text=_URI.-,textVisiblePassword,-91)
- [`numberPassword`](https://developer.android.com/reference/android/widget/TextView#attr_android:inputType:~:text=_DECIMAL.-,numberPassword,-12)
- [`textWebPassword`](https://developer.android.com/reference/android/widget/TextView#attr_android:inputType:~:text=_ADDRESS.-,textWebPassword,-e1)

## Steps
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from the original test:

Finally, check the minimum required SDK version in the Android Manifest (android:minSdkVersion) since it must support the used constants (for example, Android SDK version 11 is required for textWebPassword). Otherwise, the compiled app would not honor the used input type constants allowing keyboard caching.

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. Run a static analysis tool such as @MASTG-TOOL-0018 or @MASTG-TOOL-0011 on the APK looking for uses of any of the above attributes.

## 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.
2 changes: 2 additions & 0 deletions tests/android/MASVS-STORAGE/MASTG-TEST-0006.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ title: Determining Whether the Keyboard Cache Is Disabled for Text Input Fields
masvs_v1_levels:
- L1
- L2
status: deprecated
covered_by: [MASTG-TEST-0224]
---

## Overview
Expand Down