Privacy risk detection method and device for target applications

By monitoring the privacy-related interface call behavior of sub-apps on the test device, detecting the risks of unauthorized access and privacy data outreach, the problem of privacy risk detection in large applications is solved, and the privacy risk identification and development of complex business scenarios is realized. Test.

CN113986735BActive Publication Date: 2024-11-08ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111266308.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-28
Publication Date
2024-11-08
Estimated Expiration
2041-10-28

AI Technical Summary

Technical Problem

Sub-apps in large applications have privacy risks when using privacy rights, and lack effective detection methods.

Method used

By installing the target application on the test device, the Hook framework is used to monitor the sub-application's call behavior on privacy-related interfaces, detect the risks of unauthorized access and privacy data outreach, and generate detection result information.

Benefits of technology

Effectively identify and discover privacy risks in complex business scenarios, provide better coverage, and ensure the privacy and security of sub-applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113986735B_ABST
    Figure CN113986735B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a privacy risk detection method and device for a target application. The method can be applied to a test device, the test device is installed with a target application, the target application includes a sub-application, and the method includes: obtaining a test task for the sub-application, which includes multiple sub-tasks, and a single sub-task shows a certain page jump function of a certain page of the sub-application; according to the sub-task in the test task, executing the page jump function shown by the sub-task in the sub-application, and when monitoring the first call behavior triggered during the execution of the page jump function, detecting whether the first call behavior has a privacy risk in the privacy risk set, wherein the call object of the first call behavior is included in the interface set related to privacy; generating the detection result information of the sub-application according to the multiple detection results related to the test task obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technology, and in particular, to a method and device for detecting privacy risks for a target application. Background Art

[0002] With the rapid development of business and the popularity of light applications (such as mini-programs), some large applications have emerged. A large application may include multiple sub-applications, which may include, for example, software modules in the large application and mini-programs carried by the large application. In practice, large applications can provide sub-applications with very rich privacy permission usage capabilities with the help of the API (Application Programming Interface) provided by the operating system. Once a sub-application uses a certain privacy permission, there may be some privacy risk issues.

[0003] Therefore, there is an urgent need for a reasonable and reliable solution that can effectively detect privacy risks of sub-applications in large applications. Summary of the invention

[0004] The embodiments of this specification provide a privacy risk detection method and device for a target application, which can effectively perform privacy risk detection on sub-applications in the target application.

[0005] In a first aspect, an embodiment of the present specification provides a privacy risk detection method for a target application, which is applied to a test device, wherein the test device is installed with the target application, and the target application includes sub-applications. The method includes: obtaining a test task for the sub-application, which includes multiple sub-tasks, and a single sub-task shows a certain page jump function of a certain page of the sub-application; according to the sub-tasks in the test task, executing the page jump function shown by the sub-task in the sub-application, and when monitoring a first call behavior triggered during the execution of the page jump function, detecting whether the first call behavior has a privacy risk in a privacy risk set, wherein the call object of the first call behavior is included in a privacy-related interface set; and generating detection result information of the sub-application based on multiple detection results obtained related to the test task.

[0006] In some embodiments, the privacy risk set includes unauthorized access risks; and detecting whether the first calling behavior involves a privacy risk in the privacy risk set includes: determining whether the sub-application has calling permissions for the calling object; if the determination result is no, determining that the first calling behavior involves an unauthorized access risk.

[0007] In some embodiments, the method further includes: acquiring interface call relationship information related to the first call behavior; and determining a first function in the sub-application that triggers the first call behavior based on the interface call relationship information.

[0008] In some embodiments, the privacy risk set includes a risk of privacy data transmission; and detecting whether the first calling behavior has a privacy risk in the privacy risk set includes: obtaining the return value of the first function; determining whether the return value is included in the historical network requests of the sub-application; if the determination result is yes, determining that the first calling behavior has a risk of privacy data transmission.

[0009] In some embodiments, the class to which the first function belongs also includes a second function; and the method also includes: executing the second function, and when detecting a second calling behavior triggered during the execution of the second function, detecting whether the second calling behavior has a privacy risk in the privacy risk set, wherein the calling object of the second calling behavior is included in the interface set.

[0010] In some embodiments, executing the second function includes: executing the second function by means of reflection calling.

[0011] In some embodiments, the multiple detection results involve at least a first interface, and the first interface belongs to the interface set; the detection result information of the sub-application is generated based on the multiple detection results related to the test task obtained, including: if the set of detection results related to the first interface shows that the calling behavior of the first interface has at least one privacy risk in the privacy risk set, then generating first risk information for indicating the at least one privacy risk for the first interface, and incorporating the first risk information into the detection result information.

[0012] In some embodiments, generating the detection result information of the sub-application based on the multiple detection results obtained related to the test task also includes: determining the number of times the sub-application calls the first interface during the execution of the test task; if the number of calls reaches a preset number, generating second risk information for indicating the risk of high-frequency calls for the first interface, and incorporating the second risk information into the detection result information.

[0013] In some embodiments, the detection result information of the sub-application is generated based on the multiple detection results obtained related to the test task, including: for a detection result among the multiple detection results, if the detection result shows that its corresponding calling behavior has a privacy risk in the privacy risk set, then the function in the sub-application that triggers the calling behavior is determined as a risk function, and the risk source information of the risk function is obtained, and the risk function and the risk source information are included in the detection result information.

