Vulnerability detection method and related equipment
Through the automated feature matching and vulnerability positioning methods of the software testing platform, the problem of inefficient identification of vulnerability impact in the existing technology is solved, efficient vulnerability detection is achieved, and manual analysis costs are reduced.
Patent Information
- Application Number
- CN202311017860.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-05-22
- Filing Date
- 2023-08-11
- Publication Date
- 2024-11-22
AI Technical Summary
Existing vulnerability detection methods are difficult to automatically identify and detect the degree of vulnerability impact in software, resulting in inefficiency and manual analysis of assembly code, which increases costs and skill requirements.
The code files of the tested software are obtained through the software testing platform, function-level features are extracted and matched with the software feature library, query the vulnerability positioning information knowledge base, automatically identify the degree of vulnerability impact, and reduce the workload of manual analysis.
It realizes automatic identification and detection of the degree of vulnerability impact, improves vulnerability detection efficiency, reduces the workload of users to deal with vulnerability repair, and improves detection accuracy.
Smart Images

Figure CN119004471A_ABST
Abstract
Description
[0001] This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office of China on May 22, 2023, with application number 202310579694.8 and invention name “A Vulnerability Analysis Method and Related Equipment”, the entire contents of which are incorporated by reference in this application. Technical Field
[0002] The present application relates to the field of software development and testing technology, and in particular to a vulnerability detection method, a software testing platform, a computing device cluster, a computer-readable storage medium, and a computer program product. Background Art
[0003] A vulnerability, also known as a vulnerability, refers to a defect in the security of a computer system that threatens the confidentiality, integrity, availability, access control, etc. of the system or its application data. Currently, the industry widely uses software composition analysis (SCA) technology to detect vulnerabilities in software, especially binary SCA technology to detect vulnerabilities in binary programs (such as executable code) of software. The degree of real security risk impact of a vulnerability on software (such as a binary program or a target program) can be expressed by the vulnerability impact effectiveness.
[0004] For the software to be detected, SCA technology can be used to first identify other software (such as open source software) referenced by the software and the version number of the referenced software, and then query the known vulnerability library based on the referenced open source software and version number, so as to associate the vulnerability list of the software. In this detection method, the vulnerabilities in the vulnerability list are considered to have an impact on the software (such as binary programs), and the impact of the vulnerability is presented in the detection report (also called a scan report) based on the common vulnerability scoring system (CVSS) 3.0 score results in the vulnerability information.
[0005] However, there are many influencing factors or scenarios in the process of compiling software from source code to binary programs. The above vulnerability detection methods do not consider the influencing factors or scenarios in the compilation process, which makes it difficult to identify and detect the effectiveness of vulnerability impact. Manual analysis of the effectiveness of vulnerability impact on vulnerabilities in detection reports is relatively inefficient and requires high skills of analysts, who usually need to have the ability to understand assembly code, which increases costs and is difficult to meet business needs. Summary of the invention
[0006] The present application provides a vulnerability detection method, which can realize automatic identification and detection of vulnerability impact, and improve vulnerability detection efficiency. The present application also provides a software testing platform, a computing device cluster, a computer-readable storage medium, and a computer program product corresponding to the method.
[0007] In the first aspect, the present application provides a vulnerability detection method, which can be performed by a software testing platform. The software testing platform is used to detect the impact of vulnerabilities on software. The software testing platform can be a software system, which can be an independent software system, such as a software system deployed locally or on the cloud, and the software system can also be integrated into other systems, such as integrated into other software systems in the form of plug-ins. The software system can be deployed in a computing device cluster, and the computing device cluster executes the program code of the software system, thereby executing the vulnerability detection method of the present application. The software testing platform can also be a hardware system with a vulnerability detection function, and when the hardware system is running, the vulnerability detection method of the present application is executed.
[0008] Specifically, the software testing platform obtains the code file of the software under test, which is a compiled code file, and extracts the feature set of the software under test according to the code file of the software under test, wherein the feature set of the software under test includes function identification, function characteristics and function call information. Then the software testing platform matches the characteristics of the software under test with the feature set of the software in the software feature library, and determines at least one reference software of the software under test from the software feature library, wherein the software feature library includes the feature set of open source software or closed source software with source code access rights, and the feature set of the software in the software feature library includes function identification, function characteristics and function call information. According to at least one reference software of the software under test, a vulnerability location information knowledge base is queried to obtain a vulnerability existing in at least one reference software and the location information of the vulnerability, wherein the location information indicates a target function related to the vulnerability in at least one reference software. Then the software testing platform obtains the degree of influence of the vulnerability existing in at least one reference software on the software under test according to the feature set of the software under test and the characteristics related to the target function in the feature set of at least one reference software.
[0009] The method determines the reference software of the software under test by matching the function-level features of the software under test with the function-level features of the software in the software feature library, and then obtains the location information that can indicate the target function related to the vulnerability in the reference software by querying the vulnerability location information knowledge base, and then matches the function-level features of the software under test and the features related to the target function related to the vulnerability in the reference software. Through the above two-level feature matching, the impact of the vulnerability on the software under test is determined, such as a vulnerability that has no impact on the software under test. In this way, automatic identification and detection of the impact of the vulnerability is achieved, the efficiency of vulnerability detection is improved, and the workload of manual analysis is reduced.
[0010] In some possible implementations, the target functions related to the vulnerability include the vulnerability function and the functions on the call chain of the vulnerability function. In this method, all functions in the reference software that are directly or indirectly related to the vulnerability are determined as target functions related to the vulnerability, so as to avoid missing the functions related to the vulnerability in the reference software and improve the accuracy of vulnerability detection.
[0011] In some possible implementations, the software testing platform may match the function identifier of the target function with the function identifier in the feature set of the software under test, or the software testing platform may match the function feature of the target function with the function feature in the feature set of the software under test. When the match fails, the software testing platform may determine that the vulnerability does not exist in the software under test.
[0012] In this method, the failure of function identification or function feature matching indicates that the target function does not exist in the feature set of the software under test, that is, the vulnerability of the referenced software has not been compiled into the software under test. In this way, it is possible to identify the situation where the vulnerability of the referenced software does not exist in the software under test, thereby improving the comprehensiveness of vulnerability detection.
[0013] In some possible implementations, the software testing platform may match the function identifier of the target function with the function identifier in the feature set of the software under test, or the software testing platform may match the function feature of the target function with the function feature in the feature set of the software under test. When the match is successful, it determines whether the target function is called by the function of the software under test. If not, the software testing platform can determine that a vulnerability exists in the software under test and that the vulnerability has no impact on the software under test.
[0014] In this method, if the function identifier or function feature matching fails and the target function is not called by the function of the software under test, it means that the target function will not be executed by the software under test. In this way, it is possible to identify the situation where the vulnerability of the referenced software exists in the software under test but will not be executed, thereby improving the comprehensiveness of vulnerability detection.
[0015] In some possible implementations, the software testing platform may identify, in the vulnerability detection result, the degree of impact of a vulnerability existing in at least one reference software on the software under test.
[0016] In this method, users can intuitively and clearly understand whether the vulnerability of the referenced software will affect the software under test and the extent of the impact by viewing the vulnerability detection results. If the vulnerability does not exist in the software under test or the vulnerability has no impact on the software under test, the user does not need to take any action (such as vulnerability repair), thereby improving the accuracy of vulnerability detection in the software under test and reducing the workload of users in vulnerability repair.
[0017] In some possible implementations, a vulnerability location information knowledge base can be constructed in the following manner: first, vulnerability repair information of open source software or closed source software with source code access is obtained, and based on the vulnerability repair information, the vulnerability function that introduces the vulnerability in the source code of the open source software or closed source software with source code access is obtained, as well as the code snippet of the vulnerability function, and then the code snippet of the vulnerability function is analyzed to obtain the call chain of the vulnerability function, and based on the vulnerability function and the call chain of the vulnerability function, a vulnerability location information knowledge base is constructed.
[0018] In this method, by integrating the code snippet of the vulnerable function and other function information related to the vulnerable function, a comprehensive and accurate vulnerability location information knowledge base can be constructed.
[0019] In some possible implementations, the software feature library can be constructed in the following manner: first, the source code of the open source software or the closed source software with source code access permission is obtained, the function identification, function characteristics and function call information are extracted from the source code of the open source software or the closed source software with source code access permission, and then the software feature library is constructed based on the function identification, function characteristics and function call information of the open source software or the closed source software with source code access permission.
[0020] This method can achieve efficient feature extraction without setting up a source code building environment and without the source code being compiled successfully. In addition, this method uses function call relationships to generate feature sets with fine granularity, thereby enriching the software feature library.
[0021] In some possible implementations, the software testing platform can be deployed entirely on the cloud, for example, providing vulnerability detection services to users in the form of software as a service, and users can implement vulnerability detection of the software under test through a vulnerability detection page or an application programming interface.
[0022] In some possible implementations, the software testing platform can be partially deployed locally and partially deployed on the cloud, thereby providing vulnerability detection services to users while reducing their deployment costs.
[0023] In a second aspect, the present application provides a software testing platform, which is used to detect the impact of vulnerabilities on software, and the software testing platform includes:
[0024] A file acquisition module, used to acquire a code file of the software under test, wherein the code file of the software under test is a compiled code file;
[0025] A feature extraction module, used to extract a feature set of the software under test according to the code file of the software under test, wherein the feature set of the software under test includes function identification, function features and function call information;
[0026] A feature matching module, used to match the feature set of the software under test with the feature set of software in a software feature library, and determine at least one referenced software of the software under test from the software feature library, wherein the software feature library includes the feature set of open source software or closed source software with source code access rights, and the feature set of software in the software feature library includes function identification, function features and function call information;
[0027] A vulnerability location module is used to query a vulnerability location information knowledge base according to at least one reference software of the software under test, obtain a vulnerability existing in the at least one reference software and location information of the vulnerability, wherein the location information indicates a target function related to the vulnerability in the at least one reference software;
[0028] The impact determination module is used to obtain the impact degree of the vulnerability of the at least one reference software on the software under test based on the feature set of the software under test and the features related to the target function in the feature set of the at least one reference software.
[0029] In some possible implementations, the target function related to the vulnerability includes the vulnerability function and functions on a call chain of the vulnerability function.
[0030] In some possible implementations, the impact determination module is specifically used to:
[0031] Matching the function identifier of the target function with the function identifier in the feature set of the software under test, and / or matching the function feature of the target function with the function feature in the feature set of the software under test;
[0032] When the match fails, it is determined that the vulnerability does not exist in the tested software.
[0033] In some possible implementations, the impact determination module is further configured to:
[0034] When the match succeeds, it is determined whether the target function is called by the function of the software under test. If not, it is determined that the vulnerability exists in the software under test and the vulnerability has no effect on the software under test.
[0035] In some possible implementations, the impact determination module is further configured to:
[0036] The degree of influence of the vulnerability existing in the at least one reference software on the software under test is identified in the vulnerability detection result.
[0037] In some possible implementations, the vulnerability location information knowledge base is constructed in the following manner:
[0038] Obtaining vulnerability repair information of the open source software or the closed source software with source code access permission;
[0039] According to the vulnerability repair information, a vulnerability function that introduces the vulnerability and a code snippet of the vulnerability function are obtained from the source code of the open source software or the closed source software with source code access permission;
[0040] Analyze the code snippet of the vulnerable function to obtain the call chain of the vulnerable function;
[0041] The vulnerability location information knowledge base is constructed according to the vulnerability function and the call chain of the vulnerability function.
[0042] In some possible implementations, the software feature library is constructed in the following manner:
[0043] Obtaining the source code of the open source software or the closed source software with source code access permission;
[0044] Extracting function identification, function features and function call information from the source code of the open source software or the closed source software with source code access permission;
[0045] The software feature library is constructed according to the function identification, function feature and function call information of the open source software or the closed source software with source code access permission.
[0046] In a third aspect, the present application provides a computing device cluster. The computing device cluster includes at least one computing device, and the at least one computing device includes at least one processor and at least one memory. The at least one processor and the at least one memory communicate with each other. The at least one processor is used to execute instructions stored in the at least one memory, so that the computing device or the computing device cluster performs the vulnerability detection method as described in the first aspect or any implementation of the first aspect.
[0047] In a fourth aspect, the present application provides a computer-readable storage medium, in which instructions are stored, and the instructions instruct a computing device or a computing device cluster to execute the vulnerability detection method described in the above-mentioned first aspect or any implementation of the first aspect.
[0048] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computing device or a computing device cluster, enables the computing device or the computing device cluster to execute the vulnerability detection method described in the first aspect or any one of the implementations of the first aspect.
[0049] Based on the implementations provided in the above aspects, the present application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required for use in the embodiments are briefly introduced below.
[0051] Figure 1 A schematic diagram of a software vulnerability detection process provided in an embodiment of the present application;
[0052] Figure 2 A schematic diagram of the architecture of a software testing platform provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of a vulnerability detection method provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of a vulnerability detection process provided in an embodiment of the present application;
[0055] Figure 5 A schematic diagram of a process for extracting function-level features provided in an embodiment of the present application;
[0056] Figure 6 A schematic diagram of an assembly code provided in an embodiment of the present application;
[0057] Figure 7 A schematic diagram of a feature set determination process provided in an embodiment of the present application;
[0058] Figure 8 A schematic diagram of a feature matching process provided in an embodiment of the present application;
[0059] Fig. 9 A schematic diagram of a process for determining the impact of a vulnerability provided in an embodiment of the present application;
[0060] Fig. 10A and Fig. 10B A schematic diagram of a feature set of reference software provided in an embodiment of the present application;
[0061] Fig.11A and Fig. 11B An application scenario for determining the impact of a vulnerability on the software under test provided in an embodiment of the present application;
[0062] Fig.12 A schematic diagram of a feature set of software in a software feature library provided in an embodiment of the present application;
[0063] Fig.13 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0064] Fig.14A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0065] Fig.15 A schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application;
[0066] Fig.16 A schematic diagram of the structure of another computer cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] The terms "first" and "second" in the embodiments of the present application are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0068] First, some technical terms involved in the embodiments of the present application are introduced.
[0069] Vulnerabilities, also known as vulnerabilities, refer to defects in computer system security. There are many reasons for vulnerabilities. For example, vulnerabilities can come from defects in software or operating system design or errors in coding. For example, vulnerabilities can come from design defects in business interaction processing or unreasonable logical processes. When vulnerabilities are exploited, the confidentiality, integrity, availability, access control, etc. of the system or its application data may be threatened.
[0070] Software composition analysis (SCA) is a technique for identifying and analyzing the components of software. SCA can identify other software (such as open source software) referenced by the software by analyzing the source code, modules, frameworks, and libraries used by software developers.
[0071] Open source software (OSS) refers to software with open source code. Users can use, modify and distribute the source code used by open source software through specific types of licenses. Considering the lack of standardization in the development of open source software, there are many vulnerabilities in open source software. SCA can be used to detect vulnerabilities in software, especially binary SCA to detect vulnerabilities in the binary program (such as executable code) of the software. Among them, the degree of impact of the real security risk caused by the vulnerability on the software can be represented by the vulnerability impact effectiveness.
[0072] The following is an introduction to the vulnerability detection process. Figure 1The schematic diagram of a vulnerability detection process shown in the figure shows that for the software to be detected (for example, a binary program), feature extraction can be performed first, and then the feature information of different open source software and versions stored in the software feature library can be matched to identify the open source software referenced by the software and the version number of the open source software, and then the known vulnerability library is queried based on the open source software and version number, and a list of vulnerabilities existing in the software is associated, and a detection report (also called a scan report) of the software is generated. Since in the above method, the vulnerabilities in the vulnerability list are considered to have an impact on the software to be detected, the impact of the vulnerability can be characterized based on the scoring results of the common vulnerability scoring system (CVSS) 3.0 in the vulnerability information of the detection report.
[0073] Since there are many influencing factors or scenarios in the process of compiling software from source code to generate binary programs, there can be the following four relationships between the vulnerabilities in the open source software and the software to be detected (such as binary programs): ① Because the patch has been applied or the vulnerability code in the open source software has not been compiled into the binary program, the vulnerability does not exist in the software and the software is not affected by the vulnerability. ② Since the compilation is based on files, the vulnerability exists in the software, but the vulnerability code will not be executed, and the software is not affected. ③ The vulnerability exists in the software, the software is affected by the vulnerability, but the security risk impact of the vulnerability is incorrect. ④ The vulnerability exists in the software, the software is affected by the vulnerability, and the security risk impact of the vulnerability is correct.
[0074] However, the above vulnerability detection method uses a method of querying a known vulnerability library to determine the vulnerabilities in the software. Therefore, when the open source software referenced by the software and the version number of the open source software are determined, the vulnerability information obtained is determined. In other words, the above method does not take into account the influencing factors or scenarios in the compilation process, and it is difficult to identify and detect the effectiveness of the vulnerability impact. It is necessary to manually analyze the vulnerability impact effectiveness of the vulnerabilities in the detection report, such as disassembling the software and manually viewing the assembly code to analyze the vulnerability impact effectiveness, so as to obtain the impact of the vulnerability and rank the vulnerability repair order, and then repair the vulnerability. This method is inefficient and requires high skills of analysts, who usually need to have the ability to understand assembly code, which increases costs and is difficult to meet business needs.
[0075] In view of this, the present application provides a vulnerability detection method. The method can be executed by a software testing platform, and the software testing platform can be used to detect the degree of impact of vulnerabilities on software. The software testing platform can be a software system, and the software system can be an independent software system, such as a software system deployed locally or on the cloud. The software system can also be integrated into other systems, such as integrated into other software systems in the form of plug-ins. The software system can be deployed in a computing device cluster, and the computing device cluster executes the program code of the software system, thereby executing the vulnerability detection method of the present application. The software testing platform can also be a hardware system with a vulnerability detection function, and when the hardware system is running, the vulnerability detection method of the present application is executed.
[0076] Specifically, the software testing platform obtains the code file of the software under test, which is a compiled code file, and extracts the feature set of the software under test according to the code file of the software under test, wherein the feature set of the software under test includes function identification, function characteristics and function call information. Then the software testing platform matches the characteristics of the software under test with the feature set of the software in the software feature library, and determines at least one reference software of the software under test from the software feature library, wherein the software feature library includes the feature set of open source software or closed source software with source code access rights, and the feature set of the software in the software feature library includes function identification, function characteristics and function call information. According to at least one reference software of the software under test, a vulnerability location information knowledge base is queried to obtain a vulnerability existing in at least one reference software and the location information of the vulnerability, wherein the location information indicates a target function related to the vulnerability in at least one reference software. Then the software testing platform obtains the degree of influence of the vulnerability existing in at least one reference software on the software under test according to the feature set of the software under test and the characteristics related to the target function in the feature set of at least one reference software.
[0077] The method determines the reference software of the software under test by matching the function-level features of the software under test with the function-level features of the software in the software feature library, and then obtains the location information that can indicate the target function related to the vulnerability in the reference software by querying the vulnerability location information knowledge base, and then matches the function-level features of the software under test and the features related to the target function related to the vulnerability in the reference software. Through the above two-level feature matching, the impact of the vulnerability on the software under test is determined, such as a vulnerability that has no impact on the software under test. In this way, automatic identification and detection of the impact of the vulnerability is achieved, the efficiency of vulnerability detection is improved, and the workload of manual analysis is reduced.
[0078] In order to make the technical solution of the present application clearer and easier to understand, the architecture of the software testing platform of the present application is introduced below with reference to the accompanying drawings.
[0079] See also Figure 2The software testing platform 20 is an architectural diagram of a software testing platform. The software testing platform 20 can be used to detect the impact of vulnerabilities on software. The software testing platform 20 includes a file acquisition module 202, a feature extraction module 204, a feature matching module 206, a vulnerability location module 208 and an impact determination module 210.
[0080] The file acquisition module 202 is used to acquire the code file of the software under test, wherein the code file of the software under test is a compiled code file, in other words, the code file of the software under test can be a binary file.
[0081] The feature extraction module 204 is used to extract the feature set of the software under test according to the code file of the software under test. The feature set of the software under test includes a function identifier (such as a function name or a function address), a function feature and function call information. The feature set of the software under test can be called a function-level feature of the software under test.
[0082] The feature matching module 206 is used to match the feature set of the software under test with the feature set of the software in the software feature library, and determine at least one referenced software of the software under test from the software feature library. The software feature library may include the feature set of open source software or closed source software with source code access rights, and the feature set of the software in the software feature library may include function identifiers (e.g., function names), function features, and function call information. The feature set of the open source software or closed source software with source code access rights may also be referred to as function-level features of the software in the software feature library.
[0083] The vulnerability location module 208 is used to query the vulnerability location information knowledge base according to at least one reference software of the tested software, and obtain the vulnerability existing in at least one reference software and the location information of the vulnerability. Among them, the vulnerability location information knowledge base may include information related to vulnerabilities existing in open source software or closed source software with source code access rights, and the location information may indicate a target function related to the vulnerability in at least one reference software, for example, it may include a vulnerability function and a function on the call chain of the vulnerability function.
[0084] The impact determination module 210 is used to obtain the degree of influence of the vulnerability of at least one referenced software on the software under test based on the feature set of the software under test and the features related to the target function in the feature set of at least one referenced software. In some embodiments, the feature set of the referenced software can be queried in the software feature library to obtain the features related to the target function in the referenced software, so as to match the function identifier of the target function with the function identifier in the feature set of the software under test to determine the degree of influence of the vulnerability on the software under test. For example, when the match fails, it can be determined that the vulnerability does not exist in the software under test. For another example, when the match is successful, it can be further determined whether the target function is called by the function of the software under test. If the target function is not called by the function of the software under test, it can be determined that the vulnerability has no impact on the software under test.
[0085] Furthermore, the impact determination module 210 can also generate a vulnerability detection result of the software under test, and identify the impact of at least one vulnerability in the referenced software on the software under test in the vulnerability detection result. In this way, the vulnerability detection efficiency is improved, and it is convenient for users to intuitively obtain the vulnerabilities that affect the software under test through the vulnerability detection results.
[0086] The software testing platform 20 of the embodiment of the present application can be a software system, which can be deployed locally and provided to users in the form of locally deployed software. The software system can also be deployed on the cloud and provided to users in the form of cloud services. In some embodiments, the modules in the software testing platform 20 can all be deployed on the cloud, and the software testing platform 20 provides vulnerability detection services to users in the form of software as a service (SaaS). For example, a user can upload the software under test through the vulnerability detection page, and view the vulnerability detection results of the software under test through the vulnerability detection page. For another example, a user can upload the software under test by calling an application programming interface (application programming interface, API), and obtain the vulnerability detection results of the software under test obtained by calling the API. In other embodiments, some modules in the software testing platform 20 can be deployed locally, and another part of the modules are deployed on the cloud. For example, the file acquisition module 202 and the feature extraction module 204 are deployed locally as an agent, and the feature matching module 206, the vulnerability location module 208 and the impact determination module 210 are deployed on the cloud. The user can upload the software under test through the agent, and the agent sends the extracted feature set of the software under test to the cloud, and performs feature matching, vulnerability query and vulnerability impact determination in the cloud. In this way, vulnerability detection is achieved on the basis of reducing the user's deployment cost.
[0087] Based on the above-mentioned software testing platform 20 provided in the embodiment of the present application, the embodiment of the present application also provides a vulnerability detection method, and the vulnerability detection method of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings.
[0088] See also Figure 3 The flowchart of the vulnerability detection method shown in FIG. 1 comprises the following steps:
[0089] S302: The software testing platform 20 obtains the code file of the software under test.
[0090] Among them, the code file of the tested software is a compiled code file. In other words, in the embodiment of the present application, the object of vulnerability detection is a compiled code file. Usually, the code file of the tested software can be loaded and executed by the operating system, so the code file of the tested software can also be called the executable file, binary file or binary program of the tested software. Under different operating systems, the code file of the tested software can have different presentation methods. For example, under the windows operating system, the code file of the tested software can be an exe file, a sys file or a com file.
[0091] The code file of the software under test can be obtained by compiling. Compiling refers to the process of using a compiler to convert source code written in a programming language into a code file that can be recognized by a computing device. Specifically, the compilation process can include multiple steps such as macro expansion, compilation, assembly, and linking.
[0092] S304: The software testing platform 20 extracts a feature set of the software under test based on the code file of the software under test.
[0093] In specific implementation, the software testing platform 20 can extract the feature set of the tested software by disassembling the code file. Figure 4 A schematic diagram of a vulnerability detection process is shown in FIG. Figure 4 Phase 1 in the process is the process of extracting the feature set of the software under test.
[0094] First, the software testing platform 20 can perform format analysis on the code files of the software under test. For example, the software testing platform 20 can perform format analysis on the code files from multiple dimensions such as file format, operating system, central processing unit (CPU) architecture, etc. to obtain format analysis results.
[0095] Next, the software testing platform 20 can disassemble the code file of the software under test according to the format analysis result to obtain an assembly code file, wherein disassembly refers to the process of converting a code file into an assembly code file. The software testing platform 20 can select the corresponding disassembler according to the format analysis result, and then use the disassembler to disassemble the code file of the code under test to obtain an assembly code file.
[0096] Furthermore, the software testing platform 20 can perform function segmentation to obtain assembly code files related to the functions. Then, the software testing platform can extract function-level features based on the assembly code files after function segmentation. Figure 5 A flow chart of function-level feature extraction is shown, in which the software testing platform 20 can extract the function identifier (for example, the function name or function address), and then extract the function feature (for example, the string referenced by the function), wherein the string referenced by the function refers to the string that appears in the function body of the function, and in order to match the accuracy, it usually includes strings that are not related to compilation, for example, it can include constant strings, such as the constant strings printed in the output function (printf). Then, the software testing platform 20 can perform function call relationship analysis, obtain function call information, and use the function identifier, function feature and function call information as the feature set of the software under test, and end the feature extraction of the software under test. Among them, the function call information can also be called a function call graph (CG).
[0097] The following is an example to illustrate the process of function call relationship analysis. Figure 6 The schematic diagram of an assembly code shown is an assembly code related to the perf_mmap_close function. Through the assembly code, other functions called by the perf_mmap_close function can be obtained, including the atomic_dec_and_mutex_lock function, the mutex_unlock function, the perf_buffer_put function, and the free_uid function. The software testing platform 20 can perform a similar recursive function call relationship analysis on other functions called by the above perf_mmap_close function until the function for which the function call relationship analysis is performed no longer calls other functions. In this way, the software testing platform 20 can determine the function call information.
[0098] By performing function segmentation on the assembly code file of the software under test and then performing feature extraction based on the assembly code file after function segmentation, at least one function-level feature of the software under test can be generated, thereby obtaining a feature set of the software under test. Figure 7A schematic diagram of a feature set determination process is shown, in which the function-level features of the software under test include features of function F1 and features of function F2, wherein the features of function F1 include features 1 and features 2, and the features of function F2 include features 2 and features 3. By merging the features of function F1 and the features of function F2, the feature set of the software under test can be determined, and the feature set includes feature 1, feature 2 and feature 3.
[0099] S306: The software testing platform 20 matches the feature set of the software under test with the feature set of the software in the software feature library, and determines at least one reference software of the software under test from the software feature library.
[0100] Among them, the software feature library (also called software feature fingerprint library) may include a feature set of open source software or closed source software with source code access rights (for example, self-developed software). The feature set of the software in the software feature library may include function identifiers (usually function names), function features, and function call information.
[0101] The process of feature matching by the software testing platform 20 corresponds to Figure 4 In the specific implementation of stage 2, the software testing platform 20 can perform similarity calculation on the feature set of the tested software and the feature set of the software in the software feature library, thereby determining at least one reference software of the tested software according to the similarity calculation result.
[0102] See also Figure 8 As shown is a schematic diagram of a feature matching process, the software testing platform 20 can calculate the similarity between the feature set of the software under test and the feature set of the software in the software feature library (such as the feature set of software 1, the feature set of software 2 and the feature set of software 3), and compare the calculated similarity with the set similarity threshold, and determine the software that meets the similarity condition (for example, the similarity is greater than the similarity threshold) as the reference software of the software under test (such as software 1).
[0103] S308: The software testing platform 20 queries a vulnerability location information knowledge base according to at least one reference software of the tested software to obtain a vulnerability existing in the at least one reference software and location information of the vulnerability.
[0104] Among them, the vulnerability location information knowledge base includes information related to vulnerabilities existing in open source software or closed source software with source code access rights. The vulnerability related information includes but is not limited to information such as vulnerabilities, vulnerability locations, vulnerability codes, etc. existing in open source software or closed source software with source code access rights.
[0105] The location information may indicate a target function related to the vulnerability in at least one reference software, such as a function name of the target function related to the vulnerability in the reference software, a file path of the target function, etc. In other words, the software testing platform 20 may obtain the target function related to the vulnerability in the reference software of the tested software by querying the vulnerability location information knowledge base.
[0106] In some embodiments, the target function related to the vulnerability may include the vulnerability function and the functions on the call chain of the vulnerability function, wherein the call chain of the vulnerability function may be generated by the function call information of the reference software. In this way, the functions in the reference software that are directly or indirectly related to the vulnerability may be determined.
[0107] S310: The software testing platform 20 obtains the impact of a vulnerability in at least one reference software on the software under test based on the feature set of the software under test and features related to the target function in the feature set of at least one reference software.
[0108] In specific implementation, since the feature set of the software in the software feature library is a function-level feature, the software testing platform 20 can query the software feature library to obtain features related to the target function in the feature set of the referenced software.
[0109] After obtaining the features related to the target function in the feature set of the reference software, the software testing platform 20 can match the feature set of the tested software with the features related to the target function in the feature set of at least one reference software again to obtain a matching result, thereby obtaining the impact of the vulnerability of at least one reference software on the tested software according to the matching result. The above-mentioned processes S308 and S310 correspond to Figure 4 Phase 3 of the .
[0110] In the embodiment of the present application, there are two feature matchings. The first one is to match the feature set of the tested software with the feature set of the software in the software feature library to obtain at least one reference software of the tested software. The second one is to match the feature set of the tested software with the feature set of the software in the software feature library to obtain at least one reference software of the tested software.
[0111] See also Fig. 9A flow chart of determining the impact of a vulnerability is shown, the software testing platform 20 obtains at least one reference software of the software under test, queries the vulnerability location information knowledge base, and ends the matching process if the reference software does not have a vulnerability. If the reference software has a vulnerability, the vulnerability and the location information of the vulnerability in the reference software are obtained, and the features related to the target function in the feature set of the reference software are matched with the feature set of the software under test. Specifically, the software testing platform 20 can match the function identifier of the target function with the function identifier in the feature set of the software under test, or the software feature platform 20 can also match the function feature of the target function with the function feature in the feature set of the software under test. When the match fails, the software testing platform 20 can determine that the vulnerability does not exist in the software under test. In other words, the match failure indicates that the target function does not exist in the feature set of the software under test, indicating that the vulnerability of the reference software has not been compiled into the software under test, and the vulnerability has no effect on the software under test, thereby identifying the situation where the vulnerability of the reference software does not exist in the software under test.
[0112] Further, when the match is successful and the similarity meets the similarity threshold, the software testing platform 20 can determine that the vulnerability exists in the software under test, and then determine whether the target function is called by the function of the software under test. If so, the matching process ends, and if not, the software testing platform 20 can determine that the vulnerability has no effect on the software under test. In other words, the fact that the target function is not called by the function of the software under test means that the target function will not be executed by the software under test, and the vulnerability has no effect on the software under test, thereby identifying the situation where the vulnerability of the referenced software exists in the software under test but will not be executed.
[0113] The software testing platform 20 can save the matching results that the above-mentioned vulnerabilities do not exist in the tested software and the vulnerabilities have no effect on the tested software, and identify the degree of influence of at least one vulnerability existing in the referenced software on the tested software in the generated vulnerability detection results. In this way, the user can intuitively and clearly understand whether the vulnerability of the referenced software will have an impact on the tested software and the degree of impact by viewing the vulnerability detection results. For the situation that the vulnerability does not exist in the tested software and the vulnerability has no effect on the tested software, the user does not need to process (for example, repair the vulnerability), thereby improving the accuracy of vulnerability detection of the tested software and reducing the workload of the user in performing vulnerability repair.
[0114] The following will be explained with specific examples. Fig. 10A and Fig. 10B The schematic diagram of a feature set of reference software shown in FIG. 1 , the reference software of the tested software includes software A and software B. The feature set of software A includes features of function F1, function F2, function F3, function F4, function F5 and function F6. There is a vulnerability in function F4 of software A ( Fig. 10AThe feature set of software B includes the features of function F1, function F2 and function F3.
[0115] The software testing platform 20 can obtain the vulnerability existing in software A and the location information of the vulnerability by querying the vulnerability location information knowledge base. The location information of the vulnerability can indicate the target function related to the vulnerability in software A, namely, function F1, function F2, function F3 and function F4.
[0116] Next, the matching results in two scenarios are given. In some embodiments, see Fig.11A The software testing platform 20 matches the function identifiers in the feature set of the software under test with the function identifiers of function F1, function F2, function F3 and function F4 of software A. The matching result is that function F5 and function F6 of software A exist in the software under test, but function F1, function F2, function F3 and function F4 of software A do not exist in the software under test. Therefore, the software testing platform 20 can determine that the vulnerability of function F4 in software A does not exist in the software under test, and the vulnerability has no effect on the software under test.
[0117] In other embodiments, see Fig. 11B The software testing platform 20 matches the function identifiers in the feature set of the software under test with the function identifiers of function F1, function F2, function F3 and function F4 of software A. The matching result is that function F1, function F2, function F3, function F4, function F5 and function F6 of software A exist in the software under test, and function F1, function F2, function F3 and function F4 of software A are not called by the function of the software under test. Therefore, the software testing platform 20 can determine that the vulnerability of function F4 in software A exists in the software under test, and the vulnerability has no effect on the software under test.
[0118] Based on the above description, the vulnerability detection method in the embodiment of the present application determines the reference software of the software under test through the first feature matching, and then obtains the location information that can indicate the target function related to the vulnerability in the reference software by querying the vulnerability location information knowledge base, and then determines the impact of the vulnerability on the software under test through the second feature matching, for example, a vulnerability that has no impact on the software under test. In this way, the automatic identification and detection of the impact of the vulnerability is achieved, the efficiency of vulnerability detection is improved, and the workload of manual analysis is reduced.
[0119] In the vulnerability detection method provided in the embodiment of the present application, the software testing platform 20 can use the software feature library for feature matching and use the vulnerability location information knowledge base to query vulnerability information. The construction process of the software feature library and the vulnerability location information knowledge base will be described below.
[0120] For the construction of the software feature library, the software testing platform 20 can obtain the source code of open source software or closed source software with source code access rights, extract function identification, function characteristics and function call information from the source code of the open source software or the closed source software with source code access rights, and thus construct the software feature library based on the function identification, function characteristics and function call information extracted from the source code of the open source software or the closed source software with source code access rights.
[0121] See also Fig.12 The schematic diagram of the feature set of software in a software feature library is shown. The software testing platform 20 can obtain the source code of the software and extract the features of the software from the source code, including feature 1, feature 2, feature 3 of function F1, and function call information of function F1 calling function F2 and function F3, feature 1 and feature 2 of function F2, feature 1 of function F3, and function call information of function F3 calling function F4, and feature 1 and feature 2 of function F4. In this way, the software testing platform 20 can generate the function-level features of the software and then build a software feature library.
[0122] With respect to the construction of the vulnerability location information knowledge base, the software testing platform 20 can obtain vulnerability repair information of open source software or closed source software with source code access rights, and based on the vulnerability repair information, obtain the vulnerability function that introduces the vulnerability in the source code of the open source software or closed source software with source code access rights and the code fragment of the vulnerability function, analyze the code fragment of the vulnerability function, obtain the call chain of the vulnerability function, and thus construct the vulnerability location information knowledge base based on the vulnerability function and the call chain of the vulnerability function.
[0123] Among them, vulnerability repair information may include commit information and vulnerability patch information. Commit information refers to the comment information when repairing the vulnerability, such as "This submission is to repair xx vulnerability", and vulnerability patch information refers to the modified vulnerability code and the specific modification content.
[0124] The following will introduce the specific vulnerability repair information, which is as follows:
[0125]
[0126]
[0127] The software testing platform 20 analyzes the vulnerability repair information, and can locate the path and file name of the source code where the vulnerability is introduced based on the vulnerability repair information in the lines where ---a and +++b are located, that is, the vulnerability is located in kernel / events / core.c. Then, the software testing platform 20 can obtain the source code location where the vulnerability is introduced and the code fragment of the vulnerable function based on the vulnerability repair information in the line where @@ is located, including 11 lines of code starting from line 4782, 7 lines of code starting from line 4805, and 7 lines of code starting from line 4814 in the source code, so that the vulnerable function that introduces the vulnerability can be determined to be perf_mmap_close based on the source code location.
[0128] Furthermore, the software testing platform 20 may analyze the code snippet of the vulnerable function, obtain the call chain of the vulnerable function, and determine other function information related to the vulnerable function.
[0129] The following is an explanation based on the specific code. The code used to generate vulnerability location information is as follows:
[0130]
[0131]
[0132] This code is a combination of the vulnerability function and other function information related to the vulnerability function. In this code, the information in [] under each source code file can represent the function name. It can be seen that the information in the source code file core.c is the vulnerability function. For the information in [] under other source code files, if it is empty, it means that the source code file will be compiled together when compiling the kernel / events / core.c vulnerability code. If it is not empty, it means that the function in the source code file directly or indirectly calls the vulnerability function, that is, ring.buffer.c calls other functions, and a2mp.c calls the vulnerability function. In this way, the software testing platform 20 can combine the code snippets of the vulnerability function and other function information related to the vulnerability function to build a comprehensive and accurate vulnerability location information knowledge base.
[0133] Based on the vulnerability detection method of the above embodiment, the present application embodiment further provides a software testing platform 20 as described above. The software testing platform 20 is introduced below in conjunction with the accompanying drawings.
[0134] See also Figure 2 The software testing platform 20 is a schematic diagram of a structure of the software development platform 20, which is used to detect the impact of vulnerabilities on software. The software testing platform 20 includes:
[0135] The file acquisition module 202 is used to acquire the code file of the software under test, where the code file of the software under test is a compiled code file;
[0136] The feature extraction module 204 is used to extract a feature set of the software under test according to the code file of the software under test, wherein the feature set of the software under test includes function identification, function features and function call information;
[0137] A feature matching module 206 is used to match the feature set of the software under test with the feature set of the software in the software feature library, and determine at least one referenced software of the software under test from the software feature library, wherein the software feature library includes the feature set of open source software or closed source software with source code access rights, and the feature set of the software in the software feature library includes function identification, function features and function call information;
[0138] The vulnerability location module 208 is used to query the vulnerability location information knowledge base according to at least one reference software of the tested software, obtain the vulnerability existing in at least one reference software and the location information of the vulnerability, and the location information indicates the target function related to the vulnerability in at least one reference software;
[0139] The impact determination module 210 is used to obtain the impact of the vulnerability of at least one reference software on the software under test based on the feature set of the software under test and the features related to the target function in the feature set of at least one reference software.
[0140] The above-mentioned file acquisition module 202, feature extraction module 204, feature matching module 206, vulnerability location module 208 and impact determination module 210 can be implemented by hardware modules or by software modules. Among them, the file acquisition module 202, feature extraction module 204, feature matching module 206, vulnerability location module 208 and impact determination module 210 can be implemented by a computing device or a computing engine on a computing device. Below, the file acquisition module 202 is taken as an example for description.
[0141] When implemented by software, the file acquisition module 202 may be an application or application module running on a computing device or a computing device cluster, such as a computing engine. The application may be provided to users in the form of a virtualized service. Virtualized services may include virtual machine (VM) services, bare metal server (BMS) services, and container services. Among them, the VM service may be a service that uses virtualization technology to virtualize a virtual machine (VM) resource pool on multiple physical hosts (such as computing devices) to provide users with VMs on demand for use. The BMS service is a service that virtualizes a BMS resource pool on multiple physical hosts to provide users with BMS on demand for use. The container service is a service that virtualizes a container resource pool on multiple physical hosts to provide users with containers on demand for use. VM is a simulated virtual computer, that is, a logical computer. BMS is a high-performance computing service that can be elastically scalable, and its computing performance is no different from that of a traditional physical machine, and it has the characteristics of secure physical isolation. Containers are a kernel virtualization technology that can provide lightweight virtualization to achieve the purpose of isolating user space, processes, and resources. It should be understood that the VM service, BMS service and container service in the above-mentioned virtualization services are merely specific examples. In actual applications, the virtualization service may also be other lightweight or heavyweight virtualization services, which are not specifically limited here.
[0142] When implemented by hardware, the file acquisition module 202 may include at least one computing device, such as a server, etc. Alternatively, the file acquisition module 202 may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), etc. The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0143] In some possible implementations, the target function related to the vulnerability includes the vulnerability function and functions on the call chain of the vulnerability function.
[0144] In some possible implementations, the impact determination module 210 is specifically configured to:
[0145] Matching the function identifier of the target function with the function identifier in the feature set of the software under test, and / or matching the function feature of the target function with the function feature in the feature set of the software under test;
[0146] When the match fails, it is determined that the vulnerability does not exist in the software under test.
[0147] In some possible implementations, the impact determination module 210 is further configured to:
[0148] When the match is successful, it is determined whether the target function is called by the function of the software under test. If not, it is determined that the vulnerability exists in the software under test and the vulnerability has no effect on the software under test.
[0149] In some possible implementations, the impact determination module 210 is further configured to:
[0150] In the vulnerability detection result, the degree of influence of a vulnerability existing in at least one reference software on the software under test is identified.
[0151] In some possible implementations, the vulnerability location information knowledge base is constructed in the following ways:
[0152] Obtain information about bug fixes for open source software or closed source software with source code access;
[0153] Based on the vulnerability repair information, obtain the vulnerable function and code snippet of the vulnerable function that introduces the vulnerability in the source code of the open source software or the closed source software with source code access permission;
[0154] Analyze the code snippet of the vulnerable function to obtain the call chain of the vulnerable function;
[0155] According to the vulnerability function and its calling chain, a vulnerability location information knowledge base is constructed.
[0156] In some possible implementations, the software feature library is constructed in the following manner:
[0157] Obtain source code for open source software or closed source software with source code access;
[0158] Extract function identification, function features, and function call information from the source code of open source software or closed source software with source code access rights;
[0159] A software feature library is constructed based on function identification, function features, and function call information of open source software or closed source software with source code access rights.
[0160] The present application also provides a computing device 1300. Fig.13As shown, the computing device 1300 includes: a bus 1302, a processor 1304, a memory 1306, and a communication interface 1308. The processor 1304, the memory 1306, and the communication interface 1308 communicate through the bus 1302. The computing device 1300 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 1300.
[0161] The bus 1302 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.13 The bus 1302 may include a path for transmitting information between various components of the computing device 1300 (eg, the memory 1306, the processor 1304, and the communication interface 1308).
[0162] The processor 1304 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0163] The memory 1306 may include a volatile memory, such as a random access memory (RAM). The memory 1306 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid state drive (SSD). The memory 1306 stores executable program code, and the processor 1304 executes the executable program code to implement the aforementioned vulnerability detection method. Specifically, the memory 1306 stores instructions for the software testing platform 20 to execute the vulnerability detection method.
[0164] The communication interface 1308 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1300 and other devices or communication networks.
[0165] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0166] like Fig.14 As shown, the computing device cluster includes at least one computing device 1300. The memory 1306 in one or more computing devices 1300 in the computing device cluster may store the same software testing platform 20 for executing instructions of the vulnerability detection method.
[0167] In some possible implementations, one or more computing devices 1300 in the computing device cluster may also be used for executing some instructions of the vulnerability detection method by the software testing platform 20. In other words, the combination of one or more computing devices 1300 may jointly execute the instructions of the software testing platform 20 for executing the vulnerability detection method.
[0168] It should be noted that the memory 1306 in different computing devices 1300 in the computing device cluster may store different instructions for executing partial functions of the software testing platform 20 .
[0169] Fig.15 A possible implementation is shown. Fig.15 As shown, two computing devices 1300A and 1300B are connected via a communication interface 1308. The memory in computing device 1300A stores instructions for executing the functions of file acquisition module 202, feature extraction module 204, and feature matching module 206. The memory in computing device 1300B stores instructions for executing the functions of vulnerability location module 208 and impact determination module 210. In other words, the memories 1306 of computing devices 1300A and 1300B jointly store instructions for the software testing platform 20 to execute the vulnerability detection method.
[0170] Fig.15 The connection mode between the computing device clusters shown may be based on the consideration that the software testing platform provided by the present application needs to extract the features of the tested software and determine the impact by vulnerability location. Therefore, it is considered that the functions implemented by the file acquisition module 202, the feature extraction module 204 and the feature matching module 206 are performed by the computing device 1300A, and the functions implemented by the vulnerability location module 208 and the impact determination module 210 are performed by the computing device 1300B.
[0171] It should be understood that Fig.15The functions of the computing device 1300A shown in FIG. 1300A may also be completed by multiple computing devices 1300. Similarly, the functions of the computing device 1300B may also be completed by multiple computing devices 1300.
[0172] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.16 A possible implementation is shown. Fig.16 As shown, two computing devices 1300C and 1300D are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 1306 in the computing device 1300C stores instructions for executing the functions of the file acquisition module 202, the feature extraction module 204, and the feature matching module 206. At the same time, the memory 1306 in the computing device 1300D stores instructions for executing the functions of the vulnerability location module 208 and the impact determination module 210.
[0173] Fig.16 The connection mode between the computing device clusters shown can be considered that the software testing platform provided by the present application needs to extract the features of the tested software and determine the impact degree through vulnerability location. Therefore, it is considered that the functions implemented by the file acquisition module 202, the feature extraction module 204 and the feature matching module 206 are executed by the computing device 1300C, and the functions implemented by the vulnerability location module 208 and the impact determination module 210 are executed by the computing device 1300D. It should be understood that Fig.16 The functions of the computing device 1300C shown in FIG. 1300A may also be completed by multiple computing devices 1300. Similarly, the functions of the computing device 1300D may also be completed by multiple computing devices 1300.
[0174] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned application to the software testing platform for executing the vulnerability detection method.
[0175] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be a software or program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the above-mentioned vulnerability detection method.
[0176] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A vulnerability detection method, characterized in that: Applied to a software testing platform, the software testing platform is used to detect the impact of vulnerabilities on software, and the method includes: Obtaining a code file of the software under test, wherein the code file of the software under test is a compiled code file; Extracting a feature set of the software under test according to the code file of the software under test, wherein the feature set of the software under test includes function identification, function features and function call information; Matching the feature set of the software under test with the feature set of software in a software feature library, and determining at least one referenced software of the software under test from the software feature library, wherein the software feature library includes feature sets of open source software or closed source software with source code access rights, and the feature set of software in the software feature library includes function identifiers, function features, and function call information; Querying a vulnerability location information knowledge base according to at least one reference software of the software under test, obtaining a vulnerability existing in the at least one reference software and location information of the vulnerability, wherein the location information indicates a target function related to the vulnerability in the at least one reference software; The influence degree of the vulnerability of the at least one reference software on the software under test is obtained according to the feature set of the software under test and the features related to the target function in the feature set of the at least one reference software.
2. The method according to claim 1, characterized in that The target function related to the vulnerability includes the vulnerability function and the functions on the call chain of the vulnerability function.
3. The method according to claim 1 or 2, characterized in that: The obtaining, based on the feature set of the software under test and the features related to the target function in the feature set of the at least one referenced software, the degree of influence of the vulnerability on the software under test comprises: Matching the function identifier of the target function with the function identifier in the feature set of the software under test, and / or matching the function feature of the target function with the function feature in the feature set of the software under test; When the match fails, it is determined that the vulnerability does not exist in the tested software.
4. The method according to claim 3, characterized in that: The method further comprises: When the match succeeds, it is determined whether the target function is called by the function of the software under test. If not, it is determined that the vulnerability exists in the software under test and the vulnerability has no effect on the software under test.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The degree of influence of the vulnerability existing in the at least one reference software on the software under test is identified in the vulnerability detection result.
6. The method according to any one of claims 1 to 5, characterized in that: The vulnerability location information knowledge base is constructed in the following way: Obtaining vulnerability repair information of the open source software or the closed source software with source code access permission; According to the vulnerability repair information, a vulnerability function that introduces the vulnerability and a code snippet of the vulnerability function are obtained from the source code of the open source software or the closed source software with source code access permission; Analyze the code snippet of the vulnerable function to obtain the call chain of the vulnerable function; The vulnerability location information knowledge base is constructed according to the vulnerability function and the call chain of the vulnerability function.
7. The method according to any one of claims 1 to 5, characterized in that: The software feature library is constructed in the following way: Obtaining the source code of the open source software or the closed source software with source code access permission; Extracting function identification, function characteristics and function call information from the source code of the open source software or the closed source software with source code access permission; The software feature library is constructed according to the function identification, function feature and function call information of the open source software or the closed source software with source code access permission.
8. A software testing platform, characterized in that: The software testing platform is used to detect the impact of vulnerabilities on software, and the software testing platform includes: A file acquisition module, used to acquire a code file of the software under test, wherein the code file of the software under test is a compiled code file; A feature extraction module, used to extract a feature set of the software under test according to the code file of the software under test, wherein the feature set of the software under test includes function identification, function features and function call information; A feature matching module, used to match the feature set of the software under test with the feature set of software in a software feature library, and determine at least one referenced software of the software under test from the software feature library, wherein the software feature library includes the feature set of open source software or closed source software with source code access rights, and the feature set of software in the software feature library includes function identification, function features and function call information; A vulnerability location module is used to query a vulnerability location information knowledge base according to at least one reference software of the software under test, obtain a vulnerability existing in the at least one reference software and location information of the vulnerability, wherein the location information indicates a target function related to the vulnerability in the at least one reference software; The impact determination module is used to obtain the impact degree of the vulnerability of the at least one reference software on the software under test based on the feature set of the software under test and the features related to the target function in the feature set of the at least one reference software.
9. The software testing platform according to claim 8, characterized in that: The target function related to the vulnerability includes the vulnerability function and the functions on the call chain of the vulnerability function.
10. The software testing platform according to claim 8 or 9, characterized in that: The impact determination module is specifically used for: Matching the function identifier of the target function with the function identifier in the feature set of the software under test, and / or matching the function feature of the target function with the function feature in the feature set of the software under test; When the match fails, it is determined that the vulnerability does not exist in the tested software.
11. The software testing platform according to claim 10, characterized in that: The impact determination module is also used for: When the match succeeds, it is determined whether the target function is called by the function of the software under test. If not, it is determined that the vulnerability exists in the software under test and the vulnerability has no effect on the software under test.
12. The software testing platform according to any one of claims 8 to 11, characterized in that: The impact determination module is also used for: The degree of influence of the vulnerability existing in the at least one reference software on the software under test is identified in the vulnerability detection result.
13. The software testing platform according to any one of claims 8 to 12, characterized in that: The vulnerability location information knowledge base is constructed in the following way: Obtaining vulnerability repair information of the open source software or the closed source software with source code access permission; According to the vulnerability repair information, a vulnerability function that introduces the vulnerability and a code snippet of the vulnerability function are obtained from the source code of the open source software or the closed source software with source code access permission; Analyze the code snippet of the vulnerable function to obtain the call chain of the vulnerable function; The vulnerability location information knowledge base is constructed according to the vulnerability function and the call chain of the vulnerability function.
14. The software testing platform according to any one of claims 8 to 13, characterized in that: The software feature library is constructed in the following way: Obtaining the source code of the open source software or the closed source software with source code access permission; Extracting function identification, function characteristics and function call information from the source code of the open source software or the closed source software with source code access permission; The software feature library is constructed according to the function identification, function feature and function call information of the open source software or the closed source software with source code access permission.
15. A computing device cluster, characterized in that: The computing device cluster includes at least one computing device, and the at least one computing device includes at least one processor and at least one memory, wherein the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the computing device cluster executes the method as described in any one of claims 1 to 7.
16. A computer-readable storage medium, characterized in that: The method comprises computer-readable instructions; the computer-readable instructions are used to implement the method according to any one of claims 1 to 7.
17. A computer program product, characterized in that The method comprises computer-readable instructions; the computer-readable instructions are used to implement the method according to any one of claims 1 to 7.
