arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.04963cs.CR
收藏

搁置而非丢弃:在不修改 APK 的情况下动态裁剪 Android 应用的 DEX 与 Native 方法

Shelving it rather than Ditching it: Dynamically Debloating DEX and Native Methods of Android Applications without APK Modification

Zicheng Zhang, Jiakun Liu, Ferdian Thung, Haoyu Ma, Rui Li, Yan Naing Tun, Wei Minn, Lwin Khin Shar, Shahar Maoz, Eran Toch, David Lo, Joshua Wong, Debin Gao

AI总结:

提出 3DNDroid,通过定制 Android 系统与非特权管理应用依据预生成方案动态拦截 DEX 方法并清零 native 方法内存,实现无需重打包 APK 的安全代码裁剪。

摘要:

如今的 Android 开发者倾向于加入大量功能以满足多样化的用户需求,这不可避免地导致应用臃肿。然而,这些功能中通常只有一小部分会被用户频繁使用,因此臃肿应用会在潜在漏洞、扩大的攻击面以及额外资源消耗方面付出高昂代价。特别是在发生严重安全事件时,用户需要立即阻断存在漏洞的功能。现有工作提出了多种代码裁剪方法,用于识别和移除可执行组件的功能。然而,它们通常涉及对文件的静态修改(对于 Android 应用而言,还包括重新打包 APK),这既不便于用户使用,还会因破坏公钥验证和代码完整性检查而损害 Android 的安全模型。本文提出 3DNDroid,这是一种面向 Android 应用中 DEX 与 Native 方法的动态裁剪方法。3DNDroid 使用一个非特权管理应用与定制化 Android 操作系统协同工作,根据由静态或动态分析预先生成的裁剪方案,在应用执行期间动态减少不必要的代码加载。它会拦截对已裁剪字节码方法的调用,以阻止其解释、编译和执行,同时在代码加载期间将已裁剪 native 方法的内存空间填零。评估表明,3DNDroid 能够在 55 个真实应用中裁剪 187 个 DEX 方法和 30 个 native 方法,移除超过 1 万个面向返回编程(ROP)gadget。案例研究证实了其在缓解漏洞方面的有效性,而性能评估则突显了其相对于未裁剪应用在节省资源方面的优势。

英文摘要:

Today's Android developers tend to include numerous features to accommodate diverse user requirements, which inevitably leads to bloated apps. Yet more often than not, only a fraction of these features are frequently utilized by users, thus a bloated app costs dearly in potential vulnerabilities, expanded attack surfaces, and additional resource consumption. Especially in the event of severe security incidents, users have the need to block vulnerable functionalities immediately. Existing works have proposed various code debloating approaches for identifying and removing features of executable components. However, they typically involve static modification of files (and, for Android apps, repackaging of APKs, too), which lacks user convenience let alone undermining the security model of Android due to the compromising of public key verification and code integrity checks. This paper introduces 3DNDroid, a Dynamic Debloating approach targeting both DEX and Native methods in AnDroid apps. Using an unprivileged management app in tandem with a customized Android OS, 3DNDroid dynamically reduces unnecessary code loading during app execution based on a pre-generated debloating schema from static or dynamic analyses. It intercepts invocations of debloated bytecode methods to prevent their interpretation, compilation, and execution, while zero-filling memory spaces of debloated native methods during code loading. Evaluation demonstrates 3DNDroid's ability to debloat 187 DEX methods and 30 native methods across 55 real-world apps, removing over 10K Return-Oriented Programming (ROP) gadgets. Case studies confirm its effectiveness in mitigating vulnerabilities, and performance assessments highlight its resource-saving advantages over non-debloated apps.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