[0014] In some embodiments, the obtaining of the risk source information of the risk function includes: obtaining the risk source information from a construction platform of the sub-application according to the risk function.

[0015] In some embodiments, the risk source information includes at least one of the following items of the risk function: developer, code location, and bundle package information.

[0016] In some embodiments, the sub-application includes a software module in the target application, or a small program carried by the target application.

[0017] In some embodiments, the interface set includes at least one of the following interfaces: a system interface, an interface provided by the target application to the mini-program, and the system interface includes a device data interface and / or a user privacy data interface.

[0018] In some embodiments, obtaining the test task of the sub-application includes: receiving the test task sent by a server; and the method further includes: sending the detection result information to the server.

[0019] In some embodiments, the multiple subtasks are sampled by the server from a subtask set associated with the sub-application; the subtask set includes subtasks generated by the server based on page jump information received from multiple user devices on which the target application is installed.

[0020] In the second aspect, an embodiment of the present specification provides a privacy risk detection method for a target application, wherein the target application includes a sub-application, and the method includes: a server samples multiple sub-tasks from a sub-task set associated with the sub-application, and sends a test task including the multiple sub-tasks to a test device on which the target application is installed, wherein a single sub-task shows a certain page jump function possessed by a certain page of the sub-application; the test device executes the page jump function shown by the sub-task in the test task in the sub-application according to the sub-task in the test task, and when monitoring a first call behavior triggered during the execution of the page jump function, detects whether the first call behavior has a privacy risk in the privacy risk set, wherein the call object of the first call behavior is included in a set of interfaces related to privacy; and generates detection result information of the sub-application based on the multiple detection results obtained related to the test task.

[0021] In some embodiments, before sampling multiple subtasks from the subtask set associated with the sub-application, it also includes: receiving page jump information from multiple user devices on which the target application is installed, the page jump information being generated in response to a page jump operation performed by a user in a page of the sub-application; generating a subtask based on the page jump information, and classifying the subtask into the subtask set.

[0022] In the third aspect, an embodiment of the present specification provides a privacy risk detection device for a target application, which is applied to a test device, wherein the test device is installed with the target application, and the target application includes sub-applications. The device includes: an acquisition unit, configured to acquire a test task for the sub-application, which includes multiple sub-tasks, and a single sub-task shows a certain page jump function of a certain page of the sub-application; a detection unit, configured to execute the page jump function shown by the sub-task in the sub-application according to the sub-task in the test task, and when monitoring a first call behavior triggered during the execution of the page jump function, detect whether the first call behavior has a privacy risk in a privacy risk set, wherein the call object of the first call behavior is included in a privacy-related interface set; a generation unit, configured to generate detection result information of the sub-application based on multiple detection results obtained related to the test task.

[0023] In a fourth aspect, an embodiment of the present specification provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed in a computer, the computer is caused to execute the method described in any implementation manner in the first aspect.

[0024] In a fifth aspect, an embodiment of the present specification provides a computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in any implementation manner in the first aspect is implemented.

[0025] In a sixth aspect, an embodiment of the present specification provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the method described in any implementation manner in the first aspect.

[0026] The privacy risk detection method and device for the target application provided by the above embodiments of this specification can enable the test device to obtain the test task of the sub-application in the target application, execute the page jump function shown by the sub-task in the test task in the sub-application, and when monitoring the first call behavior triggered during the execution of the page jump function, detect whether the first call behavior has a privacy risk in the privacy risk set, and generate the detection result information of the sub-application based on the multiple detection results related to the test task obtained. Since the multiple sub-applications in the target application usually belong to different business scenarios, the solution provided by the above embodiments of this specification can discover and identify privacy risks in complex business scenarios, can perform privacy risk detection in line with the business scenarios, and has good coverage. As a result, effective privacy risk detection can be performed on the sub-applications in the target application. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the multiple embodiments disclosed in this specification, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only the multiple embodiments disclosed in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 is an exemplary system architecture diagram to which some embodiments of the present specification may be applied;

[0029] Figure 2 is a schematic diagram of an embodiment of a privacy risk detection method for a target application;

[0030] Figure 3 It is a schematic diagram of the execution process of the test task;

[0031] Figure 4 It is a structural diagram of a privacy risk detection device for a target application. DETAILED DESCRIPTION

[0032] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. The described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of this application.

[0033] It should be noted that, for the convenience of description, only the parts related to the invention are shown in the drawings. The embodiments and features in the embodiments in this specification can be combined with each other without conflict. In addition, the words "first", "second" and the like in this specification are only used for information distinction and do not play any limiting role.

[0034] As mentioned above, once a sub-application in a large application uses a certain privacy permission, there may be some privacy risk issues. Based on this, some embodiments of this specification provide a privacy risk detection method for a target application, through which an effective privacy risk detection can be achieved for a sub-application in a target application (such as a large application). Specifically, Figure 1 An exemplary system architecture diagram suitable for use with these embodiments is shown.

[0035] like Figure 1 As shown, the system architecture may include a server and a test device. The server may be a cloud server or a physical server, etc., and the test device may be a smart phone or a tablet computer, etc., which are not specifically limited here. In practice, the test device may be installed with a target application and a Hook framework. The server may be a background server of the target application, or a server specifically used for privacy risk detection and processing.

[0036] The target application can be any type of application, such as a payment application (such as Figure 1 The target application may include a payment application A), a social application, a shopping application, or an educational application, etc. In addition, the target application generally includes multiple sub-applications. Any of the multiple sub-applications may be a software module in the target application, or a small program carried by the target application.

