Lune

S&P2018顶会

Study and Mitigation of Origin Stripping Vulnerabilities in Hybrid-postMessage Enabled Mobile Applications

Guangliang Yang, Jeff Huang, Guofei Gu, Abner Mendoza

摘要

postMessage is popular in HTML5 based web apps to allow the communication between different origins. With the increasing popularity of the embedded browser (i.e., WebView) in mobile apps (i.e., hybrid apps), postMessage has found utility in these apps. However, different from web apps, hybrid apps have a unique requirement that their native code (e.g., Java for Android) also needs to exchange messages with web code loaded in Web-View. To bridge the gap, developers typically extend postMessage by treating the native context as a new frame, and allowing the communication between the new frame and the web frames. We term such extended postMessage "hybrid postMessage" in this paper. We find that hybrid postMessage introduces new critical security flaws: all origin information of a message is not respected or even lost during the message delivery in hybrid postMessage. If adversaries inject malicious code into WebView, the malicious code may leverage the flaws to passively monitor messages that may contain sensitive information, or actively send messages to arbitrary message receivers and access their internal functionalities and data. We term the novel security issue caused by hybrid postMessage "Origin Stripping Vulnerability" (OSV). In this paper, our contributions are fourfold. First, we conduct the first systematic study on OSV. Second, we propose a lightweight detection tool against OSV, called OSV-Hunter. Third, we evaluate OSV-Hunter using a set of popular apps. We found that 74 apps implemented hybrid postMessage, and all these apps suffered from OSV, which might be exploited by adversaries to perform remote real-time microphone monitoring, data race, internal data manipulation, denial of service (DoS) attacks and so on. Several popular development frameworks, libraries (such as the Facebook React Native framework, and the Google cloud print library) and apps (such as Adobe Reader and WPS office) are impacted. Lastly, to mitigate OSV from the root, we design and implement three new postMessage APIs, called OSV-Free. Our evaluation shows that OSV-Free is secure and fast, and it is generic and resilient to the notorious Android fragmentation problem. We also demonstrate that OSV-Free is easy to use, by applying OSV-Free to harden the complex "Facebook React Native" framework. OSV-Free is open source, and its source code and more implementation and evaluation details are available online.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 8 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Automated Generation of Event-Oriented Exploits in Android Hybrid Apps 引用了 Are these Ads Safe: Detecting Hidden Attacks through the Mobile App-Web Interfaces
  • Automated Generation of Event-Oriented Exploits in Android Hybrid Apps 引用了 Draco: A System for Uniform and Fine-grained Access Control for Web Code on Android
  • ωTest: WebView-Oriented Testing for Android Applications 引用了 Automated Generation of Event-Oriented Exploits in Android Hybrid Apps
  • ωTest: WebView-Oriented Testing for Android Applications 引用了 Demystifying Resource Management Risks in Emerging Mobile App-in-App Ecosystems
  • ωTest: WebView-Oriented Testing for Android Applications 引用了 Iframes/Popups Are Dangerous in Mobile WebView: Studying and Mitigating Differential Context Vulnerabilities
  • ωTest: WebView-Oriented Testing for Android Applications 引用了 An Empirical Study of Web Resource Manipulation in Real-world Mobile Applications
  • ωTest: WebView-Oriented Testing for Android Applications 引用了 Unleashing the Walking Dead: Understanding Cross-App Remote Infections on Mobile WebViews
  • Demystifying Resource Management Risks in Emerging Mobile App-in-App Ecosystems 引用了 Automated Generation of Event-Oriented Exploits in Android Hybrid Apps
  • Demystifying Resource Management Risks in Emerging Mobile App-in-App Ecosystems 引用了 Draco: A System for Uniform and Fine-grained Access Control for Web Code on Android
  • Demystifying Resource Management Risks in Emerging Mobile App-in-App Ecosystems 引用了 Unleashing the Walking Dead: Understanding Cross-App Remote Infections on Mobile WebViews
  • Iframes/Popups Are Dangerous in Mobile WebView: Studying and Mitigating Differential Context Vulnerabilities 引用了 Automated Generation of Event-Oriented Exploits in Android Hybrid Apps
  • Iframes/Popups Are Dangerous in Mobile WebView: Studying and Mitigating Differential Context Vulnerabilities 引用了 Are these Ads Safe: Detecting Hidden Attacks through the Mobile App-Web Interfaces
  • Iframes/Popups Are Dangerous in Mobile WebView: Studying and Mitigating Differential Context Vulnerabilities 引用了 Draco: A System for Uniform and Fine-grained Access Control for Web Code on Android
  • Iframes/Popups Are Dangerous in Mobile WebView: Studying and Mitigating Differential Context Vulnerabilities 引用了 Unleashing the Walking Dead: Understanding Cross-App Remote Infections on Mobile WebViews
  • An Empirical Study of Web Resource Manipulation in Real-world Mobile Applications 引用了 Are these Ads Safe: Detecting Hidden Attacks through the Mobile App-Web Interfaces
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper8

  1. Demystifying Resource Management Risks in Emerging Mobile App-in-App EcosystemsHaoran Lu, Luyi Xing, Yue Xiao, Yifan Zhang 等CCS 2020 · 48 次引用
  2. Understanding Open Ports in Android Applications: Discovery, Diagnosis, and Security AssessmentDaoyuan Wu, Debin Gao, Rocky K. C. Chang, En He 等NDSS 2019 · 25 次引用
  3. Iframes/Popups Are Dangerous in Mobile WebView: Studying and Mitigating Differential Context VulnerabilitiesGuangliang Yang, Jeff Huang, Guofei GuUSENIX Security 2019 · 21 次引用
  4. An Empirical Study of Web Resource Manipulation in Real-world Mobile ApplicationsXiaohan Zhang, Yuan Zhang, Qianqian Mo, Hao Xia 等USENIX Security 2018 · 15 次引用
  5. ωTest: WebView-Oriented Testing for Android ApplicationsJiajun Hu, Lili Wei, Yepang Liu, Shing-Chi CheungISSTA 2023 · 8 次引用

