Repository navigation
New Tests and Demos for Accessibility Services and updated Text Input Field Masking - #3965
Draft
cpholguera wants to merge 2 commits into
Draft
cpholguera wants to merge 2 commits into
cpholguera wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new dynamic test for sensitive data exposed through Android accessibility services, and reworks the existing text input masking test around a new knowledge item.
New: Runtime Exposure of Sensitive Data Through Accessibility Services
@MASTG-TEST-0x01 (
tests-beta/android/MASVS-PLATFORM/MASTG-TEST-0x01.md, MASWE-0040,[dynamic, logs, manual], L2): verifies what a running app actually exposes to an enabledAccessibilityService, rather than inferring it from the UI implementation. The tester installs a test service that declarescanRetrieveWindowContent="true"andisAccessibilityTool="false", exercises the sensitive input flows with a known marker value, and records the observedAccessibilityEventandAccessibilityNodeInfoproperties (getText(),getContentDescription(),getHintText(),getStateDescription(),isPassword(), andisAccessibilityDataSensitive()on API 34+).Because it observes the accessibility representation, the test applies to Android Views, Jetpack Compose, and cross-platform frameworks alike. The evaluation section deliberately treats
isPassword()as supporting information only, does not failTextObfuscationMode.RevealLastTypedby itself, and accounts foraccessibilityDataSensitivenodes being withheld from non-tool services on Android 14+.@MASTG-KNOW-0x02 — Accessibility Services (
knowledge/android/MASVS-PLATFORM/MASTG-KNOW-0x02.md): background on accessibility events and nodes,canRetrieveWindowContent, theisAccessibilityToolclassification (API 31+), accessibility data sensitivity (API 34+), Compose password semantics and howisPasswordObfuscatedrelates to (and is separate from) visual masking, the distinction betweenUiAutomation/UI Automator and an app-providedAccessibilityService, and how cross-platform frameworks map onto Android accessibility APIs.@MASTG-DEMO-0x01 — Password Exposed Through Accessibility Metadata (
kind: fail): a victim app with a visually masked password field whose accessibility delegate copies the plaintext into the node's content description.@MASTG-DEMO-0x02 — Accessibility Service Reading Sensitive Input (
kind: attack): the attacker app implementing a non-toolAccessibilityServicethat observes the MASTestApp package and logs the exposed accessibility metadata, plusrun.shto collect the logcat output.Updated: Text Input Field Masking
@MASTG-TEST-0316 is retitled from "App Exposing User Authentication Data in Text Input Fields" to "References to APIs Hiding Sensitive Data in Text Input Fields" and is now linked to the new @MASTG-KNOW-0x01. The API-specific prose and code snippets move out of the test into the knowledge item, so the test focuses on observation and evaluation. The evaluation criteria are broadened beyond Compose to also cover Android View input types and transformations, Compose
TextFieldwithPasswordVisualTransformation, and masking configuration changed programmatically without an intentional user action.@MASTG-KNOW-0x01 — Text Input Field Masking in Android (
knowledge/android/MASVS-PLATFORM/MASTG-KNOW-0x01.md): the Android ViewInputTypepassword variations andPasswordTransformationMethod, Compose secure text fields andTextObfuscationMode,PasswordVisualTransformation, and the recent behavioral changes — theDefault→Systemrename and theBasicSecureTextFielddefault change in Compose Foundation 1.12.0-beta01/1.12.0, and the Material 3 1.5.0-alpha28 switch fromRevealLastTypedtoSystem.This is the reason the old test text was inaccurate: it stated that
SecureTextFielddefaults toRevealLastTyped, which is no longer the case.Open items before merge
MASTG-TEST-0x01,MASTG-KNOW-0x01,MASTG-KNOW-0x02,MASTG-DEMO-0x01, andMASTG-DEMO-0x02(and update the cross-references in the test, demo, and knowledge files accordingly).demos/android/MASVS-PLATFORM/MASTG-DEMO-0x02/output.txtis still a placeholder and must be replaced with a realadb logcat -s MASTG-A11Y:Icapture from a device/emulator run, recording the Android version, IDE version, and device used.AccessibilityServiceInfometadata resource is currently smuggled in throughfilepaths.xml, reusing the only resource file the demo build automation supports replacing. The build automation should be extended with a dedicatedaccessibility_service_config.xmlinstead; this workaround is documented inline in the demo.-[ ] Align with https://github.com/OWASP/mastg/pull/3679/changes
AI Tool Disclosure
Check exactly one option.
If AI tools were used to generate or substantially modify code or text, complete the following.