[0037] The Hook framework built in the test device can be used to change the operating logic of the target application and can intercept the state of the interfaces in the privacy-related interface set when the target application is running. Based on this, when the target application is running, the test device can use the Hook framework to monitor the calling behavior of the sub-applications in the target application on the interfaces in the interface set.

[0038] The Hook framework may include, for example, but is not limited to, a frida framework, or an Xposed framework, etc. The above interface set may include at least one interface, such as a system interface, and / or an interface provided by the target application to the applet. The system interface may include, for example, a device data interface and / or a user privacy data interface.

[0039] Furthermore, the device data interface may include, for example, an IMEI (International Mobile Equipment Identity) interface, an IMSI (International Mobile Subscriber Identity) interface, an IDFA (Identifer for Advertising) interface, a disk interface, a memory interface, a CPU (Central Processing Unit) interface, and / or a MAC (Media Access Control) address interface, etc. The user privacy data interface may include, for example, an LBS (Location Based Services) interface, a motion interface, a health interface, a biometric interface, a camera interface, and / or a microphone interface, etc.

[0040] In practice, multiple sub-applications in the target application can be associated with sub-task sets respectively. For any sub-application in the multiple sub-applications, each sub-task in the sub-task set associated with the sub-application can be generated based on page jump information generated from multiple user devices. Among them, the multiple user devices are respectively installed with the target application, and the page jump information can be generated in response to a page jump operation performed by the user in the page of the sub-application. It should be understood that the page can be provided with at least one control (such as a button, a hyperlink, etc.) for implementing a page jump, and the user can perform a page jump operation by triggering (for example, clicking) the control. It should be noted that the page jump protocol based on the control includes but is not limited to the Scheme jump protocol.

[0041] The page jump information may include, but is not limited to, the application identifier of the sub-application where the source page is located, the page identifier of the source page, the page identifier of the target page, the jump path of the target page (such as a registered URL Scheme), parameter information, and the like. Among them, the source page is the page to be jumped out, and the target page is the page to be jumped in. The source page and the target page can be located in the same sub-application or in different sub-applications, which is not specifically limited here. The parameter information may include, but is not limited to, parameters related to privacy, such as identity card number, bank card number, and / or biometric information (such as fingerprint image and / or face image, etc.), and the like. It should be noted that the parameter information may specifically include at least one parameter name (also referred to as field name), and parameter values ​​corresponding to the at least one parameter name.

[0042] The subtask generated according to the page jump information can show a certain page jump function of a certain page in the corresponding sub-application. Specifically, the subtask can include, for example, the application identifier of the sub-application, the page identifier of the page (which can be called the source page), the page identifier of the target page, the jump path of the target page, and at least one parameter name. It should be understood that the subtask can usually uniquely indicate the page jump function.

[0043] In some embodiments, the subtask set as described above may be generated by other servers, and the server may have the authority to access the subtask set. In some embodiments, the subtask set may be generated by the server. For example, the server may obtain page jump information generated in a sub-application of the target application, generate a subtask based on the page jump information, and assign the subtask to the subtask set associated with the sub-application. The server may, for example, obtain such page jump information collected by other servers, or may obtain such page jump information from multiple user devices on which the target application is installed, which is not specifically limited here.

[0044] The following takes the example of the server obtaining page jump information from multiple user devices and the target application is payment application A to further introduce the system architecture.

[0045] like Figure 1 As shown, the system architecture may also include multiple user devices, such as user device 1, ..., user device M. The multiple user devices are respectively installed with payment application A. Payment application A may include sub-application A_1, ..., sub-application A_N, for example. Wherein, M and N are both natural numbers greater than 1. In addition, payment application A is also installed in the test device.

[0046] Before performing privacy risk detection on the sub-applications in the payment application A, the server may receive page jump information reported by the above-mentioned multiple user devices, such as page jump information generated in any sub-application A_i of the payment application A. Wherein, i is a natural number greater than or equal to 1 and less than or equal to N. It should be noted that the payment application A installed by the above-mentioned multiple user devices may be embedded with code for collecting page jump information, and the server may specifically receive the page jump information reported by the code. Afterwards, the server may generate a subtask based on the received page jump information, and classify the subtask into the subtask set associated with the corresponding sub-application. For example, the subtask generated based on the page jump information generated in the sub-application A_i may be classified into the subtask set associated with the sub-application A_i.

[0047] When it is necessary to perform privacy risk detection on sub-application A_i, the server can sample multiple sub-tasks from the sub-task set associated with sub-application A_i, and send a test task including the multiple sub-tasks to the test device. Afterwards, the test device can execute the test task to perform privacy risk detection on sub-application A_i, thereby generating the final detection result information of sub-application A_i. It should be pointed out that during the execution of the test task, the test device can use the established Hook framework to monitor the calling behavior of sub-application A_i on the interfaces in the above interface set, and perform privacy risk detection on the calling behavior.

[0048] It should be noted that when there are multiple sub-applications to be tested for privacy risks, the server can send the test tasks of each of the multiple sub-applications to the test device at one time, or send the test tasks of each of the multiple sub-applications to the test device separately, without specific limitation here.

[0049] In practice, multiple sub-applications in the target application usually provide different services and belong to different business scenarios. Through the above process, privacy risks can be discovered and identified in complex business scenarios, and privacy risk detection can be carried out in line with business scenarios with good coverage. Therefore, effective privacy risk detection can be carried out on sub-applications in the target application.

