[论文解读] Measuring the Leakage and Exploitability of Authentication Secrets in Super-apps: The WeChat Case
本文测量了微信和百度小程序中认证密钥的泄露情况与可利用性,发现110,993个被分析的微信小程序中有32.8%将开发者密钥硬编码在代码中。作者开发了一套检测框架以识别此类密钥,并证明攻击者可利用这些密钥来攻陷小程序、冒充开发者,进而访问敏感数据或破坏服务。
We conduct a large-scale measurement of developers' insecure practices leading to mini-app to super-app authentication bypass, among which hard-coding developer secrets for such authentication is a major contributor. We also analyze the exploitability and security consequences of developer secret leakage in mini-apps by examining individual super-app server-side APIs. We develop an analysis framework for measuring such secret leakage, and primarily analyze 110,993 WeChat mini-apps, and 10,000 Baidu mini-apps (two of the most prominent super-app platforms), along with a few more datasets to test the evolution of developer practices and platform security enforcement over time. We found a large number of WeChat mini-apps (36,425, 32.8%) and a few Baidu mini-apps (112) leak their developer secrets, which can cause severe security and privacy problems for the users and developers of mini-apps. A network attacker who does not even have an account on the super-app platform, can effectively take down a mini-app, send malicious and phishing links to users, and access sensitive information of the mini-app developer and its users. We responsibly disclosed our findings and also put forward potential directions that could be considered to alleviate/eliminate the root causes of developers hard-coding the app secrets in the mini-app's front-end code.
研究动机与目标
- 调查微信和百度等超级应用平台托管的小程序中硬编码认证密钥的普遍程度。
- 分析此类密钥泄露带来的安全后果,特别是在服务器端API滥用背景下的影响。
- 通过评估对超级应用后端服务的未授权访问能力,评估泄露密钥的可利用性。
- 识别不安全开发实践的根本原因,并为平台提供商和开发者提出缓解策略。
- 利用大规模数据,衡量开发者安全实践及平台强制机制随时间的演变。
提出的方法
- 开发了一套定制化分析框架,利用静态和动态分析技术检测小程序源代码中的硬编码应用密钥。
- 通过公开分发渠道和客户端提取,收集并逆向工程了110,993个微信小程序和10,000个百度小程序。
- 使用模式匹配和代码分析技术自动提取小程序代码中的应用密钥,并通过官方文档进行验证。
- 将检测到的密钥映射到超级应用的服务器端API,以评估其潜在的未授权访问和滥用风险。
- 通过模拟攻击者行为开展安全测试:使用泄露的密钥发送未授权的API请求,评估其影响。
- 在识别出漏洞后,已向平台供应商进行了负责任的披露。
实验结果
研究问题
- RQ1微信和百度小程序中硬编码应用密钥的普遍程度如何?
- RQ2泄露的应用密钥在多大程度上可被利用以获得对超级应用后端服务的未授权访问?
- RQ3此类密钥泄露对小程序开发者和最终用户在现实世界中的安全与隐私造成了哪些后果?
- RQ4当前的超级应用平台在防止密钥泄露方面如何执行安全策略,其在哪些方面存在不足?
- RQ5在小程序生态系统中,关于密钥处理的安全实践和平台强制机制的长期发展趋势是什么?
主要发现
- 在分析的110,993个微信小程序中,32.8%(36,425个应用)被发现将开发者密钥硬编码在代码中,表明存在广泛的安全开发实践缺陷。
- 在10,000个百度小程序中,有112个被发现泄露了应用密钥,表明该平台的泄露率虽较低,但仍具显著影响。
- 即使没有超级应用账户的攻击者,也可利用泄露的密钥冒充小程序,发送钓鱼链接,并访问小程序后端的敏感数据。
- 泄露的密钥使攻击者能够完全控制服务器端API,从而导致小程序服务瘫痪、用户数据外泄以及执行未经授权的操作。
- 本研究确认,根本原因在于开发者未遵循平台安全指南,且平台在大规模范围内未能有效强制实施密钥保护措施。
- 研究结果已负责任地披露给微信和百度,凸显了加强平台级强制措施和开发者安全教育的必要性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。