Abstract
To investigate the status quo of SEAndroid policy customization, we propose SEPAL, a universal tool to automatically retrieve and examine customized policy rules. SEPAL applies NLP techniques and employs a trained Wide&Deep model to precisely predict whether a rule is unregulated. Our evaluation shows SEPAL is effective, practical, and scalable. It successfully identified 7,111 unregulated policy rules with a low false positive rate from 595,236 customized rules extracted from 774 Android firmware images across 72 manufacturers. We further discover that the policy customization problem is worsening in newer Android versions (e.g., around 8% for Android 7 and nearly 20% for Android 9). We conduct a deep study on why these rules are introduced and how they compromise user devices, with several findings confirmed by major vendors.
Introduction
Security-Enhanced Android (SEAndroid) serves as the Mandatory Access Control (MAC) layer, providing a critical defense-in-depth mechanism for the Android ecosystem. While the Android Open Source Project (AOSP) provides a robust base policy, Original Equipment Manufacturers (OEMs) must customize these policies to support proprietary hardware and services. This customization process often introduces "unregulated rules"—permissions that are overly permissive, deprecated, or intended only for debugging—which can be exploited to bypass system security. Because there are millions of these rules across thousands of device models, manual vetting is no longer feasible.
Methodology: The SEPAL Framework
SEPAL treats the identification of unregulated rules as a recommendation system problem, leveraging both historical AOSP data and semantic information from developer comments. The workflow consists of three primary stages:
- Atomic Rule Collection: To address policy fragmentation across Android versions, SEPAL decomposes complex OEM rules into "atomic rules"—the smallest possible units consisting of one subject, one object, one class, and one permission.
- Feature Extraction: SEPAL extracts multiple feature types, including attribute features, User ID features, and NLP-based semantic features.
- Wide&Deep Classification: A Wide&Deep model is employed to classify rules. The "Wide" component (a linear model) memorizes safe patterns from AOSP, while the "Deep" component (a Neural Network) generalizes to identify suspicious customizations.
NLP-Based Feature Extraction
A key innovation in SEPAL is the use of Natural Language Processing to understand the intent behind policy rules. Standard analysis usually ignores the semantic context. SEPAL uses dependency parsing and WordNet to analyze the comments left by developers in the source code. It extracts "Subject-Verb-Object" triplets (e.g., "Allow apps to send dump information") to understand the semantic context of a rule, helping distinguish between legitimate functional requirements and dangerous over-privilege.
Large-Scale Evaluation and Results
The researchers evaluated SEPAL using a massive dataset of 774 stock firmware images from 72 manufacturers, covering Android versions 5 through 9. This dataset yielded nearly 600,000 customized rules, which were expanded into roughly 3.5 million atomic rules for analysis.
SEPAL achieved a 98.5% accuracy rate, significantly outperforming the previous state-of-the-art (EASEAndroid) by 15%. The analysis uncovered 7,111 unique unregulated rules. Notably, the study revealed a "security regression": the prevalence of unregulated rules increased from approximately 8% in Android 7 to nearly 20% in Android 9.
Key Insights and Security Impact
The study identifies several critical trends in SEAndroid customization:
- The Project Treble Paradox: While intended to modularize the OS, Project Treble has complicated policy synchronization, leading to an increase in deprecated or misused attributes.
- Common Pitfalls: Unregulated rules often stem from the misuse of broad attributes (e.g.,
appdomain), leftover debugging rules in production builds, and granting third-party apps access to sensitive system services. - Real-World Exploits: Proof-of-concept attacks demonstrated that these rules could be used to bypass screen locks and access cameras without user permission on retail devices. Major vendors, including ASUS and Huawei, have confirmed these findings and begun patching the vulnerabilities.
Conclusion
SEPAL demonstrates that automated, NLP-enhanced analysis is essential for maintaining the integrity of SEAndroid policies at scale. As OEM customizations continue to grow in complexity, tools like SEPAL provide a necessary check against the introduction of silent security backdoors. Future work will focus on automated policy patching to help manufacturers remediate these vulnerabilities efficiently.
Summary updated