[0050] The specific implementation steps of the above method are described below in conjunction with specific embodiments.

[0051] See also Figure 2 , which shows a schematic diagram of an embodiment of a privacy risk detection method for a target application. The target application includes a sub-application, and the method includes the following steps:

[0052] Step 206, the server samples a plurality of subtasks from the subtask set associated with the sub-application;

[0053] Step 208, the server sends the test task of the sub-application to the test device on which the target application is installed, which includes the multiple sub-tasks;

[0054] Step 210, the test device executes the test task of the sub-application;

[0055] Step 212: The test device generates test result information of the sub-application according to the obtained multiple test results related to the test task.

[0056] In this embodiment, the target application may include multiple sub-applications, and the multiple sub-applications may be associated with sub-task sets respectively. Among them, a single sub-task may show a certain page jump function of a certain page in its corresponding sub-application. Here, for the explanation of the sub-task set, please refer to the relevant description in the previous text, which will not be repeated here.

[0057] It should be noted that any of the above-mentioned multiple sub-applications can be a software module in the target application, or a small program carried by the target application, which is not specifically limited here.

[0058] For any of the above multiple sub-applications, for example Figure 1 For the sub-application A_i shown in FIG, when it is necessary to perform privacy risk detection on the sub-application A_i, the server can perform step 206 to sample multiple sub-tasks from the sub-task set associated with the sub-application A_i.

[0059] In practice, the sub-application A_i may include multiple pages, and any page in the multiple pages generally has at least one page jump function. Therefore, for each page in at least part of the multiple pages, the server can sample at least one subtask corresponding to the page from the subtask set, wherein the at least one subtask is generally different from each other. Afterwards, the server can form the multiple subtasks with the subtasks sampled for at least part of the pages.

[0060] Next, the server can send the test task of sub-application A_i, that is, the test task including the multiple sub-tasks, to the test device by executing step 208. It should be understood that when there are multiple sub-applications to be tested for privacy risks, the server can send the test tasks of each of the multiple sub-applications to the test device at one time, or send the test tasks of each of the multiple sub-applications to the test device separately.

[0061] Next, the test device may execute the received test task by executing step 210. Specifically, the execution process of the test task in step 210 may be as follows: Figure 3 shown.

[0062] See also Figure 3 , the execution process may include the following steps:

[0063] Step 302, according to the subtask in the test task of the sub-application, executing the page jump function shown by the subtask in the sub-application;

[0064] Step 304, monitoring a first calling behavior triggered during the execution of the page jump function, wherein the calling object of the first calling behavior is included in the privacy-related interface set;

[0065] Step 308: When the first calling behavior is monitored, detect whether the first calling behavior has a privacy risk in the privacy risk set.

[0066] Continuing with the sub-application A_i as an example, for each sub-task in the test task of the sub-application A_i, the test device can execute step 302 to execute the page jump function shown in the sub-task in the sub-application A_i according to the sub-task. Afterwards, the test device can monitor the first call behavior triggered during the execution of the page jump function by executing step 304, and the call object of the first call behavior is included in the interface set as described above. Specifically, the test device can use the built Hook framework to monitor the first call behavior triggered during the execution of the page jump function. Then, when the first call behavior is monitored, the test device can detect whether the first call behavior has a privacy risk in the privacy risk set by executing step 308.

[0067] The privacy risk set may include at least one privacy risk, such as unauthorized access risk, and / or private data transmission risk. Among them, the unauthorized access risk can be understood as the risk that the user has not authorized the privacy-related interface, but the APP (Application) directly calls the interface. The private data transmission risk can be understood as the risk that the APP transmits the private data to a third-party manufacturer in the process of obtaining the user's privacy.

[0068] In some embodiments, when the privacy risk set includes unauthorized access risk, in step 308, the test device may determine whether the sub-application A_i has the calling permission to call the object. If the determination result is no, it may be determined that the first calling behavior has an unauthorized access risk. If the determination result is yes, it may be determined that the first calling behavior does not have an unauthorized access risk.

[0069] It should be noted that both the target application and the operating system in the test device may have an authorization interface, which can be called by the test device to query the authorization status of the privacy-related interface. Based on this, when the calling object belongs to the system interface, the test device can call the authorization interface of the operating system to query the authorization status of the calling object under the sub-application A_i, and determine whether the sub-application A_i has the calling authority to call the calling object based on the authorization status. When the calling object belongs to the interface provided by the target application to the applet, the test device can call the authorization interface of the target application to query the authorization status of the calling object under the sub-application A_i, and determine whether the sub-application A_i has the calling authority to call the calling object based on the authorization status.

[0070] In some embodiments, after step 304, the test device may execute step 306 in response to monitoring the first call behavior. In step 306, the test device may obtain interface call relationship information related to the first call behavior, and determine the first function in the sub-application that triggers the first call behavior according to the interface call relationship information.

[0071] The interface call relationship information can be used to describe the call relationship between the first function and the call object of the first call behavior. As an example, the interface call relationship information can be implemented as a function sequence, and the function sequence can include the first function and the call object. For example, assuming that the first function is function a, and the call object is interface c (also referred to as function c), the function sequence can be, for example,<a,c> Optionally, when the first function indirectly calls the calling object, the function sequence may also include other functions through which the first function calls the calling object. For example, assuming that the other functions include function b, in the actual calling process, function a calls function b, and function b calls interface c, the function sequence may be, for example,<a,b,c> .

