Repository navigation
Add MASTG content for Android 14 accessibilityDataSensitive protection - #3679
Open
cpholguera with Copilot wants to merge 19 commits into
Open
cpholguera with Copilot wants to merge 19 commits into
cpholguera with Copilot wants to merge 19 commits into
Conversation
- Created Knowledge page MASTG-KNOW-0108 for accessibilityDataSensitive - Created Best Practice MASTG-BEST-0029 for marking UI views as sensitive - Created Test MASTG-TEST-0321 for static detection - Created Test MASTG-TEST-0322 for dynamic verification - Created Demo MASTG-DEMO-0083 demonstrating detection with semgrep - Created semgrep rule for static analysis Co-authored-by: cpholguera <29175115+cpholguera@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add new MASTG test for marking sensitive data in UI views
Add MASTG content for Android 16 accessibilityDataSensitive protection
Jan 31, 2026
added 16 commits
October 24, 2026 12:01
…DataSensitive attribute and updated recommendation
…DataSensitive attribute
…el for accessibilityDataSensitive attribute and enhance validation guidance with Further Validation
…add-mastg-test-for-accessibility
…sensitive views and adjust API level references
…riting guidelines, enhance accessibility data sensitivity explanation and add accessibility tools
… accessibility data sensitivity
…ines and adjust available_since value
…s and enhance detection messages
cpholguera
marked this pull request as ready for review
October 25, 2026 17:42
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.
Adds MASTG content for Android's accessibility data sensitivity feature. Apps can mark views as accessibility data sensitive so that only accessibility services declared as accessibility tools (
android:isAccessibilityTool="true"), such as screen readers, can read or interact with them. Other accessibility services, including malware that tricks users into enabling it, are denied access to these views. Views that setfilterTouchesWhenObscured="true"are treated as sensitive automatically, and children inherit the protection from a sensitive parent.The APIs (
setAccessibilityDataSensitive,isAccessibilityDataSensitive, and theACCESSIBILITY_DATA_SENSITIVE_*constants) were added in Android 14 (API level 34). Google's Android Developers Blog presents the feature as an Android 16 defense, but all content here uses API level 34 based on the official API reference.All content is linked to MASWE-0040 (Sensitive Data Leaked via Accessibility Services) (MASWE v1.0.0) and uses fake IDs (
0x01,0x02) to avoid collisions with master.Changes
Knowledge (MASTG-KNOW-0x01)
AUTO/YES/NOvalues, automatic behavior throughfilterTouchesWhenObscuredand parent inheritance, accessibility tools, and platform version considerations.Best Practice (MASTG-BEST-0x01)
ACCESSIBILITY_DATA_SENSITIVE_NOon sensitive views.isAccessibilityTooldeclarations.Tests
[static, code, manual]): References to accessibility data sensitivity APIs in code and layout files. Notes that views the app never configures don't appear in static output, and points to the dynamic test for confirmation.[dynamic, hooks, manual]): Runtime verification. Hooks the setters (@MASTG-TECH-0043), obtains the UI hierarchy of each sensitive screen with the effectiveisAccessibilityDataSensitivevalue of each view (@MASTG-TECH-0x01), and takes a screenshot per screen (@MASTG-TECH-0x02). Warns thatuiautomator dumpcan't be used to verify this protection.Both tests include a "Further Validation Required" block, since automated tools can't reliably decide whether a screen shows sensitive data.
Demos
YES, implied throughfilterTouchesWhenObscured, inherited from a payment container, and explicitNOoverriding the container). Includes validated reverse-engineered code and semgrep output.Rule
rules/mastg-android-accessibility-data-sensitive.yaml: DetectssetAccessibilityDataSensitivecalls (with a WARNING forACCESSIBILITY_DATA_SENSITIVE_NO),setFilterTouchesWhenObscuredcalls, and the corresponding XML attributes.Techniques
uiautomator dump, Maestro,dumpsys activity top, Layout Inspector, view enumeration with Frida, and a custom accessibility service. Explains what each method reveals and why most of them can't verify accessibility data sensitivity (for example, UI Automator and Maestro still list protected views).Tools
Validation
uiautomator dump,dumpsys activity top, and Maestro results described in MASTG-TECH-0x01 were checked on the same device.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
semgrep.dev/home/REDACTED/.local/bin/pysemgrep osemgrep --config ../../../../rules/mastg-android-accessibility-data-sensitive.yaml activity_login.xml --text MASWE-0069 0.md rep MASWE-0069(dns block)/home/REDACTED/.local/bin/pysemgrep osemgrep --config ../../../../rules/mastg-android-accessibility-data-sensitive.yaml MastgTest.kt --text MASWE-0069 2.md p/bin/grep MASWE-0069(dns block)/home/REDACTED/.local/bin/pysemgrep osemgrep --config ../../../../rules/mastg-android-accessibility-data-sensitive.yaml activity_login.xml --text MASWE-0069 4.md ndor/bin/grep MASWE-0069(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.