Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3607199.3607236acmotherconferencesArticle/Chapter ViewAbstractPublication PagesraidConference Proceedingsconference-collections
research-article

Measuring the Leakage and Exploitability of Authentication Secrets in Super-apps: The WeChat Case

Published: 16 October 2023 Publication History

Abstract

Super-apps such as WeChat and Baidu host millions of mini-apps, which are very popular among users and developers because of the mini-apps’ convenience, lightweight, ease of sharing, and not requiring explicit installation. Such ecosystems involve several entities, such as the super-app and mini-app clients, the super-app backend server, the mini-app developer server, and other hosting platforms and services used by the mini-app developer. To support various user-level functionalities, these components must authenticate each other, which differs from regular user authentication to the super-app platform. In this paper, we explore the mini-app to super-app authentication problem caused by insecure development practices. This type of authentication allows the mini-app code to access super-app services on the developer’s behalf.
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.

References

[1]
Adchina. 2022. The power of the Baidu super-app. Available at: https://www.adchina.io/what-is-baidu/.
[2]
Alipay. 2022. Mini-app framework demystified. Available at: https://juejin.cn/post/7137478354042617869.
[3]
Alipay. 2023. Get access token API. Available at: https://miniprogram.alipay.com/docs/miniprogram/mpdev/v2_applytoken.
[4]
Baidu. 2023. Get access Token API. Available at: https://smartprogram.baidu.com/docs/develop/serverapi/serverapilist/.
[5]
Baidu. 2023. Get session key API. Available at: https://smartprogram.baidu.com/docs/develop/api/open/getSessionKey/.
[6]
Baidu. 2023. Mini-app directory structure. Available at: https://smartprogram.baidu.com/docs/develop/framework/app_service/.
[7]
Farzana Ahamed Bhuiyan and Akond Rahman. 2020. Characterizing co-located insecure coding patterns in infrastructure as code scripts. In IEEE/ACM Conference on Automated Software Engineering Workshops(ASE’20). Melbourne, Australia.
[8]
ByteDance. 2023. Duoyin. https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/introduction/overview/.
[9]
ByteDance. 2023. Tiktok - Overseas version of Duoyin. https://www.tiktok.com/.
[10]
Ao Cheng, Gang Ren, Taeho Hong, Kichan Nam, and Chulmo Koo. 2019. An exploratory analysis of travel-related WeChat mini program usage: affordance theory perspective. In Information and Communication Technologies in Tourism(ENTER’21). Cham.
[11]
Chinese article. 2022. Extracting WeChat mini-apps under Windows. Online blog article (in Chinese). Available at: https://zone.huoxian.cn/d/883-pcfirda.
[12]
DingTalk. 2023. Mini-app API documentation. Available at: https://open.dingtalk.com/document/orgapp/how-to-call-apis.
[13]
Shuaike Dong, Menghao Li, Wenrui Diao, Xiangyu Liu, Jian Liu, Zhou Li, Fenghao Xu, Kai Chen, Xiaofeng Wang, and Kehuan Zhang. 2018. Understanding Android obfuscation techniques: A large-scale investigation in the wild. In Security and Privacy in Communication Networks(SecureComm’18). Cham.
[14]
Duoyin. 2023. Get access Token API. Available at: https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/server/interface-request-credential/get-access-token/.
[15]
Duoyin. 2023. Safety guidelines. Available at: https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/guide/anquankaifa/.
[16]
Ming Fan, Le Yu, Sen Chen, Hao Zhou, Xiapu Luo, Shuyue Li, Yang Liu, Jun Liu, and Ting Liu. 2020. An empirical evaluation of GDPR compliance violations in Android mHealth apps. In IEEE 31st International Symposium on Software Reliability Engineering(ISSRE’20). Coimbra, Portugal.
[17]
GitHub. 2023. WeChat mini-apps unpacker. Available at: https://github.com/Ryan-Miao/wxappUnpacker.
[18]
GitHub. 2023. Wxapkg decryptor. Available at: https://github.com/BlackTrace/pc_wxapkg_decrypt.
[19]
Mingjia Guo, Ru-De Liu, Yi Ding, Biying Hu, Rui Zhen, Ying Liu, and Ronghuan Jiang. 2018. How are extraversion, exhibitionism, and gender associated with posting selfies on WeChat friends’ circle in Chinese teenagers?Personality and Individual Differences 127 (June 2018), 114–116.
[20]
Lei Hao, Fucheng Wan, Ning Ma, and Yicheng Wang. 2018. Analysis of the development of WeChat mini program. Journal of Physics: Conference Series 1087, 6 (September 2018), 062040.
[21]
Pili Hu, Ronghai Yang, Yue Li, and Wing Cheong Lau. 2014. Application impersonation: problems of OAuth and API design in online social networks. In Proceedings of the Second ACM Conference on Online Social Networks(COSN’14). Dublin, Ireland.
[22]
Che Hui Lien and Yang Cao. 2014. Examining WeChat users’ motivations, trust, attitudes, and positive word-of-mouth: Evidence from China. Computers in human behavior 41 (December 2014), 104–111.
[23]
Yubei Lin, Jingyan Qiu, and Pingping Chen. 2020. Exploration and practice on intelligent teaching patterns based on WeChat mini program. In Proceedings of the 9th International Conference on Educational and Information Technology(ICEIT’20). Oxford, United Kingdom.
[24]
Yanyan Liu, Danyu Li, Haishan Ruan, Yun Hu, and Nanping Shen. 2022. Development and usability test of a symptom management WeChat mini program for parents of children with cancer. Asia-Pacific Journal of Oncology Nursing 9, 12 (December 2022), 100166.
[25]
Haoran Lu, Luyi Xing, Yue Xiao, Yifan Zhang, Xiaojing Liao, XiaoFeng Wang, and Xueqiang Wang. 2020. Demystifying resource management risks in emerging mobile app-in-app ecosystems. In Proceedings of the ACM SIGSAC Conference on Computer and Communications Security(CCS’20). Virtual Event, USA.
[26]
Michael Meli, Matthew R McNiece, and Bradley Reaves. 2019. How bad can it git? Characterizing secret leakage in public GitHub repositories. In Network and Distributed Systems Security Symposium(NDSS’19). San Diego, CA, USA.
[27]
Microsoft. 2023. Detect secrets - credentials scanning tool. Available at: https://microsoft.github.io/code-with-engineering-playbook/continuous-integration/dev-sec-ops/secret-management/recipes/detect-secrets/.
[28]
Mitre. 2023. CWE top 25. Available at: https://cwe.mitre.org/top25/archive/2022/2022_cwe_top25.html.
[29]
NPM. 2023. wx-server-sdk - Cloud call npm Package. Available at: https://www.npmjs.com/package/wx-server-sdk.
[30]
NVD. 2023. CVSS calculator. Available at: https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator.
[31]
OWASP. 2023. OWASP top 10 API. Available at: https://owasp.org/www-project-api-security/.
[32]
Paytm. 2023. Mini-app API documentation. Available at: https://business.paytm.com/docs/api/miniapps/login-flow/getaccesstoken.
[33]
Andrea Possemato and Yanick Fratantonio. 2020. Towards HTTPS everywhere on Android: We are not there yet. In 29th USENIX Security Symposium (USENIX Security 20)(USENIX’20). Boston, MA, USA.
[34]
Postman. 2023. Postman API platform. Available at: https://www.postman.com/.
[35]
Property Guru for Business. 2023. The power of the WeChat super-app. Available at: https://www.propertyguruforbusiness.com/publications/the-power-of-the-wechat-super-app.
[36]
QQ. 2023. Mini-app API Documentation. Available at: https://q.qq.com/wiki/develop/miniprogram/server/open_port/port_use.html.
[37]
Aakanksha Saha, Tamara Denning, Vivek Srikumar, and Sneha Kumar Kasera. 2020. Secrets in source code: Reducing false positives using machine learning. In Conference on Communication Systems & Networks(COMSNETS’20). Bengaluru, India.
[38]
Scmp.com. 2021. WeChat mini programs for banking pose ‘significant’ risks of personal data leakage. Available at: https://www.scmp.com/tech/tech-trends/article/3142239/wechat-mini-programs-banking-pose-significant-risks-personal-data.
[39]
Shangcheng Shi, Xianbo Wang, and Wing Cheong Lau. 2019. MoSSOT: An automated blackbox tester for single sign-on vulnerabilities in mobile applications. In Proceedings of the 2019 ACM Asia Conference on Computer and Communications Security(Asia CCS’19). Auckland, New Zealand.
[40]
Vibha Singhal Sinha, Diptikalyan Saha, Pankaj Dhoolia, Rohan Padhye, and Senthil Mani. 2015. Detecting and mitigating secret-key leaks in source code repositories. In IEEE/ACM 12th Working Conference on Mining Software Repositories(MSR’15). Florence, Italy.
[41]
Sixthtone. 2020. China’s ‘mini-apps’ have big privacy issues, report says. Available at: https://www.sixthtone.com/news/1006196.
[42]
Tencent. 2023. Tencent cloud API overview. Available at: https://cloud.tencent.com/document/api/876/34809.
[43]
Time Business News. 2021. WeChat mini-apps Risk Data Leaks. Available at: https://timebusinessnews.com/wechat-mini-apps-risk-data-leaks/.
[44]
U.S. department of health and human services. 2018. The Belmont report - Ethical principles and guidelines for the protection of human subjects of research. Available at: https://www.hhs.gov/ohrp/regulations-and-policy/belmont-report/read-the-belmont-report/index.html.
[45]
Hui Wang, Yuanyuan Zhang, Juanru Li, and Dawu Gu. 2016. The achilles heel of OAuth: a multi-platform study of OAuth-based authentication. In Proceedings of the 32nd Annual Conference on Computer Security Applications(ACSAC’16). Los Angeles, California, USA.
[46]
Hui Wang, Yuanyuan Zhang, Juanru Li, Hui Liu, Wenbo Yang, Bodong Li, and Dawu Gu. 2015. Vulnerability assessment of OAuth implementations in Android applications. In Proceedings of the 31st Annual Computer Security Applications Conference(ACSAC’15). Los Angeles, CA, USA.
[47]
Yin Wang, Ming Fan, Junfeng Liu, Junjie Tao, Wuxia Jin, Qi Xiong, Yuhao Liu, Qinghua Zheng, and Ting Liu. 2023. Do as you say: Consistency detection of data practice in program code and privacy policy in mini-app. Available at: https://arxiv.org/pdf/2302.13860.pdf.
[48]
Web archive. 2022. Extracting WeChat mini-apps using frida. Online blog article (in Chinese). Available at: https://web.archive.org/web/20221215183356/https://www.ljczero.top/article/2022/9/5/144.html.
[49]
WeChat. 2023. Cloud base. Available at: https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/capabilities.html.
[50]
WeChat. 2023. Cloud initialization. Available at: https://developers.weixin.qq.com/miniprogram/en/dev/wxcloud/guide/init.html.
[51]
WeChat. 2023. code2Session API. Available at: https://developers.weixin.qq.com/miniprogram/en/dev/api-backend/open-api/login/auth.code2Session.html.
[52]
WeChat. 2023. Devtool stable version update log. Available at: https://developers.weixin.qq.com/miniprogram/dev/devtools/stable.html.
[53]
WeChat. 2023. Error codes developer error codes. Available at: https://developers.weixin.qq.com/doc/oplatform/en/Return_codes/Return_code_descriptions.html.
[54]
WeChat. 2023. get access token API. Available at: https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-access-token/getAccessToken.html.
[55]
WeChat. 2023. IDE devtool. Available at: https://developers.weixin.qq.com/miniprogram/en/dev/devtools/download.html.
[56]
WeChat. 2023. Mini-app directory structure. Available at: https://developers.weixin.qq.com/miniprogram/en/dev/framework/structure.html.
[57]
WeChat. 2023. Mini-app server domain name information. Available at: https://developers.weixin.qq.com/miniprogram/en/dev/framework/ability/network.html.
[58]
WeChat. 2023. Safety guidelines by WeChat. Available at: https://developers.weixin.qq.com/miniprogram/en/dev/framework/security.html#Code-Management-and-Leaks.
[59]
WeChat. 2023. Server-side API classification. Available at: https://developers.weixin.qq.com/miniprogram/en/dev/api-backend/.
[60]
WeChat. 2023. Server-side API classification v2. Available at: https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/.
[61]
WeChat. 2023. Tencent cloud hosting. Available at: https://developers.weixin.qq.com/minigame/dev/wxcloudrun/src/practice/call.html.
[62]
WeChat. 2023. WeChat. Available at: https://www.wechat.com/.
[63]
Haohuang Wen, Juanru Li, Yuanyuan Zhang, and Dawu Gu. 2018. An empirical study of SDK credential misuse in iOS apps. In 25th Asia-Pacific Software Engineering Conference (APSEC)(APSEC’18). Nara, Japan.
[64]
Wikipedia. 2023. Baidu. Available at: https://en.wikipedia.org/wiki/Baidu.
[65]
Wikipedia. 2023. ICP license. Available at: https://en.wikipedia.org/wiki/ICP_license.
[66]
Wenbo Yang, Juanru Li, Yuanyuan Zhang, and Dawu Gu. 2019. Security analysis of third-party in-app payment in mobile applications. Journal of Information Security and Applications 48 (October 2019), 102358.
[67]
Yuqing Yang, Yue Zhang, and Zhiqiang Lin. 2022. Cross miniapp request forgery: Root causes, attacks, and vulnerability detection. In Proceedings of the ACM SIGSAC Conference on Computer and Communications Security(CCS’22). Los Angeles, CA, USA.
[68]
Jianyi Zhang, Leixin Yang, Yuyang Han, Zhi Sun, and Zixiao Xiang. 2022. A small leak will sink many ships: Vulnerabilities related to mini programs permissions. In Syposium on Security, Trust, & Privacy in Computing(COMPSAC’23). Torino, Italy.
[69]
Lei Zhang, Zhibo Zhang, Ancong Liu, Yinzhi Cao, Xiaohan Zhang, Yanjun Chen, Yuan Zhang, Guangliang Yang, and Min Yang. 2022. Identity confusion in webview-based mobile app-in-app ecosystems. In 31st USENIX Security Symposium(USENIX’22). Boston, MA.
[70]
Yue Zhang, Bayan Turkistani, Allen Yuqing Yang, Chaoshun Zuo, and Zhiqiang Lin. 2021. A measurement study of Wechat mini-apps. ACM SIGMETRICS Performance Evaluation Review 5, 2 (June 2021), 1–25.
[71]
Yue Zhang, Yuqing Yang, and Zhiqiang Lin. 2023. Don’t leak your keys: Understanding, measuring, and exploiting the AppSecret leaks in mini-programs. In Proceedings of the ACM SIGSAC Conference on Computer and Communications Security(CCS’23). Copenhagen, Denmark.
[72]
Jinyang Zheng, Zhengling Qi, Yifan Dou, and Yong Tan. 2019. How mega is the mega? Exploring the spillover effects of WeChat using graphical model. Information Systems Research 30, 4 (December 2019), 1343–1362.