[0072] As an example, the target application may have an interface call relationship information recording function, and the test device may obtain the interface call relationship information related to the first call behavior recorded by the target application. As another example, the test device may analyze the interface call relationship information related to the first call behavior based on the stack of the target application. It should be understood that the test device may use various methods to obtain the interface call relationship information, which is not specifically limited here.

[0073] In some embodiments, after executing step 306, when the privacy risk set includes the risk of private data transmission, in step 308, the test device can obtain the return value of the first function and determine whether the return value is included in the historical network request of the sub-application. If the result of the determination is yes, it can be determined that the first call behavior has the risk of private data transmission. If the result of the determination is no, it can be determined that the first call behavior does not have the risk of private data transmission.

[0074] Continuing with the sub-application A_i as an example, after the test device determines the first function that triggers the first call behavior in the sub-application A_i and obtains the return value of the first function, it can obtain the historical network requests of the sub-application A_i, for example, from the background server of the sub-application A_i, or the test device can be deployed with a network request proxy program, and the historical network requests of the sub-application A_i can be obtained from the network request proxy program. Afterwards, the test device can determine whether the return value is included in the obtained historical network requests.

[0075] For the subtask in the test task of sub-application A_i, after executing step 308 for the subtask, a detection result related to the subtask can be obtained. The detection result can show that there is no privacy risk in the first calling behavior corresponding to the subtask, or show that there is at least one privacy risk in the first calling behavior.

[0076] It should be noted that when performing a page jump, it is usually necessary to pass parameters, which generally include parameters related to privacy. Based on this, the execution process of the page jump function as described above usually triggers the first call behavior, so after executing a test task, the test results associated with at least some of the subtasks in the test task can be obtained, that is, multiple test results related to the test task can be obtained.

[0077] In practice, when a function in a class has a privacy call behavior, other functions in the class may also have privacy call behaviors. In order to detect some privacy call risk behaviors that are deeply hidden, in some embodiments, after executing step 306, the following steps may also be performed:

[0078] Step 310, executing the second function in the class where the first function is located;

[0079] Step 312, monitoring a second calling behavior triggered during the execution of the second function, wherein the calling object of the second calling behavior is included in the above interface set;

[0080] Step 314: when the second calling behavior is monitored, detect whether the second calling behavior has a privacy risk in the above privacy risk set.

[0081] Among them, the implementation methods of steps 312 and 314 are similar to those of steps 304 and 308. Please refer to the relevant instructions of steps 304 and 308, and will not be repeated here.

[0082] In step 310, the test device may execute the second function by means of reflection calling. The second function is a function other than the first function in the class where the first function is located. In practice, by means of reflection calling, dynamic calling of any function in any class can be realized. Since the reflection calling mechanism is an existing well-known technology, it will not be described here.

[0083] In some embodiments, the test device may also simulate the execution of the second function in step 310. For example, a CPU emulator framework (such as Unicorn framework, etc.) may be built in the test device, and the test device may use the CPU emulator framework to simulate the execution of the second function.

[0084] After executing step 314 for the second function, a detection result related to the second function can be obtained, and the detection result can show that the second calling behavior corresponding to the second function does not have a privacy risk, or shows that the second calling behavior has at least one privacy risk. It should be pointed out that since the detection result related to the second function is obtained during the execution of the test task, the detection result can be regarded as a detection result related to the test task.

[0085] According to the above description, after executing the test task of sub-application A_i, the test device can obtain multiple test results related to sub-application A_i. It should be understood that the multiple test results may include test results associated with at least some of the sub-tasks in the test task. In addition, when executing steps 310-314, the multiple test results may also include test results associated with at least some of the second functions in sub-application A_i.

[0086] Next, in step 212, the testing device may generate detection result information of the sub-application A_i according to a plurality of detection results related to the sub-application A_i.

[0087] Specifically, the multiple detection results at least involve the first interface, and the first interface belongs to the above-mentioned interface set. If the set of detection results related to the first interface shows that the calling behavior of the first interface has at least one privacy risk in the above-mentioned privacy risk set, first risk information indicating the at least one privacy risk can be generated for the first interface, and the first risk information can be included in the detection result information of the sub-application A_i.

[0088] The first risk information may include, for example, the name or identifier of the at least one privacy risk. Optionally, the first risk information may also include an interface identifier of the first interface. Optionally, the first risk information may not include the interface identifier, in which case the interface identifier and the first risk information may be included in the detection result information of the sub-application A_i.

[0089] As an example, assuming that the above-mentioned privacy risk set includes unauthorized access risk and privacy data leakage risk, the set of detection results related to the first interface includes detection result a, detection result b and detection result c, wherein detection result a shows that there is no privacy risk in the calling behavior of the first interface (such as the first calling behavior or the second calling behavior), detection result b shows that there is an unauthorized access risk in the calling behavior of the first interface, and detection result c shows that there is a privacy data leakage risk in the calling behavior of the first interface. In this case, the set of detection results related to the first interface can show that there is an unauthorized access risk and a privacy data leakage risk in the calling behavior of the first interface.

