Manuscript Offprint

arXiv:2608.25877

A Hybrid Security Framework for Mini-Programs: Visual UI Compliance and Network Risk Assessment

Panpan Shen, Lei Xie, Xiaoqi Li

Abstract

With the continuous development of the WeChat ecosystem, WeChat Mini Programs, due to their advantages of not requiring installation, using little memory, and being ready to use instantly, have seen a surge in user numbers and have now become an indispensable service carrier in mobile internet. However, as Mini Programs rapidly became popular, issues regarding the compliance of their interface interaction design and the safety of operational behavior have become increasingly apparent. Many Mini Programs have problems such as clickable buttons and icons not being standard in size, or ad pop-ups and payment entrances being placed in a way that is easy to misclick. The close or cancel buttons are often too small or hidden, making it easy to accidentally click on ads or payment content, and difficult to accurately click the cancel button. This can result in involuntary payments or being redirected to illegal pages, causing unnecessary financial losses and seriously harming users' property security and legal rights. To address the above issues, this article develops a detection program to check the position and size of various icons and buttons in Mini Programs, and analyze whether redirected links fall within a safe range. YOLOv8 is used to identify various buttons in images, displaying the corresponding icon and its data based on the mouse click position. Violations are flagged and recorded. At the same time, mitmproxy is used to capture relevant data requests generated during clicks, analyzing the safety of redirections, and presenting key information for user observation.

Keywords: Visualization; Image recognition; Evidence retention; Risk prediction

1 Introduction

WeChat Mini-Programs[1] have rapidly evolved into a pivotal service paradigm within the mobile internet ecosystem[2]. By eliminating installation overhead, minimising memory consumption, and enabling instant launch, they have attracted an enormous and still-growing user base[3]. Statistics indicate that by 2022, WeChat Mini-Programs had already exceeded 450 million daily active users, with over three million registered developers and an annual transaction scale reaching trillions of yuan. Industry statistics show that by the end of 2025, the number of cross-border and overseas interactions triggered by WeChat Mini-Programs exceeded 5 billion. Mini-Program [4] services have been deployed across 100 countries and regions worldwide, while WeChat cross-border payment capabilities cover 78 countries and regions with support for 36 types of currencies. Transaction volume completed via Mini-Programs[5] in the second half of 2025 also saw a year-on-year growth of over 70%. These figures collectively demonstrate that Mini-Programs have been deeply integrated into daily life scenarios ranging from food delivery and online shopping to mobility services, medical care and public utility payments[6].

Despite their convenience and strong platform endorsement—including mandatory pre-release security reviews[7] and default HTTPS communication—the rapid proliferation of Mini-Programs has brought forth new safety and usability concerns. A substantial number of Mini-Programs exhibit non-standardised interactive controls: clickable buttons and icons are frequently rendered at undersized dimensions; advertisement pop-ups and payment entry points are placed in regions susceptible to unintentional touches; and close or cancel buttons are often deliberately miniaturised and tucked into inconspicuous positions[8]. These design irregularities directly lead to inadvertent ad clicks, unintentional payment confirmations, and unwanted redirections to questionable web pages, thereby causing economic losses and undermining users' property security and legitimate rights[9].

The research community has devoted considerable effort to Mini-Program security[10]. Early investigations focused on architectural vulnerabilities. Deng identified two prevalent categories of counterfeit Mini-Programs—those using visually similar icons and those mimicking official names via homophones or visually similar characters—and proposed a detection method combining code signatures and network behaviour[11]. Baskaran et al. examined code-level weaknesses and revealed that developer credentials, especially secret keys, are often hard-coded within the program package, creating a significant attack surface for credential leakage[12, 13]. Subsequent work expanded the scope to privacy and data-flow risks. Zheng conducted both static and dynamic analyses on a large corpus of Mini-Programs, finding that over 60% suffered from hard-coded API keys, missing HTTPS enforcement, inadequate signature verification, or local caching of sensitive user data such as phone numbers[14–16]. Huang et al. further highlighted the abusive use of the web-view component to load external pages, effectively bypassing the platform’s content review mechanism and opening doors to supply-chain poisoning and phishing attacks[17, 18].

In response to these threats, several automated analysis toolkits have been developed[19]. Meng implemented a pipeline that performs sensitive-API call tracing, hard-coded key extraction, and HTTPS configuration validation on decompiled code. Wemint employs static taint analysis to track sensitive data flows[20–22], while more recent studies have leveraged large language models to detect real-world data leakage incidents[23]. Some researchers have combined static and dynamic methods to efficiently verify the integrity of data transmission paths[24, 25]. Meanwhile, platform regulators have progressively updated their guidelines—most notably, the WeChat Developer Code of Conduct and Privacy Protection Specification—mandating HTTPS for all network requests, requiring user-initiated authorisation for sensitive APIs, and enforcing the principle of minimum necessary data collection[26–28].

Nevertheless, a conspicuous gap remains in the current landscape of Mini-Program security testing: the lack of a dedicated visual-oriented and user-interactive inspection mechanism[29]. Existing UI-centric testing methodologies predominantly rely on random-event generation (e.g., Monkey-style stress tests) to evaluate crash resilience rather than to assess element-level compliance with human-factor design standards[30]. On the other hand, code-based security audits, while thorough at the logical level, ignore the spatial and behavioural attributes of interface elements that directly affect user actions. Furthermore, no prior work has integrated real-time screen-based icon/button inspection with network-request risk assessment in a single, interactive diagnostic tool[31].

