ACMiner: Extraction and Analysis of Authorization Checks in Android's Middleware

Sigmund Albert Gorski Iii, Benjamin Andow, Adwait Nadkarni, Sunil Manandhar, William Enck, Eric Bodden, Alexandre Bartel

TL;DR

This paper introduces ACMiner, a novel framework that automates the detection of security vulnerabilities in Android's system services by analyzing authorization checks. By combining program and text analysis with association rule mining, ACMiner significantly reduces the manual effort required to identify these vulnerabilities, uncovering 28 previously unknown security flaws in Android 7.1.1.

What Problem Does This Paper Address?

The Android operating system, used by billions, relies heavily on its middleware for security. While the Android permission model is well-studied, the actual enforcement of these policies within system services has been a significant challenge to analyze. These enforcement mechanisms are often scattered across millions of lines of code, making it difficult for security experts to systematically identify inconsistencies that could lead to vulnerabilities. Prior approaches have been limited by manual effort, incomplete analysis, or coarse-grained methods. This paper aims to bridge this gap by providing a more comprehensive and automated way to evaluate the correctness of access control enforcement in Android's core services.

Methods

ACMiner employs a multi-stage approach:

  • Program and Text Analysis for Authorization Check Extraction: Instead of relying on manually defined checks, ACMiner uses static program analysis to identify potential authorization checks. It focuses on code paths between service entry points and SecurityException throws. It also mines method names, variable names, and strings influencing conditional logic to discover checks.
  • Context Query Identification: To capture checks that don't directly throw SecurityException, ACMiner identifies "context queries" – methods that consistently perform checks. This is achieved through a semi-automated process involving domain expert input and generalized expressions.
  • Association Rule Mining for Consistency Analysis: ACMiner represents authorization checks for each entry point as a set. It then uses association rule mining to find patterns and inconsistencies across entry points within the same service. This helps identify situations where similar entry points have different or missing authorization checks.
  • Refinement and Filtering: To manage the complexity and noise, ACMiner incorporates a semi-automated refinement process for both context queries and control predicates, using domain expert feedback to create generalized expressions and filters.

Datasets

The primary dataset used for evaluation is the Android Open Source Project (AOSP) version 7.1.1_r1. The authors also mention using a Nexus 5X device for building and analyzing this version. No new benchmarks were introduced; the focus was on analyzing existing system code.

Key Insights and Ideas

  • Shifting from Manual to Semi-Automated Analysis: The core innovation is moving away from purely manual identification of authorization checks to a semi-automated approach that significantly scales the analysis.
  • Focusing on Inconsistency as a Proxy for Vulnerability: The paper leverages the intuition that developers are unlikely to intentionally introduce inconsistencies, and these inconsistencies are strong indicators of potential security flaws.
  • Discovering "Hidden" Checks: By analyzing code paths leading to SecurityException and identifying context queries, ACMiner can uncover authorization checks that might be missed by simpler methods.
  • Association Rule Mining for Granular Consistency: Applying association rule mining at a service granularity allows for more precise identification of inconsistencies, suggesting specific checks that are missing or different.
  • The Value of Domain Expertise: While automated, the framework still benefits greatly from domain expert input for refining identified checks and understanding their security relevance.

Key Results

  • Significant Reduction in Analysis Scope: ACMiner reduced the number of entry points requiring manual analysis from 4,004 to just 246 (a 94% reduction).
  • Discovery of 28 Security Vulnerabilities: The analysis uncovered 28 security vulnerabilities in AOSP 7.1.1.
  • 7 were classified as high risk and high impact.
  • 12 were high impact only.
  • 8 were low risk and low impact.
  • Improved Coverage: ACMiner identified 875 unique context queries, a 2552% improvement over the initial 33 used by prior work.
  • Time Efficiency: The mining process for authorization checks took approximately 1 hour and 16 minutes, with an additional 30 minutes for generating HTML reports.
  • Non-Security Inconsistencies: The tool also identified 423 inconsistencies that did not directly lead to security vulnerabilities, but pointed to irregular coding practices or potential future issues.

Limitations and Future Work

  • Consistency Limitation: ACMiner cannot discover vulnerabilities that are consistently implemented across the codebase.
  • Secondary Entry Points: The current analysis does not handle the invocation of secondary entry points from within other entry points.
  • Operator Use: The ordering of authorization checks and improper operator use in control predicates are not currently identified.
  • Domain Expert Reliance: While reduced, the semi-automated approach still requires domain expert participation.
  • Native Code and Runtime Modifications: ACMiner does not analyze native code or runtime modifications like reflection.
  • Future Work: The authors suggest exploring techniques for call graph comparison and method-name comparison to improve entry point grouping, making the analysis more precise by considering relevant arguments and variables, and refining the control predicate filter and context query expressions. They also plan to investigate semantic equivalence between authorization checks.

Summary updated

BibTeX
@inproceedings{iii2019acminer,
  author = {Sigmund Albert Gorski III and Benjamin Andow and Adwait Nadkarni and Sunil Manandhar and William Enck and Eric Bodden and Alexandre Bartel},
  title = {{ACMiner: Extraction and Analysis of Authorization Checks in Android's Middleware}},
  booktitle = {CODASPY},
  year = {2019},
  doi = {10.1145/3292006.3300023},
}
Figure