[0090] In some embodiments, in step 212, the test device may also determine the number of calls made by sub-application A_i to the first interface during the execution of the test task of sub-application A_i. For example, during the execution of the test task, the test device may accumulate the number of calls made by sub-application A_i to the first interface, and based on this, the test device may obtain the accumulated number of calls. Alternatively, the test device may count the number of calls made by sub-application A_i to the first interface based on a set of detection results related to the first interface. Afterwards, the test device may generate second risk information indicating a high-frequency call risk for the first interface in response to the number of calls made by sub-application A_i to the first interface reaching a preset number, and include the second risk information in the detection result information of sub-application A_i. Thus, in complex business scenarios, effective detection of high-frequency call risks can also be achieved.

[0091] Among them, the preset number of times can be 10, 20, 30 or 50, etc., which can be set according to actual needs and are not specifically limited here. The second risk information may include, for example, the name or identifier of the high-frequency call risk. Optionally, the second risk information may also include the interface identifier of the first interface. Optionally, the second risk information may not include the interface identifier. In this case, the interface identifier and the second risk information may be correspondingly included in the detection result information of the sub-application A_i.

[0092] In some embodiments, in step 212, for a detection result among multiple detection results related to sub-application A_i, if the detection result shows that its corresponding calling behavior has a privacy risk in the above-mentioned privacy risk set, the testing device can determine the function (for example, the first function or the second function) that triggers the calling behavior in sub-application A_i as a risk function, and obtain the risk source information of the risk function, and include the risk function and the risk source information in the detection result information of sub-application A_i.

[0093] Specifically, the test device can obtain risk source information from the construction platform of the sub-application A_i according to the risk function. The risk source information may include the developer of the risk function, the code location, and / or the bundle package information, etc. Therefore, the solution provided in the embodiment of this specification can be combined with the APP construction platform, and the discovered privacy risks can be traced back to the specific developer and the corresponding module.

[0094] exist Figure 2 In the corresponding embodiment, by executing steps 206-212, the server can send the test task of the sub-application in the target application to the test device, and the test device can perform privacy risk detection on the sub-application by executing the test task. By adopting such a detection method, privacy risks can be discovered and identified in complex business scenarios, and privacy risk detection can be carried out in accordance with business scenarios with good coverage. Therefore, effective privacy risk detection can be carried out on the sub-application in the target application.

[0095] In addition, according to the description in the foregoing, the solution provided by the embodiments of this specification can cover the risks of unauthorized access, the risk of private data transmission, and the risk of high-frequency calls, etc. These risks are the risks that the current national supervision is more concerned about. Moreover, the solution can detect some deeply hidden privacy call risk behaviors by discovering other privacy call behaviors through the execution of the second function as described above.

[0096] In some embodiments, after step 212, the following may be further included: step 214, the test device sends the detection result information of the sub-application to the server. It should be understood that the test device may send the detection result information of each sub-application to the server after obtaining the detection result information of the sub-application. Alternatively, after obtaining the detection result information of each of the multiple sub-applications, the test device may send the detection result information of each of the multiple sub-applications to the server at one time.

[0097] It should be noted that the detection result information of the sub-application may include the application identifier of the sub-application in addition to the various information described above (such as the first risk information, the second risk information, the risk function, the risk source information, etc.), so in step 214, the test device may only send the detection result information of the sub-application to the server. Optionally, the detection result information of the sub-application may not include the application identifier of the sub-application, so in step 214, the test device may send the application identifier of the sub-application together with the detection result information to the server.

[0098] In some embodiments, before step 206, it may also include: step 202, the server receives page jump information from multiple user devices on which the target application is installed, and the page jump information is generated in response to a page jump operation performed by the user in a page of a sub-application of the target application; step 204, the server generates a sub-task based on the page jump information, and classifies the sub-task into a sub-task set associated with the corresponding sub-application.

[0099] It should be understood that the page jump information is generated in the sub-application of the target application. Taking sub-application A_i as an example, for the page jump information generated in sub-application A_i, after the server generates a sub-task according to the page jump information, the sub-task can be classified into the sub-task set associated with sub-application A_i.

[0100] It should be noted that in order to ensure the security of privacy data, for page jump information containing privacy data, the user device can first encrypt the privacy data in the page jump information, for example, using the encryption method agreed with the server, and then send the encrypted page jump information to the server.

[0101] In addition, the users to which the above-mentioned multiple user devices belong respectively can be real users of the target application. The server collects page jump information of multiple real users of the target application, and generates a subtask set associated with multiple sub-applications in the target application based on the collected page jump information, and sends the test task of the corresponding sub-application composed of multiple subtasks in the subtask set to the test device, so that the test device can perform privacy risk detection on the sub-application by executing the test task, which can realize the combination of privacy detection technology and big data, so that it can be more suitable for the business scenario of the APP for privacy risk detection, and has a good coverage effect.

[0102] Further references Figure 4 This specification provides an embodiment of a privacy risk detection device for a target application. The device can be applied to a test device, the test device is installed with a target application, and the target application includes sub-applications.

[0103] like Figure 4As shown, the privacy risk detection device 400 for the target application of this embodiment includes: an acquisition unit 401, a detection unit 402 and a generation unit 403. The acquisition unit 401 is configured to acquire the test task of the above sub-application, which includes multiple sub-tasks, and a single sub-task shows a certain page jump function of a certain page of the above sub-application; the detection unit 402 is configured to execute the page jump function shown by the sub-task in the test task in the above sub-application, and when monitoring the first call behavior triggered during the execution of the page jump function, detect whether the first call behavior has a privacy risk in the privacy risk set, wherein the call object of the first call behavior is included in the interface set related to privacy; the generation unit 403 is configured to generate the detection result information of the sub-application according to the multiple detection results related to the test task obtained.

