Automatically securing permission-based software by reducing the attack surface: an application to Android

Alexandre Bartel, Jacques Klein, Yves Le Traon, Martin Monperrus · DOI

Abstract

Android's permission-based security model often suffers from a "permission gap"—a discrepancy between the permissions an application declares and those it actually requires. This paper introduces COPES, a static analysis tool designed to detect these gaps by mapping the Android framework and application bytecode. By identifying over-privileged applications, COPES provides a systematic approach to reducing the mobile attack surface.

Introduction

Android applications must explicitly declare access to sensitive resources like the camera or GPS. However, due to poor documentation or developer caution, many apps are "over-provisioned." This creates a significant security risk: if an app with unused permissions is compromised, the attacker gains unauthorized access to those resources. The authors define this as a "permission gap," analogous to leaving unnecessary ports open on a firewall.

Methodology

The researchers formalized the detection of permission gaps using boolean matrix algebra. They represent the relationship between applications and permissions through a Permission Access Matrix ($M$), an Access Vector ($AV_{app}$), and an Inferred Permission Vector ($IP_{app} = AV_{app} \times M$).

To construct these, two primary tools were developed:

  1. The Mapper: Utilizes the Soot framework and Spark pointer analysis to perform static analysis on the Android framework. It constructs call graphs to locate Permission Enforcement Points (PEPs)—the specific code locations where the system validates a permission request.
  2. The Sniffer: Analyzes application bytecode to identify which framework methods are invoked.
Call graph analysis identifying Permission Enforcement Points (PEPs) across Application and Framework layers.

The analysis accounts for complex Android-specific mechanisms, such as Binder-based Inter-Process Communication (IPC) and string analysis for permission identifiers.

Evaluation and Results

The study analyzed the Android v2.2 framework (126,660 methods) and two large application datasets: 742 apps from an alternative market (Freewarelovers) and 679 from the official Android Market.

Key Findings

  • Framework Mapping: COPES identified 9,562 framework methods requiring at least one permission.
  • Prevalence of Over-privilege: Permission gaps were found in 12.7% of apps from the alternative market and 18.3% from the official market.
  • Gap Magnitude: While most over-privileged apps lacked only one required permission, some exhibited gaps of four or more.

Validation

COPES was validated against previous dynamic analysis research (Felt et al.). As shown in the table below, COPES matched dynamic results for 82.3% of methods and identified additional required permissions in 17.7% of cases that dynamic testing missed. This supports the authors' claim that static analysis provides a more comprehensive "upper bound" for security.

Comparison of permission checks identified by COPES vs. previous dynamic analysis methods.

Discussion and Limitations

Static analysis offers a significant advantage over dynamic testing by capturing code paths that might not be triggered during standard execution. However, COPES faces limitations with applications using reflection, dynamic class loading, or native C/C++ code (NDK), as these break the static call graph. The authors suggest that the "true" required permission set likely lies between the lower bound found by dynamic testing and the upper bound found by static analysis.

Conclusion

COPES demonstrates that static analysis is a viable and powerful method for identifying permission gaps in the Android ecosystem. By automatically detecting over-privileged applications, it offers a path toward a more secure, principle-of-least-privilege environment for mobile software.

Summary updated

BibTeX
@inproceedings{bartel2012automatically,
  author = {Alexandre Bartel and Jacques Klein and Yves Le Traon and Martin Monperrus},
  title = {{Automatically securing permission-based software by reducing the attack surface: an application to Android}},
  booktitle = {ASE},
  year = {2012},
  doi = {10.1145/2351676.2351722},
}
Figure