Cited By

View all
  • (2024)Privacy Policy Compliance in Miniapps: An Analytical StudyProceedings of the ACM Workshop on Secure and Trustworthy Superapps10.1145/3689941.3695777(11-17)Online publication date: 19-Nov-2024
  • (2024)Keep Me Updated: An Empirical Study on Embedded Javascript Engines in Android AppsProceedings of the 21st International Conference on Mining Software Repositories10.1145/3643991.3644901(361-372)Online publication date: 15-Apr-2024

Index Terms

  1. Measuring the Leakage and Exploitability of Authentication Secrets in Super-apps: The WeChat Case

      Recommendations

      Comments

      Please enable JavaScript to view thecomments powered by Disqus.

      Information & Contributors

      Information

      Published In

      cover image ACM Other conferences
      RAID '23: Proceedings of the 26th International Symposium on Research in Attacks, Intrusions and Defenses
      October 2023
      769 pages
      ISBN:9798400707650
      DOI:10.1145/3607199
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 16 October 2023

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. Authentication
      2. Hard-coded Secrets
      3. Mini-app Security
      4. WeChat

      Qualifiers

      • Research-article
      • Research
      • Refereed limited

      Funding Sources

      • Natural Sciences and Engineering Research Council of Canada (NSERC)

      Conference

      RAID 2023

      Acceptance Rates

      Overall Acceptance Rate 43 of 173 submissions, 25%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)145
      • Downloads (Last 6 weeks)10
      Reflects downloads up to 13 Feb 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2024)Privacy Policy Compliance in Miniapps: An Analytical StudyProceedings of the ACM Workshop on Secure and Trustworthy Superapps10.1145/3689941.3695777(11-17)Online publication date: 19-Nov-2024
      • (2024)Keep Me Updated: An Empirical Study on Embedded Javascript Engines in Android AppsProceedings of the 21st International Conference on Mining Software Repositories10.1145/3643991.3644901(361-372)Online publication date: 15-Apr-2024

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      HTML Format

      View this article in HTML Format.

      HTML Format

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media