[0104] In some embodiments, the privacy risk set includes unauthorized access risks; and the detection unit 402 may include a first detection sub-unit (not shown in the figure), which is configured to determine whether the above-mentioned sub-application has the calling permission to call the object; if the determination result is no, it is determined that the first calling behavior has an unauthorized access risk.

[0105] In some embodiments, the acquisition unit 401 can also be configured to: acquire interface call relationship information related to the first calling behavior; the above-mentioned device 400 can also include: a determination unit (not shown in the figure), which is configured to determine the first function in the above-mentioned sub-application that triggers the first calling behavior based on the interface call relationship information.

[0106] In some embodiments, the privacy risk set includes the risk of privacy data transmission; and the detection unit 402 may include a second detection sub-unit (not shown in the figure), which is configured to obtain the return value of the first function; determine whether the return value is included in the historical network requests of the above-mentioned sub-application; if the determination result is yes, it is determined that the first calling behavior has the risk of privacy data transmission.

[0107] In some embodiments, the class to which the first function belongs may also include a second function; and the detection unit 402 may also include: a third detection subunit (not shown in the figure), which is configured to execute the second function and, when detecting a second calling behavior triggered during the execution of the second function, detect whether the second calling behavior has a privacy risk in the above-mentioned privacy risk set, wherein the calling object of the second calling behavior is included in the above-mentioned interface set.

[0108] In some embodiments, the third detection subunit may be further configured to execute the second function by adopting a reflective call.

[0109] In some embodiments, the above-mentioned multiple detection results involve at least a first interface, and the first interface belongs to the above-mentioned interface set; the generation unit 403 can be further configured to: if the set of detection results related to the first interface shows that the calling behavior of the first interface has at least one privacy risk in the above-mentioned privacy risk set, then generate first risk information for indicating the at least one privacy risk for the first interface, and include the first risk information in the detection result information.

[0110] In some embodiments, the generation unit 403 can be further configured to: determine the number of times the above-mentioned sub-application calls the first interface during the execution of the test task; if the number of calls reaches a preset number, generate second risk information for the first interface to indicate the risk of high-frequency calls, and include the second risk information in the detection result information.

[0111] In some embodiments, the generation unit 403 can be further configured to: for a detection result among the above-mentioned multiple detection results, if the detection result shows that its corresponding calling behavior has a privacy risk in the privacy risk set, then the function that triggers the calling behavior in the above-mentioned sub-application is determined as a risk function, and the risk source information of the risk function is obtained, and the risk function and the risk source information are included in the detection result information.

[0112] In some embodiments, the generating unit 403 may be further configured to: obtain risk source information from the construction platform of the above-mentioned sub-application according to the risk function.

[0113] In some embodiments, the risk source information may include the developer of the risk function, the code location and / or bundle information, etc.

[0114] In some embodiments, the sub-application may include a software module in the target application, or a small program carried by the target application.

[0115] In some embodiments, the above interface set may include a system interface and / or an interface provided by the target application to the mini-program. The system interface may include a device data interface and / or a user privacy data interface.

[0116] In some embodiments, the acquisition unit 401 may be configured to: receive the test task sent by the server; and the above-mentioned device 400 may also include: a sending unit (not shown in the figure), configured to send the detection result information to the server.

[0117] In some embodiments, the above-mentioned multiple subtasks can be sampled by the server from the subtask set associated with the above-mentioned sub-application; the subtask set can include subtasks generated by the server based on page jump information received from multiple user devices installed with the target application.

[0118] exist Figure 4 For the specific processing of each unit and the technical effects thereof, please refer to Figure 2 The relevant descriptions in the corresponding embodiments will not be repeated here.

[0119] The embodiments of this specification also provide a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the privacy risk detection method for the target application described in the above method embodiments.

[0120] An embodiment of the present specification also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the privacy risk detection method for the target application described in the above method embodiments is implemented.

[0121] The embodiments of this specification also provide a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the privacy risk detection method for the target application described in the above method embodiments.

[0122] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the multiple embodiments disclosed in this specification can be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0123] In some cases, the actions or steps described in the claims may be performed in a different order than in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0124] The specific implementation methods described above further illustrate in detail the purposes, technical solutions and beneficial effects of the multiple embodiments disclosed in this specification. It should be understood that the above description is only the specific implementation methods of the multiple embodiments disclosed in this specification, and is not used to limit the protection scope of the multiple embodiments disclosed in this specification. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the multiple embodiments disclosed in this specification should be included in the protection scope of the multiple embodiments disclosed in this specification.

Claims

1. A privacy risk detection method for a target application, applied to a test device, wherein the test device is installed with the target application, the target application includes a sub-application, and the method comprises: Receiving a test task of the sub-application sent by the server, the test task including multiple sub-tasks, wherein a single sub-task indicates a certain page jump function of a certain page of the sub-application; The multiple subtasks are sampled by the server from a subtask set associated with the sub-application; each subtask in the subtask set is generated according to page jump information generated from multiple user devices on which the target application is installed; According to the subtask in the test task, a page jump function shown in the subtask is executed in the sub-application, and when a first call behavior triggered during the execution of the page jump function is monitored, it is detected whether the first call behavior has a privacy risk in a privacy risk set, wherein a call object of the first call behavior is included in a privacy-related interface set; Generate detection result information of the sub-application based on the obtained multiple detection results related to the test task.

