TL;DR
SEPAL is a large-scale automated analysis tool that uses Natural Language Processing (NLP) and deep learning to identify security-compromising "unregulated rules" in customized Android firmware. By analyzing over 774 firmware images, the researchers discovered that manufacturer-added security policies often break Android's core protections, with the problem surprisingly worsening in newer versions like Android 9.
What Problem Does This Paper Address?
SEAndroid (Security-Enhanced Android) is the "Mandatory Access Control" (MAC) layer that provides the last line of defense in the Android OS. It uses a strict set of rules to ensure that even if a process is compromised, it cannot access sensitive resources (like the camera or kernel drivers) unless explicitly permitted.
While the official Android Open Source Project (AOSP) maintains a solid base policy, device manufacturers (OEMs) like Samsung, Huawei, and Xiaomi must customize these policies to support their specific hardware and features. This customization is a security minefield. Manufacturers often add "unregulated rules"—permissions that are either too broad, unnecessary, or intended only for debugging—which inadvertently open backdoors for attackers. Because there are millions of these rules across thousands of device models, manually vetting them is impossible.
Methods
The authors propose SEPAL (SEAndroid Policy Analyzer), which treats policy analysis as a recommendation system problem. Its workflow consists of three main stages:
- Atomic Rule Collection: To handle "fragmentation" (where rules look different across versions), SEPAL decomposes complex manufacturer rules into "atomic rules"—the smallest possible units consisting of one subject, one object, one class, and one permission.
- Feature Extraction with NLP: Standard analysis usually ignores the "intent" behind a rule. SEPAL uses NLP (specifically 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.
- Wide&Deep Learning: SEPAL employs a "Wide&Deep" model—a technique often used in app stores to recommend apps. The "Wide" part (a linear model) memorizes common, safe patterns from the official AOSP policy, while the "Deep" part (a Neural Network) generalizes to find suspicious outliers in manufacturer customizations.
Datasets
The study is one of the largest of its kind, utilizing:
- 774 stock Android firmware images from 72 different manufacturers.
- Official AOSP policies from Android 5 through Android 9 to serve as the "ground truth" for safe behavior.
- A total of 595,236 customized rules, which were expanded into roughly 3.5 million atomic rules for analysis.
Key Insights and Ideas
- The "Security Regression": One might assume security improves over time. However, SEPAL found that the percentage of unregulated rules actually increased from ~8% in Android 7 to nearly 20% in Android 9.
- The Project Treble Paradox: Google’s Project Treble was designed to make updates easier by separating vendor code from the system. Ironically, this separation seems to have made it harder for vendors to keep their security policies synchronized with the evolving AOSP standards, leading to more "deprecated" or "misused" attributes.
- Comments are Gold: By using NLP to parse developer comments, the researchers could identify the purpose of a rule. This allowed them to catch cases where a rule's code looked standard, but its stated intent revealed it was granting excessive privileges to untrusted domains.
- Common Pitfalls: Most unregulated rules fall into four buckets: misuse of broad attributes (like
appdomain), leaving debugging/testing rules in production builds, failing to remove deprecated rules, and granting third-party apps access to sensitive system services.
Key Results
- High Accuracy: SEPAL achieved 98.5% accuracy in identifying unregulated rules, outperforming the previous state-of-the-art (EASEAndroid) by 15%.
- Massive Discovery: The tool identified 7,111 unique unregulated rules across the dataset.
- Real-World Impact: The authors performed "Proof of Concept" attacks based on their findings. They successfully demonstrated exploits that could bypass screen lock passwords and access the camera without permission on retail devices.
- Vendor Confirmation: After reporting their findings to seven major vendors, four (including ASUS and Huawei) have already confirmed the vulnerabilities and begun patching them.
Limitations and Future Work
- AOSP Dependency: SEPAL relies on the official AOSP policy as a "gold standard." If the official policy itself contains a flaw or an overly permissive rule, the model will learn that behavior as "safe."
- New Vendor Types: The model struggles with entirely new, vendor-specific "types" (labels for files or processes) that have no equivalent in the AOSP baseline.
- Static vs. Dynamic: SEPAL is a static analysis tool. It examines the policy files but does not observe how those policies behave in a live, running system, which might miss certain runtime privilege escalations.
The authors suggest that future work should focus on automated policy patching, helping manufacturers not just find the "mess" in their security rules, but clean it up automatically.
Summary updated