To bridge this gap, this paper presents a hybrid security detection framework for WeChat MiniPrograms. The proposed system combines visual element recognition using YOLOv8 with network traffic analysis via mitmproxy, enabling both static UI compliance checking and dynamic behavioural risk prediction. The main contributions of this work are summarised as follows:

(1) We design and implement a real-time screen-capture and preview module that eliminates self-window occlusion via Win32gui, ensuring that the detection model receives a clean, full-screen input image.

(2) We adopt YOLOv8—a state-of-the-art one-stage object detector—to identify and localise interactive UI elements (buttons, icons, close controls) with high precision. The detection is event-driven by mouse clicks using the Pynput library, avoiding continuous resource consumption.

(3) We establish a compliance judgement rule based on the human-centric 44×4444 \times 44 CSS-pixel threshold derived from the WCAG 2.1 standard and the WeUI Design Guidelines. Detected non-compliant elements are automatically highlighted with a red bounding box, a green 44×4444 \times 44 reference square is overlaid, and a timestamped screenshot is archived for evidence.

(4) We integrate mitmproxy to capture outbound data packets triggered by user clicks, and feed extracted features (URL length, IP presence, subdomain count, suspicious keywords, HTTPS usage, special-character frequency, and URL entropy) into a machine-learning risk classifier, thereby supplementing the visual inspection with network-level threat assessment.

References (55)

  • Miniscope: Automated ui exploration and privacy inconsistency detection of miniapps via two-phase iterative hybrid analysis
  • A measurement study of wechat mini-apps
  • Understanding miniapp malware: Identification, dissection, and characterization
  • Security analysis of miniapps: Vulnerabilities, exploits, and a tailored mitigation framework
  • Real or rogue? detecting malicious miniapps with deceptive reporting interface
  • Smart contracts in the real world: A statistical exploration of external data dependencies (opens arXiv in a new tab)
  • The rise of miniapps: A new frontier with security challenges in mobile apps
  • Penetrating the hostile: Detecting defi protocol exploits through cross-contract analysis
  • Exploring vulnerabilities and concerns in solana smart contracts
  • Characterizing and detecting bugs in wechat mini-programs
  • Detect counterfeit mini-apps: A case study on wechat
  • Measuring the leakage and exploitability of authentication secrets in super-apps: The wechat case
  • Don’t leak your keys: Understanding, measuring, and exploiting the appsecret leaks in mini-programs
  • Systematic analysis of security and vulnerabilities in miniapps
  • Potential risks arising from the absence of signature verification in miniapp plugins
  • A small leak will sink many ships: Vulnerabilities related to mini-programs permissions
  • Identity confusion in {WebView-based} mobile app-in-app ecosystems
  • Cross miniapp request forgery: Root causes, attacks, and vulnerability detection
  • Industry practice of javascript dynamic analysis on wechat mini-programs
  • Wemint: Tainting sensitive data leaks in wechat mini-programs
  • Taintmini: Detecting flow of sensitive data in mini-programs with static taint analysis
  • Minitracker: Large-scale sensitive information tracking in mini apps
  • Whiskey: Large-scale identification of mobile mini-app session key leakage with llms
  • Miniscope: Automated ui exploration and privacy inconsistency detection of miniapps via two-phase iterative hybrid analysis (opens arXiv in a new tab)
  • Minichecker: Detecting data privacy risk of abusive permission request behavior in mini-programs
  • On the usage-scenario-based data minimization in mini programs
  • Do as you say: Consistency detection of data practice in program code and privacy policy in mini-app
  • Identifying cross-user privacy leakage in mobile mini-apps at a large scale
  • Interaction-aware vulnerability detection in smart contract bytecodes
  • Phishhunter-xld: An ensemble approach integrating machine learning and deep learning for phishing url classification
  • Demystifying cookie sharing risks in webview-based mobile app-in-app ecosystems
  • Demystifying resource management risks in emerging mobile app-in-app ecosystems
  • What wechat knows: Pervasive first-party tracking in a billion-user super-app ecosystem
  • Minible: Exploring insecure ble api usages in mini-programs
  • Smart phishing detection via url characteristics: Machine learning and deep learning techniques
  • You Only Look Once: Unified, Real-Time Object Detection
  • Gui element detection using sota yolo deep learning models
  • The dark forest: Understanding security risks of cross-party delegated resources in mobile app-in-app ecosystems
  • Exploring permission control flaws in mini-apps
  • A comparison of yolov5 and yolov8 in the context of mobile ui detection
  • Blockchain security based on cryptography: a review
  • The skeleton keys: A large scale analysis of credential leakage in mini-apps
  • Distance-iou loss: Faster and better learning for bounding box regression
  • Cloud data leakage detection in wechat mini-programs based on static and dynamic analysis
  • One size does not fit all: Uncovering and exploiting cross platform discrepant {APIs} in {WeChat}
  • Kubeguard: A systematic permission-oriented risk detection approach for kubernetes applications
  • Mind your key: An empirical study of llm api credential leakage in ios apps (opens arXiv in a new tab)
  • Yolov7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
  • Adaptive deep sequential networks empowered by multi-model feature selection for effective phishing url identification
  • Uncovering api-scope misalignment in the app-in-app ecosystem
  • Minieval: Automated detection of compliance violations and quantitative privacy risk assessment in miniapps
  • A filter-based feature selection framework to detect phishing URLs using stacking ensemble machine learning
  • Sybil attacks detection and traceability mechanism based on beacon packets in connected automobile vehicles
  • Dos attacks and defense technologies in blockchain systems: A hierarchical analysis
  • A comprehensive study of exploitable patterns in smart contracts: From vulnerability to defense