Information flow testing system and method in android application based on deep learning
Patent Information
- Application Number
- CN202211171753.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-26
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-09-26
AI Technical Summary
[0013]混淆技术和Android恶意软件一样,弊端在于存在攻击者通过混淆处理技术掩饰了其发布的DL-based APP中非法操作的可能
[0025]与现有技术相比,通过本发明提供的敏感源Source和Sink的集合,通过DLtrace静态分析工具可以有效检测DL-based APP中深度学习模型在推理过程中是否将用户敏感信息在信息流中泄露,在实际检测过程中,发现大部分DL-based APP存在敏感数据泄露情况,同时和现存的敏感数据泄露检测工具FlowDroid对比,本发明的DLtrace方法实际检测能力优于传统的静态分析FlowDroid方法。
Smart Images

Figure CN115481398B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of deep learning and Android applications, sensitive information leakage and static analysis, and particularly to a deep learning-based Android application, sensitive information leakage and static analysis. Background Technology
[0002] Taint analysis is an information flow analysis technique that transforms vulnerability detection into tracing the flow of sensitive user data to malicious sink points. Therefore, taint analysis is an effective means of detecting sensitive information leaks. With the development of machine learning, more and more mobile applications are using deep learning models, but there are currently no tools specifically designed for analyzing the information flow of deep learning models during the inference process in deep learning-based Android applications (DL-based apps). This invention applies the concept of taint analysis to the detection of DL-based apps. Furthermore, research has revealed that existing sensitive data leakage analysis tools perform poorly when directly used to analyze DL-based apps.
[0003] 1. Traditional Android application (Traditional APP) taint analysis technology
[0004] Taint analysis is an information flow analysis technique and an important method for analyzing the leakage of sensitive information. Generally speaking, taint analysis can be combined with both dynamic and static methods. Dynamic analysis methods monitor the behavior and data of an application in real time during runtime. TaintDroid is a typical dynamic analysis method; it can track private data during program execution to determine the circumstances and process of data leakage. It can track and tag multiple sensitive sources. However, TaintDroid has insufficient support for newer versions of Android applications based on the Android Runtime (ART). The emergence of TaintART solves this problem; TaintART redesigns the dynamic information flow tracking method to support ART.
[0005] Current static taint analysis tools for traditional apps, such as Flowdroid, suffer from insufficient detection capabilities, an inability to broadly identify third-party APIs, and limitations in performance and efficiency. The recently proposed SEEKER extends Flowdroid by reporting privacy leaks triggered by Android sensors through sensor API sources, but it hasn't extended sensitive sources to more common deep learning mobile applications. The current research community lacks identification techniques for sensitive sources and sinks specific to deep learning. To fill this research gap, this invention applies static taint analysis techniques to the detection of deep learning-based apps and summarizes the latest collection of sensitive sources and sinks for deep learning.
[0006] Compared to dynamic detection methods, which only allow some code to execute under specific conditions, static analysis can ensure the scalability of an application even when the program is not running. It covers the entire code and paths of the program, detecting erroneous code segments or malicious features by analyzing abstract characteristics such as code structure, control flow, and data flow. However, static analysis is often ineffective when detecting applications employing complex obfuscation techniques such as dynamic code loading or encryption. FlowDroid is a static analysis tool for taint analysis. It tracks sensitive data based on sensitive Source APIs and Sink APIs automatically extracted from the Android SDK, enabling high-precision detection of privacy leaks in traditional Android applications. FlowDroid is a domain-sensitive, object-sensitive, context-sensitive, and traffic-sensitive data flow analysis tool. However, FlowDroid cannot analyze the interactions between different components within a given application.
[0007] DroidSafe, building upon FlowDroid, supports communication and object sensitivity within components and creates a separate virtual main function for each component to simulate its lifecycle. However, it does not support traffic sensitivity. A key feature of this tool is its ability to model the Android application runtime environment based on Android application code. Similar tools include IccTA. Amandroid is also a static analysis platform for traditional Android applications, capable of detecting privacy data leaks, data injection, and API misuse and abuse. Compared to FlowDroid, Amandroid's alias analysis is simpler and easier to implement because it performs large-scale alias analysis before detection, obtaining alias information for all objects. However, this comprehensive alias analysis incurs greater overhead.
[0008] Current taint analysis tools are specifically designed for detecting traditional apps. Furthermore, most static taint analyzers are extensions of the well-known analysis framework Soot. These static taint analyzers analyze program code or intermediate representations. Soot can convert the objects to be analyzed into their corresponding intermediate representations. However, most APIs supporting deep learning technologies are third-party APIs, which Soot cannot represent as intermediate representations. This limits the ability of existing detection tools to analyze the information flow during the inference process of deep learning models in deep learning-based apps.
[0009] In recent years, researchers have begun to focus on the application of deep learning technology on mobile devices, and some research work on applications that use deep learning models (DL-based APP) has begun to emerge.
[0010] 2. DL-based APP technology
[0011] In recent years, artificial intelligence (AI) technology has achieved success in fields such as speech, image, and natural language processing, with deep learning being applied to various cutting-edge areas. Mobile applications are among the most promising applications of machine learning in recent years. Model compression technology makes it possible for deep learning models to perform offline inference tasks on mobile devices without compromising model performance, thus greatly enriching the functionality of mobile applications (Android apps). These deep learning-based apps often include fields such as finance and healthcare, which contain sensitive user information. With the widespread application of deep learning technology on mobile devices, user privacy faces more security threats. How to detect sensitive data leaks in deep learning applications is a worthy research question. However, current research on deep learning-based apps only focuses on the basic information of the apps, neglecting the specific analysis and understanding of information flow and the automated identification of models within deep learning apps.
[0012] With the tremendous success of artificial intelligence in machine vision and natural language processing, machine learning models are being used in various cutting-edge fields. The application of deep learning technology on smartphones has led to the emergence of many lightweight deep learning frameworks for smartphone devices, such as Google's TensorFlow Lite (TFLite), Facebook's Caffe2, and Apple's Core ML. Since integrating deep learning frameworks into applications is more efficient and not limited by network speed than running them in the cloud, more and more apps are integrating deep learning models. In this context, security issues (such as evasion, poisoning, and theft) of models in DL-based apps inevitably arise. As for PC platforms, extensive work has been done on the security of deep learning models (DL models). However, research on the security of deep learning models (DL models) for mobile platforms is very limited to date. Existing methods include model watermarking, which injects and hides watermarks in the model, and techniques for circumventing watermark verification have also emerged. Another concurrent work focuses on the robustness of deep learning models in DL-based apps. It employs adversarial attacks on mobile models by identifying highly similar pre-trained models from TensorFlow Hub. Mobile platforms pose risks of model leakage and cost, as well as the risk of having plain text-formatted deep learning models stolen from memory. Related research suggests that obfuscation and encryption are two ways to improve the security of deep learning models in DL-based apps. Obfuscation reduces model readability and lowers the automation level of attack tools.
[0013] Like Android malware, obfuscation techniques have the drawback that attackers can use obfuscation to mask illegal operations in their distributed DL-based apps.
[0014] The background technologies mentioned above focus on the security issues of deep learning models themselves. This invention, however, focuses on investigating whether deep learning models in DL-based apps illegally disclose sensitive user data during the inference process. Summary of the Invention
[0015] To address the problems existing in the prior art, this invention proposes a system-level method for testing information flow in Android applications based on deep learning. By utilizing automated information flow analysis and understanding the characteristics of information flow, it achieves the detection of polluted access from sensitive Source APIs to Sink APIs in the information flow of deep learning inference tasks.
[0016] This invention is achieved using the following technical solution:
[0017] A deep learning-based information flow testing system for Android applications, comprising an input unit, an information flow analysis module, and an output unit; wherein:
[0018] The input section is used to input applications that use deep learning into the system;
[0019] The information flow analysis module is used to understand and test the information flow in a deep learning-based Android application, and to clean and encode the node set and edge set of the global control flow graph. In the information flow analysis module, the node set and edge set are extracted from the global control flow graph and cleaned and encoded. The preprocessed global control flow graph is used as an interface to further execute the single-point backtracking algorithm and the sensitive information leakage detection algorithm in sequence.
[0020] The output section is used to output two types of reports: information flow analysis report and sensitive information leakage detection report.
[0021] A method for testing information flow in an Android application based on deep learning, the method includes the following steps:
[0022] Step 1: Collect the dataset, including methods for collecting Android application collections based on deep learning, and methods for collecting sensitive sources and sensitive sinks;
[0023] Step 2: Perform data preprocessing, obtain the global control flow graph from the Android application installation package file, and preprocess the global control flow graph; decompile and analyze the deep learning-based Android application to be detected, obtain each global control flow graph based on AndroGuard, and simplify the global control flow graph using data cleaning and encoding operations;
[0024] Step 3: Perform information flow analysis, including a single-point backtracking algorithm and a sensitive information leakage detection algorithm. The single-point backtracking algorithm is used to generate an information flow path by backtracking up and down at a single point and output an information flow analysis report. The sensitive information leakage detection algorithm is used to determine whether there is sensitive information leakage in the data flow process based on the information flow path generated by the single-point backtracking and output a sensitive information leakage detection report.
[0025] Compared with existing technologies, the collection of sensitive sources (Source and Sink) provided by this invention can effectively detect whether the deep learning model in a DL-based app leaks sensitive user information in the information flow during the inference process using the DLtrace static analysis tool. In actual detection, it was found that most DL-based apps have sensitive data leakage. Furthermore, compared with the existing sensitive data leakage detection tool FlowDroid, the DLtrace method of this invention has better actual detection capabilities than the traditional static analysis FlowDroid method. Attached Figure Description
[0026] Figure 1 This is a framework diagram of the information flow testing system in an Android application based on deep learning, as described in this invention.
[0027] Figure 2 This is a flowchart of the information flow testing method for Android applications based on deep learning, as described in this invention.
[0028] Figure 3 This is a diagram illustrating the details of sensitive data leakage detection.
[0029] Figure 4 This is a diagram illustrating the statistical results of the number and types of applications that use deep learning models (DL-based APP).
[0030] Figure 5 This diagram illustrates the classification ratio of Source APIs detected by the information flow analysis method (DLtrace) and static analysis method (FlowDroid) of this invention.
[0031] Figure 6 This is a detailed diagram illustrating the Source API and the Leaked App.
[0032] Figure 7 A diagram illustrating a specific instance of sensitive leaks detected by the information flow analysis tool DLtrace;
[0033] Figure 8 This is a schematic diagram and a writing format illustration of anonymous inner classes;
[0034] Figure 9 This diagram illustrates two examples of enhancement patterns in a deep learning model application (DL-based APP).
[0035] Figure 10Example diagrams of the implementation process of the two algorithms are shown: (10a) single-point backtracking algorithm (Trace algorithm); (10b) sensitive information leakage detection algorithm (Detection algorithm).
[0036] Figure label:
[0037] 100. Input section; 1, 200. Information flow analysis module; 300. First-party sensitive source; 2. Third-party sensitive source; 3. Sensitive data. Detailed Implementation
[0038] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.
[0039] like Figure 1 The diagram shows the framework of the information flow testing system for Android applications based on deep learning, as presented in this invention. The system includes an input unit 100, an information flow analysis module 200 (DLtrace) based on static taint analysis technology, and an output unit 300. The input unit 100 is for applications using deep learning (DL-based APP); the information flow analysis module 200 is used to understand and test the information flow in the Android application based on deep learning technology, cleaning and encoding the node and edge sets of the global control flow graph (CFG); the output unit 300 outputs two types of reports: an information flow analysis report and a sensitive information leakage detection report. Specifically, in the information flow analysis module 200, the preprocessed global call graph of the DL-based APP serves as the interface, sequentially executing the single-point backtracking algorithm and the sensitive information leakage detection algorithm.
[0040] like Figure 2 The flowchart shown illustrates the information flow testing method for Android applications based on deep learning, as described in this invention. The first stage involves data processing, while the second stage utilizes two algorithms designed in this paper to perform information flow analysis and output an information flow analysis report and a sensitive information leakage detection report. Specifically, it includes the following steps:
[0041] Step S1: Preliminary preparation work - dataset collection, including methods for collecting DL-based APP sets, as well as methods for collecting sensitive source APIs and sensitive sink APIs;
[0042] (1) Collection of DL-based APP collections
[0043] We pre-crawled and collected widely used DL-based apps for further research and testing: Feature binary library files were detected in the apps; apps integrating popular deep learning frameworks would have such feature binary library files. Considering the evolution of deep learning applications, the feature maps of deep learning frameworks were updated, currently covering a total of 16 mobile deep learning frameworks. Some of these are newly added, such as the pattern string TfLite for TFLite and TensorFlow Lite. Based on a static screening method, 208 DL-based apps were ultimately obtained from 19,306 candidate applications, and then clustered into 29 blocks using feature tags from Google Play. Apps of the same type will be used as similar research targets in the specific implementation section below.
[0044] (2) Collection of DL-related APIs (identification of sensitive sources and sensitive sinks)
[0045] To perform taint analysis, it's necessary to collect DL-related APIs as sensitive sources and sinks within a sensitive API set for sensitive data leakage detection. Sensitive sources refer to APIs related to deep learning inference tasks, such as APIs that load initial user image data into a face recognition discriminator or APIs that construct the discriminator. Sensitive sinks refer to methods that perform dangerous operations, such as database storage, network data transmission, and log storage—APIs that abnormally transmit inference data and results. Previously, FlowDroid automatically extracted APIs from the Android SDK source code as Sources and Sinks. However, these Sources and Sinks are all first-party APIs for Traditional Apps, preventing sensitive data leakage detection from locating and covering the deep learning model inference stage in DL-based apps. Currently, there's no strategy for automatically identifying APIs that manipulate sensitive user information during the deep learning model inference stage in DL-based apps. Two methods are used to collect Source and Sink sets: Method 1: Tracing the app's information flow using DLtrace (details of the tracing algorithm are provided below), filtering out sensitive Source and Sink APIs from the information flow. Method 2: Based on Android developer documentation. Finally, this paper re-identifies 72 Sources and 66 Sinks, including both first-party and third-party APIs. The selection of sensitive Sources and Sinks also includes first-party APIs because these APIs are closely related to the deep learning processing. For example, the first-party APIs in the android.graphics.BitmapFactory package are crucial for preprocessing and inputting image data in deep learning inference tasks. The collected and confirmed sensitive Source APIs and Sink APIs can be found in the DL-related-API.csv file.
[0046] Step S2: Data Preprocessing. Obtain the Global Control Flow Graph (CFG) from the APK file and preprocess it. The DL-based APP to be tested needs to be decompiled and analyzed. Using AndroGuard, obtain the Global Control Flow Graph (CFG) of the installation package (APK) of each input Android application. Simplify the CFG using data cleaning and encoding operations. The CFG summarizes the raw data of nodes and call edges. Data cleaning refers to processing the attribute information stored in each original node to ensure the readability of the output analysis report. Data encoding refers to encoding all nodes in the CFG, and a call edge is also represented using a node encoding pair. In information flow analysis, only the encoding is used to replace nodes and call edges. Before outputting the report, the encoding is mapped back to the original information of the method. To ensure the correctness of the experiment, the CFG does not filter external method connections and multiple calls. Since the encoded nodes are unique, parallel edges in the multigraph generated by node call relationships do not affect the operation. Therefore, the CFG of an APK file is a directed multigraph, defined as a tuple (see Definition 1).
[0047] Definition 1: Global Control Flow Graph (CFG)
[0048] A CFG is a directed multigraph, represented by a tuple CFG = (N, C), where N is the set of nodes and C is the call edge. Multiple calls between two nodes result in multiple call edges C.
[0049] Definition 2: Node N
[0050] A node is defined as an attribute quadruple M = (p, n, m, r), where p represents the package tag, n is the node name, m is the parameter list, and r is the method's return value (which can be empty). The components of the quadruple are often obfuscated by APK publishers, and all four attributes have a probability of being obfuscated.
[0051] Step S3: Perform information flow analysis:
[0052] To perform information flow analysis, this paper designs two algorithms with different focuses. The first algorithm is a single-point backtracking algorithm (Trace algorithm), which generates an information flow path by backtracking up and down from a single point. The second algorithm is a sensitive information leakage detection algorithm (Detection algorithm), which determines whether sensitive information leakage exists in the data flow process based on the information flow path generated by the single-point backtracking.
[0053] A detailed description of the single-point backtracking algorithm: For example, for a node Np in the information flow path, this node may be located in a sub-stage of the deep learning inference task, such as data preprocessing, construction of the inference detector, or processing of inference results. When only one node (specifically an input or output node) in the sub-stage of the information flow inference task is known, the algorithm calls APIs to the upper and lower layers, centered on node Np, and probes longer reachable paths (Nmax_b, ..., Np, ..., Nmax_e) for node Np. The algorithm uses a cleaned and encoded information set A extracted from the Android application's installation package (APK) as input. Initially, data preprocessing should determine the encoding set T of nodes {N1, ..., Nn} in the reachable path to be probed, the encoding set P of node N, and the encoding set S of the calling edge C. The output is an information flow report generated from nodes {N1, ..., Nn} in the encoding set T of the reachable path to be probed. Before information flow analysis, the CFG is first recovered using set S, and edge information is added to graph W by traversing S. Then, the algorithm determines the set of start and end points where a shortest path exists between node Ni and node i, where i ∈ (1…n). The shortest path algorithm, commonly used in graph algorithms, is used to solve for the start and end point sets. Upstream reachable paths to node Ni are calculated using the start point set, and downstream reachable paths to node Ni are calculated using the end point set. The reachable paths derived from nodes are calculated using the simple path solving approach in graph algorithms. Duplicate sub-paths are then removed and the resulting encoded paths are represented using the `simplePath` function. Finally, the encoded paths are converted and output to the information flow analysis report R. Line 8 of the algorithm contains the formula for determining the start point set of Ni, and the formula for the end point set to be collected is (T[i], P[q], W).
[0054] This is a sensitive information leakage detection algorithm (Detection algorithm) used to determine the valid information flow paths between point pairs. It will be used to perform sensitive information leakage detection. The algorithm's input is information extracted from the application, and the output is the existence of paths between the test point pair set and all valid paths. In the input, D represents the information extracted from the application, S is the encoding set of C, and P is the encoding set of N. I is the set of nodes to be predicted {N1, ..., Nn}, and the type_label needs to be assigned first. To each prediction node. First, a set of test points is labeled to classify the input test point set I; then, the algorithm determines all connections from START (as the Source point) to END (as the Sink point). Then the CFG is recovered, and connection judgments are made between all point pairs. Typically, the algorithm can determine the reachability between start[m] and end[n] in graph W if there exists at least one node sequence, start[m] = v0, ..., vn = end[n], where vk∈N (0≤k≤n∧d(start[m], end[n])>0), d represents the length of the directed path in the CFG, and then line 17 transforms the path between node start[m] and node end[n] using the simplePath function, and the output is the sensitive information leakage detection report R. In the process of using DLtrace to understand the information flow, a large number of APIs representing the functions of deep learning models in DL-based APPs were obtained through DLtrace. The latest sensitive sources and sensitive sinks in the information flow transmission process of DL-based APPs were summarized and organized into a DL-related-API.csv file, which was used as the baseline for sensitive information leakage detection.
[0055] 2. Functions of the identification model
[0056] In deep learning-based apps, the inference task of the deep learning model is only one part of the app's functionality. The inference results of the deep learning model are used to support the core functions of the application, and the inference results need to communicate and cooperate with other transaction processing modules. In other words, the tasks of the deep learning model in a deep learning-based app have functional differences from those of other transaction processing modules.
[0057] Currently, deep learning models in most DL-based apps are embedded in the app in binary form, making it difficult to directly access the deep learning models in the app. Although there are existing studies on stealing deep learning models from apps, verification has shown that after the theft, the structure of the model can be obtained intuitively, but the true function of the model still requires the cooperation of expert knowledge, and different parameter configurations and inputs also cause the model to perform different functions.
[0058] Therefore, without obtaining the model in the DL-based APP, it is a major challenge to determine what functions the deep learning model provides to the DL-based APP through the information flow of the DL-based APP. In order to identify the function of the model, the implementation process and results are set up as follows.
[0059] First, a statistical experiment was conducted to collect feature APIs. Deep learning models deployed on mobile devices require a DL-based app to transmit data to be inferred (e.g., an image). The model's offline inference results are then fed back to the DL-based app. The single-point backtracking algorithm in DLtrace can analyze the information flow of the model's inference process in various DL-based apps. Experiments revealed that models with similar functions have similar information flows. Based on this finding, APIs appearing in the information flow were summarized, and frequently occurring APIs were identified as feature APIs that help identify model functions. A mapping relationship was established between model functions and feature APIs. To further illustrate the feature APIs, based on the data processing in the information flow, this paper divides the information flow of the entire deep learning model's inference task into three segments: preparation and input of the data to be detected, construction of the inference detector, and processing of the inference results. To ensure that statistically relevant feature APIs are located in the inference stage of a deep learning-based application, each stage starts with a meta-API. A basic corpus of meta-APIs is pre-collected. These meta-APIs are defined in the official documentation of the open-source technology providing the machine learning suite. The DLtrace single-point backtracking algorithm is invoked to automatically acquire information from the application's information flow through these meta-nodes. APIs relevant to the model inference task are filtered from the information flow of the meta-nodes and added to them. The meta-node set is continuously enriched during iteration. Further manual statistical filtering is performed on the meta-node set, selecting APIs that perform the same type of inference function more frequently as the final feature APIs that can characterize the model's functionality.
[0060] Next, comparative experiments were conducted. Compared to previous work on model functionality identification, their proposed method involves manually determining the model's functionality through the descriptions of officially released applications. Based on their method, they statistically analyzed the fields related to deep learning technology in the official application descriptions of DL-based apps. To verify this invention, 208 DL-based apps were pre-collected as a test dataset, and the detection performance of DLtrace and FlowDroid in detecting sensitive data transmission anomalies during mobile deep learning model inference was evaluated. Experiments showed that DLtrace is a recent extension of research on sensitive data leakage in DL-based apps, and its detection performance is superior to FlowDroid.
[0061] Analyzing 208 DL-based applications, DLtrace can currently determine the functionality of 15 deep learning models and summarize a total of 173 feature APIs.
[0062] Deep learning models for speech recognition, speech synthesis, and machine translation were found to be used in TOOLS-type DL-based apps; image recognition and intelligent recommendation models were used in SHOPPING-type apps; image segmentation and other deep learning models were used in COMMUNICATION-type apps; and object recognition and time-of-arrival estimation models were found to be used in MAP_AND_NAVIGATION-type deep learning-based apps. The validation of model functionality in other categories of DL-based apps is shown in Table 1, which presents the deep learning model functionality identification results.
[0063] Table 1
[0064]
[0065] Table 2 shows the categories of feature APIs in financial DL-based apps. Taking a finance-related DL-based app as an example, APIs with a frequency higher than 15% in the DLtrace analysis information flow were extracted, and these APIs were not obfuscated.
[0066] Table 2
[0067]
[0068]
[0069] Comparing the two methods for identifying model functionality, using FINANCE category applications as an example, Table 3 compares DLtrace and the method of identifying deep learning model functionality through text description fields, showing the statistical results: The FINANCE category includes 17 DL-based apps, 88.24% (15 / 17), and the official descriptions do not contain any fields related to deep learning technology. DLtrace, through feature API analysis, identified 8 applications using face detection models, 13 applications using barcode detection models, and 6 applications using image text recognition models. The deep learning inference information flow of the lguplus.smartotp application underwent severe obfuscation, causing DLtrace to be unable to determine model functionality. Compared to the method using official descriptions, DLtrace's accuracy in identifying the functionality of deep learning models in FINANCE category DL-based apps (determining at least one model is used) is 94.12% (16 / 17). The identification results of the two methods for identifying deep learning model functionality in other categories of DL-based apps are shown in Table 1.
[0070] Table 3
[0071]
[0072]
[0073] The feature API collected by DLtrace provides a foundation for identifying the functionality of a deep learning model in an unknown DL-based app in the future, and proves the usefulness of DLtrace in assisting the understanding of information flow. Through comparative experiments, it was found that the accuracy of determining model functionality by relying on the officially released feature descriptions (such as the features of DL-based apps released on Google Play) is low. This is because the descriptions of non-core functions are omitted in the official submission information. By analyzing the information flow through DLtrace, DLtrace provides an effective method for identifying the functionality of models in DL-based apps.
[0074] Applying DLtrace to information flow understanding reveals that deep learning technology is being used in mobile devices in areas involving security or critical security issues, such as finance and even healthcare. These areas typically involve a great deal of sensitive information related to user privacy. How to detect the leakage of sensitive information in DL-based apps, especially whether there is leakage of sensitive information during model inference tasks, is also a key focus that must be addressed.
[0075] 3. Use DLtrace to perform sensitive data leakage detection.
[0076] In this section, taint analysis is used to perform sensitive information leakage detection on 208 DL-based apps. Similar to FlowDroid, DLtrace is designed as a general-purpose method, allowing the configuration of a set of DL-related APIs (Sources and Sinks that manipulate sensitive user information) into both DLtrace and FlowDroid. This same set of DL-related APIs limits DLtrace and FlowDroid to the same testing scope.
[0077] DLtrace extracts all Source and Sink APIs used in the DL-related API set for each APK under test, and uses them as test point set I, then calls the Detection algorithm for verification.
[0078] like Figure 3The diagram illustrates the details of sensitive data leakage detection. A Leaked App refers to a DL-based App that is found to have at least one pair of leaked sensitive data. The DLtrace method of this invention reports 54 Leaked Apps, among which pingou.champignouf.apk detected one pair of leaked sensitive data, and mmoney.wallet.apk had the most leaked sensitive data pairs. The FlowDroid method reports 39 Leaked Apps, with the most leaked sensitive data pairs detected in one of them. Meanwhile, as shown... Figure 6 As shown in (6b), DLtrace and FlowDroid simultaneously detected sensitive data leakage in 9 DL-based apps, and 18 pairs of leakage could be detected together.
[0079] Regarding the total number of leaked sensitive data pairs detected: DLtrace reported 161 sensitive data leakage paths out of 208 DL-based apps, while the FlowDroid method detected only 105 pairs, indicating poor detection capability. Specifically, the DLtrace method of this invention uses Androguard to extract the global control flow graph (CFG) of the DL-based app and retains all APIs in the application for further analysis. The FlowDroid method is based on the Soot extension, which is essentially a compiler. When analyzing APIs in an APK, it needs to convert the APIs into specific intermediate representations before further analysis. However, Soot's ability to convert third-party sensitive source APIs into intermediate representations (IRs) is limited, meaning the FlowDroid method's API analysis scope is not global. This limits the range of third-party APIs that the FlowDroid method can analyze.
[0080] like Figure 4The diagram illustrates the statistical results of the number and types of applications using deep learning models (DL-based apps). The results show that the DL-based app test dataset on Google Play belongs to 29 categories. The DLtrace method of this invention detected sensitive data leaks in 23 categories, while the FlowDroid method detected sensitive data leaks in 16 categories. For example, among the 208 applications, there are 17 SHOPPING type applications. DLtrace detected leaks in 3 of these applications, while FlowDroid reported leaks in 2. In the GAME_SPORTS and LIBRARIES_AND_DEMO application categories, neither FlowDroid nor DLtrace reported sensitive data leaks in the DL-based apps. However, this does not mean that these two categories are the most secure, as the amount of data collected for these categories is small, with only one application collected in each category.
[0081] like Figure 5 The diagram shows the classification ratio of SourceAPIs detected by the information flow analysis method (DLtrace) and static analysis method (FlowDroid) of this invention. Specifically, it details the percentage of sensitive Sources in the sensitive data leakage path. As shown in (5a), the total number of first-party sensitive sources 1 (1st PartySource) detected in the leakage path is 8, accounting for 4.97%, and the total number of third-party sensitive sources 2 (3rd PartySource) is 153, accounting for 95.03%. As shown in (5b), the total number of first-party sensitive sources 1 detected by the FlowDroid method is 80, and the total number of third-party sensitive sources 2 is 25, accounting for 76.19% (80 / 105) and 23.81% (25 / 105), respectively.
[0082] like Figure 6The diagram shows the details of the Source API and the leaked application (Leaked APP). The DLtrace method of this invention detects 8 categories of Source APIs and 6 categories of Sink APIs. The FlowDroid method detects 18 categories of Source APIs and 18 categories of Sink APIs. As shown in (6a), the DLtrace method of this invention detects 6 categories of Source APIs individually, all belonging to third-party sensitive sources, and exists in 74 leak pairs. The FlowDroid method detects 13 categories of Source APIs individually, all belonging to first-party sensitive sources. The leaks detected by both methods include one first-party Source (toString) and one third-party Source (load). The DLtrace method of this invention identifies one type of Sink API, existing in 3 leak pairs, namely the getContentCharSet API. The FlowDroid method identifies the toString function in the same package file as getContentCharSet, but does not detect the leak caused by this first-party Sink API.
[0083] Specifically, the DLtrace method of this invention detects sensitive third-party sources such as recognizeImage, createFileFromURI, and launchImageLibrary. Among these, the APIs related to the RequestManager class include parameters for setting the type of image resource source. The source of the image data stream can be a local connection, a URL, or a Drawable resource ID. This indicates that in the sensitive data leakage path detected by the DLtrace method of this invention, the sensitive source can be located in the first or second sub-stage of deep learning model inference, where the sensitive source obtains inference data or processes the inference data. A specific example is analyzed below. Figure 7 The diagram illustrates a specific instance of sensitive data leakage detected by the information flow analysis tool DLtrace. The sensitive data detected by the DLtrace method of this invention involves the transmission between the two APIs, recognizeImag and log, occurring between the second and third sub-stages of model inference. The image information input by the user into the deep learning model is illegally transmitted out through log. After processing the acquired data, the deep learning model illegally transmits the user's image recognition processing information during the inference result processing stage.
[0084] Compared to the FlowDroid method, the DLtrace method of this invention is more effective in detecting sensitive data leakage caused by third-party APIs in DL-based apps, with a wider API coverage. For example, in the analysis of sensitive data leakage caused by first-party APIs, the DLtrace method of this invention detected leakage situations that FlowDroid did not analyze. Moreover, there were 32 apps that FlowDroid could not analyze, but the DLtrace method of this invention detected illegal sensitive data leakage in three of them. Therefore, the DLtrace method of this invention, as an extension of the FlowDroid method in detecting first-party APIs, detects the leakage of sensitive data in DL applications.
[0085] 4. Other factors affecting DLtrace performance
[0086] This section explores potential performance improvements for DLtrace, as the characteristics of Java and Android limit the capabilities of static analyzers.
[0087] Let's take the data flow analysis of a key deep learning-based application as an example. For instance... Figure 9 As shown in the analysis diagram of the TensorFlowdetect DL-based app, the diagram first illustrates the non-sequential nature of API calls during the inference process of the deep learning module. For example, the getPixels and fetch APIs are not directly related; instead, they are unified by recognizeImage, which handles the data transfer results. This is illustrated in the example diagram. And β. In the image acquisition and processing part, there is EPβ between the runInBackguard and run() methods. The TensorFlowdetect APK combines multiple deep learning models at the same time. The various image recognition models use the same working mode. First, the recognizeImag interface is defined, and then the implements are used to control the dynamic binding of the recognizeImage API of the specific model at runtime through pointers. It is an instance of EP.
[0088] To address the issue of dynamic call edges that static analyzers cannot detect, this paper summarizes two EnhancementPattern techniques that can effectively extend the length of the analysis data stream when DLtrace encounters polymorphism and anonymous inner classes. In the future, similar advanced techniques (such as alias analysis) will be considered to achieve fully automated DLtrace analysis.
[0089] Table 4 shows the main challenges currently faced by static analyzers.
[0090] Table 4
[0091] dynamic code loading Dalvil bytecode reflection mechanism entry point native code integration Component lifecycle multi-threading usersystem events polymorphism inter-componentcommunication(ICC)
[0092] This invention addresses the polymorphism problem through enhancement patterns.
[0093] Meanwhile, the research community indicates that building a reliable and highly accurate static analyzer for Android faces many challenges, and the same issues exist for analyzing deep learning-based apps. Java-based detectors, when used to inspect mobile applications, must consider not only Android's characteristics but also Java's object-oriented features. Especially concerning issues such as dynamic code loading and polymorphism, the final state of the program can only be determined during execution. Therefore, static analysis techniques often require auxiliary analysis techniques, such as alias analysis.
[0094] Specific implementation verification revealed that Java's object-oriented inheritance mechanism is the main factor affecting DLtrace in this invention, and an Enhancement Pattern (EP) was designed for information flow analysis. For example, test node N a With N b There are no static direct call edges between the two test nodes in the Global Control Flow Graph (CFG). Static analysis reports that no reachable path exists between them. The static analysis method can detect two separate call sequences {{N}. a =v1, ...,v i-1}(from N a (start)} and {v i , ..., v n =N b}(by N) b (End), if v i-1 With v i If EP exists, then N a With N b Enhanced data flow via EP enables data connectivity between the two test nodes. Test node N a With N b It only undergoes one EP enhancement, which is represented as:
[0095]
[0096] Where, N a N b Let s be the test node, α be a single enhancement operation of the auxiliary enhancement template, β be the polymorphism in the auxiliary enhancement template, and β be the anonymous inner class template of the auxiliary enhancement template.
[0097] If test node N a Nb Reachability connectivity analysis of data flows between them requires iterative transformation through a series of auxiliary enhancement templates, specifically defined as:
[0098]
[0099] Abbreviated as:
[0100]
[0101] Where s1,...,s n To assist in enhancing the template enhancement operation for n iterations;
[0102] The auxiliary enhancement template EP involves two cases:
[0103] (1) Polymorphism α: Polymorphism allows different objects of the same class domain to respond to the same message. Object binding can only be determined at runtime; static analyzers cannot locate the specific call.
[0104] (2) Anonymous Inner Class β: Anonymous inner classes are common in Android applications, involving multithreading and callbacks. For example, listeners in AWT graphical interface programming often use anonymous inner classes. Figure 7 As shown, in the simplified inner class syntax, there is no static call edge between B-function, C-function, and D-function.
[0105] Intuitively speaking, polymorphism is manifested through method overloading and method overriding. Anonymous inner classes do not require the definition of a separate class, which is essentially also to support polymorphism.
Claims
1. A deep learning-based information flow testing system for Android applications, characterized in that, The system includes an input section, an information flow analysis module, and an output section; wherein: The input section is used to input applications that use deep learning into the system; The information flow analysis module is used to understand and test the information flow in a deep learning-based Android application. It cleans and encodes the node and edge sets of the global control flow graph. In the information flow analysis module, the node and edge sets are extracted from the global control flow graph and cleaned and encoded. Using the preprocessed global control flow graph as an interface, a single-point backtracking algorithm and a sensitive information leakage detection algorithm are executed sequentially. The sensitive information leakage detection algorithm makes a judgment based on the collection of DL-related sensitive sources and sensitive aggregates composed of first-party APIs and third-party APIs. The output section is used to output two types of reports: information flow analysis report and sensitive information leakage detection report.
2. A method for testing information flow in an Android application based on deep learning, executed by the information flow testing system for Android applications based on deep learning as described in claim 1, characterized in that... The method includes the following steps: Step 1: Collect the dataset, including methods for collecting Android application collections based on deep learning, and methods for collecting sensitive sources and sensitive sinks; Step 2: Perform data preprocessing, obtain the global control flow graph from the Android application installation package file, and preprocess the global control flow graph; decompile and analyze the deep learning-based Android application to be tested, obtain each global control flow graph, and simplify the global control flow graph using data cleaning and encoding operations; The global control flow graph summarizes the raw data of nodes and call edges. Data cleaning involves processing the attribute information stored in each raw node to ensure the readability of the output analysis report. Data encoding encodes all nodes in the global control flow graph, using node codes to represent a call edge. In information flow analysis, codes are used to replace nodes and call edges. Before outputting the report, the codes are mapped back to the original node information. When there is no statically reachable path between two test nodes, an auxiliary enhancement template is used to enhance the data flow, making the two test nodes... N a , N b Data flow between them is possible, if the test node N a , N b The data flow between the two test nodes requires multiple reachability connection analyses, iteratively transforming a series of auxiliary enhancement templates. When there is no static reachable path between the two test nodes, auxiliary enhancement templates are used to enhance the data flow, making the data flow between the two test nodes more accessible. N a , N b Data flow between them is possible, if the test node N a , N b The data flow between them requires multiple reachability connection analyses, and a series of auxiliary enhancement templates are iteratively transformed step by step. Step 3: Perform information flow analysis, including a single-point backtracking algorithm and a sensitive information leakage detection algorithm. The single-point backtracking algorithm is used to generate an information flow path by backtracking up and down at a single point and output an information flow analysis report. The sensitive information leakage detection algorithm is used to determine whether there is sensitive information leakage in the data flow process based on the information flow path generated by the single-point backtracking and output a sensitive information leakage detection report.
Citation Information
Patent Citations
Deep convolutional network and control flow diagram-based vulnerability detection system
CN108108622A