2. The method according to claim 1, wherein: The privacy risk set includes unauthorized access risk; as well as The detecting whether the first calling behavior has a privacy risk in a privacy risk set includes: Determine whether the sub-application has the calling permission of the calling object; If the determination result is no, it is determined that the first calling behavior has an unauthorized access risk.

3. The method according to claim 1, wherein: The method further comprises: Acquire interface call relationship information related to the first calling behavior; A first function in the sub-application that triggers the first calling behavior is determined according to the interface calling relationship information.

4. The method according to claim 3, wherein: The privacy risk set includes the risk of private data being leaked; as well as The detecting whether the first calling behavior has a privacy risk in a privacy risk set includes: Obtaining the return value of the first function; Determine whether the return value is included in the historical network requests of the sub-application; If the determination result is yes, it is determined that the first calling behavior has the risk of private data being transmitted.

5. The method according to claim 3, wherein: The class where the first function belongs also includes a second function; and The method further comprises: Execute the second function, and when detecting a second calling behavior triggered during the execution of the second function, detect whether the second calling behavior has a privacy risk in the privacy risk set, wherein the calling object of the second calling behavior is included in the interface set.

6. The method according to claim 5, wherein: The executing the second function comprises: The second function is executed by using a reflection call.

7. The method according to any one of claims 1 to 6, wherein: The multiple detection results at least relate to a first interface, and the first interface belongs to the interface set; The generating the detection result information of the sub-application according to the obtained multiple detection results related to the test task includes: If the set of detection results related to the first interface shows that the calling behavior of the first interface involves at least one privacy risk in the privacy risk set, first risk information indicating the at least one privacy risk is generated for the first interface, and the first risk information is included in the detection result information.

8. The method according to claim 7, wherein: The generating the detection result information of the sub-application according to the obtained multiple detection results related to the test task also includes: Determine the number of calls to the first interface by the sub-application during the execution of the test task; If the number of calls reaches a preset number, second risk information indicating a high-frequency call risk is generated for the first interface, and the second risk information is included in the detection result information.

9. The method according to any one of claims 3 to 6, wherein: The generating the detection result information of the sub-application according to the obtained multiple detection results related to the test task includes: For a detection result among the multiple detection results, if the detection result shows that its corresponding calling behavior has a privacy risk in the privacy risk set, the function that triggers the calling behavior in the sub-application is determined as a risk function, and the risk source information of the risk function is obtained, and the risk function and the risk source information are included in the detection result information.

10. The method according to claim 9, wherein: The step of obtaining the risk source information of the risk function includes: According to the risk function, the risk source information is obtained from a construction platform of the sub-application.

11. The method according to claim 9, wherein: The risk source information includes at least one of the following items of the risk function: developer, code location, and bundle package information.

12. The method according to claim 1, wherein: The sub-application includes a software module in the target application, or a small program carried by the target application.

13. The method according to claim 1, wherein: The interface set includes at least one of the following interfaces: a system interface, an interface provided by the target application to the mini-program, and the system interface includes a device data interface and / or a user privacy data interface.

14. The method according to claim 1, wherein: The method further comprises: The detection result information is sent to the server.

15. The method according to claim 1, wherein: The subtask set includes subtasks generated by the server according to page jump information received from a plurality of user devices on which the target application is installed.

16. A privacy risk detection method for a target application, wherein the target application includes a sub-application, the method comprising: The server samples a plurality of subtasks from a subtask set associated with the sub-application, and sends a test task including the plurality of subtasks to a test device on which the target application is installed, wherein a single subtask indicates a certain page jump function of a certain page of the sub-application; each subtask in the subtask set is generated according to page jump information generated from a plurality of user devices on which the target application is installed; The test device executes the page jump function shown in the subtask in the test task in the sub-application, and when monitoring the first calling behavior triggered during the execution of the page jump function, detects whether the first calling behavior has a privacy risk in a privacy risk set, wherein the calling object of the first calling behavior is included in a set of interfaces related to privacy; and generates detection result information of the sub-application based on the multiple detection results obtained related to the test task.

17. The method according to claim 16, wherein: Before sampling a plurality of subtasks from the subtask set associated with the sub-application, the method further includes: receiving page jump information from a plurality of user devices having the target application installed thereon, the page jump information being generated in response to a page jump operation performed by a user in a page of the sub-application; A subtask is generated according to the page jump information, and the subtask is included in the subtask set.

18. A privacy risk detection device for a target application, applied to a test device, the test device having the target application installed therein, the target application including sub-applications, the device comprising: an acquisition unit, configured to receive a test task of the sub-application sent by a server, the test task comprising a plurality of sub-tasks, wherein a single sub-task indicates a certain page jump function of a certain page of the sub-application; the plurality of sub-tasks are sampled by the server from a sub-task set associated with the sub-application; each sub-task in the sub-task set is generated according to page jump information generated from a plurality of user devices on which the target application is installed; a detection unit configured to execute, in the sub-application, a page jump function indicated by the sub-task in the test task, and, when monitoring a first call behavior triggered during the execution of the page jump function, detect whether the first call behavior has a privacy risk in a privacy risk set, wherein a call object of the first call behavior is included in a privacy-related interface set; The generating unit is configured to generate the detection result information of the sub-application according to the obtained multiple detection results related to the test task.

19. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 15.

20. A computing device comprising a memory and a processor, wherein: The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 15 is implemented.