它引用的 Paper5

  1. Are these Ads Safe: Detecting Hidden Attacks through the Mobile App-Web InterfacesVaibhav Rastogi, Rui Shao, Yan Chen, Xiang Pan 等NDSS 2016 · 81 次引用
  2. Automated Generation of Event-Oriented Exploits in Android Hybrid AppsGuangliang Yang, Jeff Huang, Guofei GuNDSS 2018 · 79 次引用
  3. Same-Origin Policy: Evaluation in Modern BrowsersJörg Schwenk, Marcus Niemietz, Christian MainkaUSENIX Security 2017 · 52 次引用
  4. Unleashing the Walking Dead: Understanding Cross-App Remote Infections on Mobile WebViewsTongxin Li, Xueqiang Wang, Mingming Zha, Kai Chen 等CCS 2017 · 47 次引用
  5. Draco: A System for Uniform and Fine-grained Access Control for Web Code on AndroidGüliz Seray Tuncay, Soteris Demetriou, Carl A. GunterCCS 2016 · 43 次引用

相关 Paper

  1. PMForce: Systematically Analyzing postMessage Handlers at ScaleMarius Steffens, Ben StockCCS 2020 · 23 次引用
  2. Tabbed Out: Subverting the Android Custom Tab Security ModelPhilipp Beer, Marco Squarcina, Lorenzo Veronese, Martina LindorferS&P 2024 · 7 次引用
  3. Cross-Boundary Mobile Tracking: Exploring Java-to-JavaScript Information Diffusion in WebViewsSohom Datta, Michalis Diamantaris, Ahsan Zafar, Junhua Su 等NDSS 2026 · 2 次引用
  4. Plain Text, Plain Risks: Measuring HTTP Inclusion in Android WebViews at ScalePhilipp Beer, Sebastian Roth, Martina Lindorfer, Marco SquarcinaUSENIX Security 2026
  5. ReuNify: A Step Towards Whole Program Analysis for React Native Android AppsYonghui Liu, Xiao Chen, Pei Liu, John Grundy 等ASE 2023 · 7 次引用
黄昏的海面,两侧是细线勾勒的悬崖