Vulnerability detection method and related device
Through the automated feature matching and vulnerability positioning technology of the software testing platform, the problem of difficulty in identifying vulnerabilities in the existing technology is solved, efficient vulnerability detection and accuracy are achieved, and the cost of manual analysis is reduced.
Patent Information
- Application Number
- PCT/CN2023/136075
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-11
- Filing Date
- 2023-12-04
- Publication Date
- 2024-11-28
AI Technical Summary
The existing vulnerability detection methods fail to effectively consider the influencing factors during the software compilation and generation of binary programs from source code, which makes it difficult to identify and detect the impact of vulnerabilities. The manual analysis is inefficient, and high-skilled personnel are required to perform assembly code analysis. , increasing costs.
The code files of the tested software are obtained through the software testing platform, extract their function-level features and match them with the software feature library, query the vulnerability positioning information knowledge base, automatically identify the degree of impact of vulnerabilities on the software, and reduce the workload of manual analysis.
It realizes automated identification and detection of the degree of vulnerability impact, improves vulnerability detection efficiency, reduces the workload of manual analysis, improves detection accuracy and comprehensiveness, and reduces users' need to fix vulnerabilities.
Smart Images

Figure CN2023136075_28112024_PF_FP_ABST
Abstract
Description
A vulnerability detection method and related equipment
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on May 22, 2023, with application number 202310579694.8 and invention name “A vulnerability analysis method and related equipment”, and claims priority to the Chinese patent application filed with the State Intellectual Property Office on August 11, 2023, with application number 202311017860.1 and invention name “A vulnerability detection method and related equipment”, the entire contents of which are incorporated by reference into 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, is a flaw in computer system security that threatens the confidentiality, integrity, availability, and access control of the system or its application data. Software composition analysis (SCA) is widely used to detect vulnerabilities in software, particularly binary SCA, which detects vulnerabilities in binary programs (e.g., executable code). The actual security risk posed by a vulnerability to software (e.g., binary program or target program) can be expressed as vulnerability impact effectiveness.
[0004] For the software to be tested, SCA technology can be used to first identify other software referenced by the software (such as open source software) and the version numbers of the referenced software. Then, based on the referenced open source software and version numbers, a known vulnerability database is searched to associate a list of existing vulnerabilities in the software. In this detection method, the vulnerabilities in the vulnerability list are considered to have an impact on the software (such as a binary program). The impact of the vulnerability is presented in the detection report (also known as the scan report) based on the Common Vulnerability Scoring System (CVSS) 3.0 score in the vulnerability information.
[0005] However, the process of compiling software from source code to binary programs involves numerous influencing factors and scenarios. These vulnerability detection methods don't consider these factors or scenarios during the compilation process, making it difficult to identify and detect vulnerability impact effectiveness. Manual analysis of vulnerability impact effectiveness in detection reports is inefficient and requires high-level skills, typically requiring the ability to understand assembly code. This increases costs and makes it difficult to meet business needs.
[0006] Summary of the Invention
[0007] This application provides a vulnerability detection method that can automatically identify and detect the impact of vulnerabilities, thereby improving vulnerability detection efficiency. This application also provides a corresponding software testing platform, computing device cluster, computer-readable storage medium, and computer program product.
[0008] In a first aspect, the present application provides a vulnerability detection method that can be performed by a software testing platform. The software testing platform is used to detect the extent of 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 in the cloud. The software system can also be integrated into other systems, such as integrated into other software systems in the form of a plug-in. The software system can be deployed on 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 vulnerability detection capabilities, which executes the vulnerability detection method of the present application when the hardware system is running.
[0009] Specifically, the software testing platform obtains the code file of the software under test, which is a compiled code file. According to the code file of the software under test, the feature set of the software under test is extracted, 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 features 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 a 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, the 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 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.
[0010] 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 library, 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, 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.
[0011] In some possible implementations, the target functions associated with the vulnerability include the vulnerable function and functions in the call chain of the vulnerable function. In this method, all functions in the referenced software that are directly or indirectly related to the vulnerability are identified as target functions associated with the vulnerability. This avoids missing vulnerability-related functions in the referenced software and improves vulnerability detection accuracy.
[0012] 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.
[0013] In this method, a failure to match a function identifier or function signature indicates that the target function does not exist in the feature set of the software under test, meaning that the vulnerability in the referenced software has not been compiled into the software under test. This allows us to identify instances where vulnerabilities in the referenced software do not exist in the software under test, improving the comprehensiveness of vulnerability detection.
[0014] 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 is determined 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.
[0015] In this method, if a function identifier or function signature match fails and the target function is not called by the software under test, it means that the target function will not be executed by the software under test. This method can identify situations where vulnerabilities in the referenced software exist in the software under test but are not executed, improving the comprehensiveness of vulnerability detection.
[0016] In some possible implementations, the software testing platform may identify, in the vulnerability detection results, the degree of impact of a vulnerability in at least one reference software on the software being tested.
[0017] In this method, users can intuitively and clearly understand whether the vulnerabilities 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), which improves the accuracy of vulnerability detection in the software under test and reduces the workload of users in vulnerability repair.
[0018] In some possible implementations, a vulnerability location information knowledge base can be constructed as follows: first, vulnerability repair information of open source software or closed-source software with source code access is obtained; 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; 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.
[0019] In this method, by integrating the code snippets 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.
[0020] In some possible implementations, a software feature library can be constructed as follows: first, the source code of the open source software or the closed source software with source code access rights is obtained, 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 rights, 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 rights.
[0021] This method can achieve efficient feature extraction without setting up a source code build environment or successfully compiling the source code. In addition, this method uses function call relationships to generate feature sets with fine granularity, thereby enriching the software feature library.
[0022] 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. Users can implement vulnerability detection of the software under test through the vulnerability detection page or application programming interface.
[0023] 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.
[0024] In a second aspect, the present application provides a software testing platform for detecting the impact of vulnerabilities on software, the software testing platform comprising:
[0025] A file acquisition module 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;
[0026] A feature extraction module is used to extract a feature set of the software under test based on the code file of the software under test, wherein the feature set of the software under test includes function identifiers, function features and function call information;
[0027] a feature matching module, configured to match a feature set of the software under test with a 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 a 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 identifiers, function features, and function call information;
[0028] a vulnerability location module, configured to query a vulnerability location information knowledge base based on 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 in the at least one reference software that is related to the vulnerability;
[0029] 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.
[0030] In some possible implementations, the target function related to the vulnerability includes the vulnerable function and functions in a call chain of the vulnerable function.
[0031] In some possible implementations, the impact determination module is specifically configured to:
[0032] Matching the function identifier of the target function with the function identifiers in the feature set of the software under test, and / or matching the function features of the target function with the function features in the feature set of the software under test;
[0033] When the match fails, it is determined that the vulnerability does not exist in the tested software.
[0034] In some possible implementations, the impact determination module is further configured to:
[0035] 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 impact on the software under test.
[0036] In some possible implementations, the impact determination module is further configured to:
[0037] The degree of influence of the vulnerability existing in the at least one reference software on the software being tested is identified in the vulnerability detection result.
[0038] In some possible implementations, the vulnerability location information knowledge base is constructed in the following manner:
[0039] Obtaining vulnerability repair information for the open source software or the closed source software with source code access rights;
[0040] Obtaining, based on the vulnerability repair information, a 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, and a code snippet of the vulnerable function;
[0041] Analyze the code snippet of the vulnerable function to obtain the call chain of the vulnerable function;
[0042] The vulnerability location information knowledge base is constructed based on the vulnerability function and the call chain of the vulnerability function.
[0043] In some possible implementations, the software feature library is constructed as follows:
[0044] Obtaining the source code of the open source software or the closed source software with source code access permission;
[0045] Extracting function identifiers, 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;
[0046] 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.
[0047] In a third aspect, the present application provides a computing device cluster. The computing device cluster includes at least one computing device, each of which 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 configured to execute instructions stored in the at least one memory, causing the computing device or computing device cluster to perform the vulnerability detection method described in the first aspect or any implementation of the first aspect.
[0048] 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 first aspect or any implementation of the first aspect.
[0049] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when run on a computing device or a computing device cluster, enables the computing device or computing device cluster to execute the vulnerability detection method described in the first aspect or any one of the implementations of the first aspect.
[0050] Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical methods of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments.
[0052] FIG1 is a schematic diagram of a software vulnerability detection process provided by an embodiment of the present application;
[0053] FIG2 is a schematic diagram of the architecture of a software testing platform provided in an embodiment of the present application;
[0054] FIG3 is a flow chart of a vulnerability detection method provided in an embodiment of the present application;
[0055] FIG4 is a schematic diagram of a vulnerability detection process provided in an embodiment of the present application;
[0056] FIG5 is a schematic diagram of a process for extracting function-level features according to an embodiment of the present application;
[0057] FIG6 is a schematic diagram of an assembly code provided in an embodiment of the present application;
[0058] FIG7 is a schematic diagram of a feature set determination process provided in an embodiment of the present application;
[0059] FIG8 is a schematic diagram of a feature matching process provided in an embodiment of the present application;
[0060] FIG9 is a schematic diagram of a process for determining the impact of a vulnerability according to an embodiment of the present application;
[0061] 10A and 10B are schematic diagrams of a feature set of reference software provided in an embodiment of the present application;
[0062] FIG11A and FIG11B are an application scenario of determining the impact of a vulnerability on the tested software provided by an embodiment of the present application;
[0063] FIG12 is a schematic diagram of a feature set of software in a software feature library provided in an embodiment of the present application;
[0064] FIG13 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0065] FIG14 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0066] FIG15 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application;
[0067] FIG16 is a schematic diagram of the structure of another computer cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0068] The terms "first" and "second" in the embodiments of this application are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Therefore, features specified as "first" or "second" may explicitly or implicitly include one or more of the features.
[0069] First, some technical terms involved in the embodiments of this application are introduced.
[0070] A vulnerability, also known as a vulnerability, is a flaw in computer system security. Vulnerabilities can arise from a variety of sources, including design flaws or coding errors in software or operating systems. Alternatively, they can arise from design flaws or logical inconsistencies in business interaction processes. When exploited, these vulnerabilities can threaten the confidentiality, integrity, availability, and access control of the system or its application data.
[0071] Software composition analysis (SCA) is a technique for identifying and analyzing the components of software. By analyzing the source code, modules, frameworks, and libraries used by software developers, SCA can identify other software referenced by a software (such as open source software).
[0072] Open source software (OSS) refers to software whose source code is publicly available. Users can use, modify, and distribute the source code used by OSS under specific licenses. Given the lack of standardized development practices and the high number of vulnerabilities found in OSS, SCA can be used to detect vulnerabilities in software, particularly binary SCA, which detects vulnerabilities in software binary programs (e.g., executable code). The actual security risk posed by a vulnerability to the software can be expressed as vulnerability impact effectiveness.
[0073] The following is an introduction to the vulnerability detection process. Referring to the schematic diagram of a vulnerability detection process shown in Figure 1, 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. Then, based on the open source software and version number, the known vulnerability library is queried to associate the vulnerability list of the software, and a detection report (also called a scan report) for 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 score results of the Common Vulnerability Scoring System (CVSS) 3.0 in the vulnerability information of the detection report.
[0074] Because there are many influencing factors or scenarios when compiling software from source code to generate binary programs, the following four relationships can exist between vulnerabilities in open source software and the software to be tested (such as binary programs): ① Because the vulnerability has been patched 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. ② Because the compilation is done in files, the vulnerability exists in the software, but the vulnerability code is not executed, and the software is not affected. ③ The vulnerability exists in the software and the software is affected by the vulnerability, but the security risk impact of the vulnerability is incorrect. ④ The vulnerability exists in the software and the software is affected by the vulnerability, and the security risk impact of the vulnerability is correct.
[0075] However, the vulnerability detection method above 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 consider the influencing factors or scenarios in the compilation process, making it difficult to identify and detect the effectiveness of the vulnerability impact. It requires manual analysis of the vulnerability impact effectiveness of the vulnerabilities in the detection report. For example, the software is disassembled and the vulnerability impact effectiveness analysis is performed by manually viewing the assembly code 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 the analyst. It usually requires the ability to understand assembly code, which increases costs and makes it difficult to meet business needs.
[0076] In view of this, the present application provides a vulnerability detection method. The method can be executed by a software testing platform, which can be 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 in the cloud. The software system can also be integrated into other systems, such as integrated into other software systems in the form of a plug-in. The software system can be deployed on a computing device cluster, which 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 vulnerability detection capabilities, which executes the vulnerability detection method of the present application when the hardware system is running.
[0077] Specifically, the software testing platform obtains the code file of the software under test, which is a compiled code file. According to the code file of the software under test, the feature set of the software under test is extracted, 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 features 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 a 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, the 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 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.
[0078] 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 library, 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, 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.
[0079] 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.
[0080] Referring to the architectural diagram of the software testing platform shown in Figure 2, 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.
[0081] 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.
[0082] The feature extraction module 204 is used to extract a feature set of the software under test based on the code file of the software under test. The feature set of the software under test includes a function identifier (e.g., a function name or function address), function features, and function call information. The feature set of the software under test can be called the function-level features of the software under test.
[0083] 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. 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.
[0084] The vulnerability location module 208 is configured to query a vulnerability location information knowledge base based on at least one reference software of the tested software to obtain a vulnerability existing in the at least one reference software and location information for the vulnerability. 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. The location information may indicate a target function related to the vulnerability in the at least one reference software, such as the vulnerable function and functions in the call chain of the vulnerable function.
[0085] The impact determination module 210 is used to obtain the degree of impact of the vulnerability existing in 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. In some embodiments, the feature set of the reference software can be queried in the software feature library to obtain the features related to the target function in the reference 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 impact 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.
[0086] Furthermore, the impact determination module 210 can also generate vulnerability detection results for the software under test, and identify in the vulnerability detection results the degree to which the vulnerability in at least one referenced software affects the software under test. This improves vulnerability detection efficiency and allows users to intuitively identify vulnerabilities that affect the software under test through the vulnerability detection results.
[0087] The software testing platform 20 of the embodiment of the present application can be a software system. The software system 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, all modules in the software testing platform 20 can 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 (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 feature extraction module 204 are deployed locally as an agent, while the feature matching module 206, vulnerability location module 208, and impact determination module 210 are deployed in the cloud. Users 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, where feature matching, vulnerability query, and vulnerability impact determination are performed. In this way, vulnerability detection is achieved while reducing user deployment costs.
[0088] Based on the above-mentioned software testing platform 20 provided in the embodiment of the present application, the embodiment of the present application further provides a vulnerability detection method, which will be described in detail below with reference to the accompanying drawings.
[0089] Referring to the flowchart of the vulnerability detection method shown in FIG3 , the method includes the following steps:
[0090] S302: The software testing platform 20 obtains the code file of the software under test.
[0091] Among them, the code file of the software under test 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. Normally, the code file of the software under test can be loaded and executed by the operating system. Therefore, the code file of the software under test can also be called the executable file, binary file or binary program of the software under test. Under different operating systems, the code file of the software under test can have different presentation methods. For example, under the Windows operating system, the code file of the software under test can be an exe file, a sys file or a com file.
[0092] The code files of the software under test can be obtained through compilation. 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.
[0093] 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.
[0094] In a specific implementation, the software testing platform 20 can extract the feature set of the software under test by disassembling the code file. This will be explained below with reference to the accompanying drawings. FIG. 4 shows a schematic diagram of a vulnerability detection process. Phase 1 in FIG. 4 is the process of extracting the feature set of the software under test.
[0095] First, the software testing platform 20 can perform format analysis on the code file of the software under test. For example, the software testing platform 20 can perform format analysis on the code file from multiple dimensions such as file format, operating system, and central processing unit (CPU) architecture to obtain format analysis results.
[0096] Then, the software testing platform 20 can disassemble the code file of the software under test according to the format analysis results 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 results, and then use the disassembler to disassemble the code file of the code under test to obtain an assembly code file.
[0097] 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. Referring to a flow chart of function-level feature extraction shown in FIG5 , 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. 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 a 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 referred to as a function call graph (CG).
[0098] The following example illustrates the function call relationship analysis process. FIG6 shows a schematic diagram of assembly code related to the perf_mmap_close function. This assembly code provides information about other functions called by perf_mmap_close, including atomic_dec_and_mutex_lock, mutex_unlock, perf_buffer_put, and free_uid. Software testing platform 20 can perform a similar recursive function call relationship analysis on the other functions called by perf_mmap_close until the function being analyzed no longer calls other functions. Software testing platform 20 can then determine the function call information.
[0099] By performing function segmentation on the assembly code file of the software under test and then performing feature extraction based on the function segmented assembly code file, at least one function-level feature of the software under test can be generated, thereby obtaining a feature set of the software under test. Referring to FIG7 , a schematic diagram of a feature set determination process is shown. 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 2, and the features of function F2 include features 2 and 3. By merging the features of function F1 and function F2, a feature set of the software under test can be determined, which includes features 1, 2, and 3.
[0100] S306: The software testing platform 20 matches the feature set of the software under test with the feature sets 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.
[0101] Among them, the software feature library (also known as the 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.
[0102] The feature matching process of the software testing platform 20 corresponds to stage 2 in Figure 4. In specific implementation, the software testing platform 20 can perform similarity calculation on the feature set of the software under test and the feature set of the software in the software feature library, thereby determining at least one reference software of the software under test based on the similarity calculation result.
[0103] Referring to the schematic diagram of a feature matching process shown in Figure 8, 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).
[0104] S308: The software testing platform 20 queries the 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.
[0105] Among them, the vulnerability location information knowledge base includes vulnerability-related information existing in open source software or closed source software with source code access rights. Vulnerability-related information includes but is not limited to vulnerabilities, vulnerability locations, vulnerability codes, and other information existing in open source software or closed source software with source code access rights.
[0106] The location information may indicate at least one target function related to the vulnerability in the reference software. For example, the function name of the target function related to the vulnerability in the reference software, the file path of the target function, etc. In other words, the software testing platform 20 can obtain the target function related to the vulnerability in the reference software of the tested software by querying the vulnerability location information knowledge base.
[0107] In some embodiments, the target function associated with the vulnerability may include the vulnerable function and functions in the call chain of the vulnerable function, wherein the call chain of the vulnerable function can be generated by function call information of the reference software. In this way, functions in the reference software that are directly or indirectly related to the vulnerability can be determined.
[0108] 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.
[0109] 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.
[0110] After obtaining the features related to the target function in the feature set of the reference software, the software testing platform 20 can again match the feature set of the software under test with the features related to the target function in the feature set of at least one reference software to obtain a matching result. Based on the matching result, the impact of the vulnerability in the at least one reference software on the software under test can be determined. The above-described processes of S308 and S310 correspond to stage 3 in FIG4 .
[0111] In the embodiment of the present application, there are two feature matching operations. The first operation is to match the feature set of the software under test with the feature sets of the software in the software feature library to obtain at least one reference software of the software under test. The second operation is to match the feature set of the software under test with the feature set of at least one reference software.
[0112] Referring to the flowchart of a method for determining the impact of a vulnerability shown in FIG9 , the software testing platform 20 obtains at least one reference software of the software under test, queries the vulnerability location information knowledge base, and terminates the matching process if the reference software does not have a vulnerability. If the reference software has a vulnerability, the vulnerability and vulnerability location information of 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 features of the target function with the function features 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 impact on the software under test, thereby identifying the situation where the vulnerability of the reference software does not exist in the software under test.
[0113] Furthermore, 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. It then determines whether the target function is called by the function of the software under test. If so, the matching process ends. If not, the software testing platform 20 can determine that the vulnerability has no impact 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 indicates that the target function will not be executed by the software under test, and the vulnerability has no impact on the software under test, thereby identifying that the vulnerability of the reference software exists in the software under test but will not be executed.
[0114] The software testing platform 20 can save the matching results of the aforementioned vulnerabilities not existing in the tested software and the vulnerabilities having no impact on the tested software, and identify the degree of impact of the vulnerability existing in at least one reference 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 reference software will have an impact on the tested software and the extent of the impact by viewing the vulnerability detection results. For the cases where the vulnerability does not exist in the tested software and the vulnerability has no impact on the tested software, the user does not need to take any action (such as vulnerability repair), thereby improving the accuracy of vulnerability detection of the tested software and reducing the workload of the user in vulnerability repair.
[0115] The following will be explained with reference to specific examples. Referring to Figures 10A and 10B , which illustrate a schematic diagram of a feature set of reference software, the reference software of the software under test includes software A and software B. Software A's feature set includes features of functions F1, F2, F3, F4, F5, and F6. Function F4 of software A contains a vulnerability (indicated by a black five-pointed star in Figure 10A). Software B's feature set includes features of functions F1, F2, and F3.
[0116] 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 vulnerability location information can indicate the target function related to the vulnerability in software A, namely, function F1, function F2, function F3 and function F4.
[0117] Next, the matching results in two scenarios will be given. In some embodiments, referring to FIG11A , 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.
[0118] In other embodiments, referring to FIG11B , 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 functions 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.
[0119] 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 of the target function related to the vulnerability in the reference software by querying the vulnerability location information knowledge base, and then determines the degree of impact of the vulnerability on the software under test through the second feature matching, such as the 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.
[0120] 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 following will describe the construction process of the software feature library and the vulnerability location information knowledge base.
[0121] 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 closed source software with source code access rights, and thus construct a 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 closed source software with source code access rights.
[0122] Referring to FIG12 , which illustrates a schematic diagram of a feature set of software in a software feature library, the software testing platform 20 can obtain the source code of the software and extract features of the software from the source code, including features 1, 2, and 3 of function F1, as well as function call information from function F1 calling functions F2 and F3, features 1 and 2 of function F2, feature 1 of function F3, and function call information from function F3 calling function F4, as well as features 1 and 2 of function F4. In this way, the software testing platform 20 can generate function-level features for the software and thus construct a software feature library.
[0123] For 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 snippet of the vulnerability function, analyze the code snippet of the vulnerability function, and obtain the call chain of the vulnerability function, thereby constructing the vulnerability location information knowledge base based on the vulnerability function and the call chain of the vulnerability function.
[0124] Among them, vulnerability repair information can 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". Vulnerability patch information refers to the modified vulnerability code and the specific modification content.
[0125] The following is an introduction to the specific vulnerability repair information, which is as follows:
[0126] Software testing platform 20 analyzes the vulnerability fix information and, based on the vulnerability fix information on the lines containing ---a and +++b, locates the path and file name of the source code where the vulnerability is introduced, namely, kernel / events / core.c. Next, based on the vulnerability fix information on the line containing @@, software testing platform 20 obtains the source code location that introduced the vulnerability and the code fragment of the vulnerable function, including 11 lines of code starting at line 4782, 7 lines of code starting at line 4805, and 7 lines of code starting at line 4814. Based on the source code location, software testing platform 20 determines that the vulnerable function that introduced the vulnerability is perf_mmap_close.
[0127] 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.
[0128] The following is an explanation based on the specific code. The code used to generate vulnerability location information is as follows:
[0129] This code is a combination of information about the vulnerable function and other functions related to the vulnerable 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 vulnerable 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 vulnerable function, that is, ring.buffer.c calls other functions, and a2mp.c calls the vulnerable function. In this way, the software testing platform 20 can combine the code snippets of the vulnerable function and other function information related to the vulnerable function to build a comprehensive and accurate vulnerability location information knowledge base.
[0130] Based on the vulnerability detection method of the aforementioned embodiment, the present application embodiment further provides a software testing platform 20 as described above. The software testing platform 20 is introduced below with reference to the accompanying drawings.
[0131] 2 , the software testing platform 20 is used to detect the impact of vulnerabilities on software. The software testing platform 20 includes:
[0132] 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;
[0133] The feature extraction module 204 is used to extract a feature set of the software under test based on the code file of the software under test, wherein the feature set of the software under test includes function identifiers, function features and function call information;
[0134] A feature matching module 206 is configured to match a feature set of the software under test with a 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 feature sets of open source software or closed source software with source code access rights, and the feature sets of software in the software feature library include function identifiers, function features, and function call information;
[0135] A vulnerability location module 208 is configured to query a vulnerability location information knowledge base based on 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, wherein the location information indicates a target function related to the vulnerability in the at least one reference software;
[0136] The impact determination module 210 is configured to obtain 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.
[0137] The aforementioned file acquisition module 202, feature extraction module 204, feature matching module 206, vulnerability location module 208, and impact determination module 210 can be implemented as hardware modules or software modules. Specifically, 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 as a computing device or a computing engine on the computing device. The following description will use the file acquisition module 202 as an example.
[0138] When implemented via software, the file acquisition module 202 can be an application or application module, such as a computing engine, running on a computing device or computing device cluster. The application can be provided to users as a virtualized service. Virtualized services may include virtual machine (VM) services, bare metal server (BMS) services, and container services. VM services can be services that use virtualization technology to create a virtual machine (VM) resource pool on multiple physical hosts (such as computing devices) to provide users with VMs on demand. BMS services can be services that create a virtual BMS resource pool on multiple physical hosts to provide users with BMSs on demand. Container services can be services that create a virtual container resource pool on multiple physical hosts to provide users with containers on demand. A VM is a simulated virtual computer, or logically a single computer. BMS is a scalable, high-performance computing service with computing performance comparable to that of a traditional physical machine and secure physical isolation. Containers are a kernel virtualization technology that provides lightweight virtualization to isolate 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.
[0139] When implemented through hardware, the file acquisition module 202 may include at least one computing device, such as a server. Alternatively, the file acquisition module 202 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). 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.
[0140] In some possible implementations, the target function related to the vulnerability includes the vulnerable function and functions in the call chain of the vulnerable function.
[0141] In some possible implementations, the impact determination module 210 is specifically configured to:
[0142] 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;
[0143] When the match fails, it is determined that the vulnerability does not exist in the tested software.
[0144] In some possible implementations, the impact determination module 210 is further configured to:
[0145] 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 a vulnerability exists in the software under test and the vulnerability has no impact on the software under test.
[0146] In some possible implementations, the impact determination module 210 is further configured to:
[0147] In the vulnerability detection result, the impact degree of the vulnerability existing in at least one reference software on the tested software is identified.
[0148] In some possible implementations, the vulnerability location information knowledge base is constructed as follows:
[0149] Obtain information about vulnerability fixes for open source software or closed source software with source code access;
[0150] 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 closed source software with source code access rights;
[0151] Analyze the code snippet of the vulnerable function to obtain the call chain of the vulnerable function;
[0152] Build a vulnerability location information knowledge base based on the vulnerability function and its call chain.
[0153] In some possible implementations, the software feature library is constructed as follows:
[0154] Obtain source code for open source software or closed source software with source code access;
[0155] Extract function identification, function characteristics, and function call information from the source code of open source software or closed source software with source code access rights;
[0156] 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.
[0157] This application also provides a computing device 1300. As shown in Figure 13, computing device 1300 includes a bus 1302, a processor 1304, a memory 1306, and a communication interface 1308. Processor 1304, memory 1306, and communication interface 1308 communicate with each other via bus 1302. Computing device 1300 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 1300.
[0158] Bus 1302 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG13 shows a single line, but this does not imply a single bus or type of bus. Bus 1302 may include a path for transmitting information between various components of computing device 1300 (e.g., memory 1306, processor 1304, and communication interface 1308).
[0159] The processor 1304 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0160] 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.
[0161] 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 a communication network.
[0162] Embodiments of the present application also provide 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 smartphone.
[0163] As shown in Figure 14, the computing device cluster includes at least one computing device 1300. The memory 1306 of one or more computing devices 1300 in the computing device cluster may store instructions for executing the vulnerability detection method on the same software testing platform 20.
[0164] In some possible implementations, one or more computing devices 1300 in the computing device cluster can also be used to execute some of the instructions of the vulnerability detection method on the software testing platform 20. In other words, the combination of one or more computing devices 1300 can jointly execute the instructions of the software testing platform 20 for executing the vulnerability detection method.
[0165] It should be noted that the memory 1306 in different computing devices 1300 in the computing device cluster may store different instructions for executing part of the functions of the software testing platform 20 .
[0166] Figure 15 illustrates a possible implementation. As shown in Figure 15 , 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.
[0167] The connection method between the computing device clusters shown in Figure 15 may be considered to take into account the need for the software testing platform provided herein to extract features of the tested software and determine the impact through vulnerability location. Therefore, it is considered that the functions implemented by file acquisition module 202, feature extraction module 204, and feature matching module 206 are performed by computing device 1300A, while the functions implemented by vulnerability location module 208 and impact determination module 210 are performed by computing device 1300B.
[0168] It should be understood that the functionality of the computing device 1300A shown in FIG15 may also be implemented by multiple computing devices 1300. Similarly, the functionality of the computing device 1300B may also be implemented by multiple computing devices 1300.
[0169] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network or a local area network, etc. FIG16 shows a possible implementation. As shown in FIG16 , two computing devices 1300C and 1300D are connected via a network. Specifically, the connection to the network is made through 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.
[0170] The connection method between the computing device clusters shown in Figure 16 can be based on the need to extract the features of the software under test and determine the impact through vulnerability location in the software testing platform provided by this application. 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 1300C, and the functions implemented by the vulnerability location module 208 and the impact determination module 210 are performed by the computing device 1300D. It should be understood that the functions of the computing device 1300C shown in Figure 16 can also be performed by multiple computing devices 1300. Similarly, the functions of the computing device 1300D can also be performed by multiple computing devices 1300.
[0171] 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 that contains 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 drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned vulnerability detection method applied to the software testing platform.
[0172] The present application also provides a computer program product comprising instructions. The computer program product may be software or a program product comprising instructions that can be executed on a computing device or stored on any available medium. When the computer program product is executed on at least one computing device, the at least one computing device executes the vulnerability detection method described above.
[0173] 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 deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A vulnerability detection method, It is 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, It is 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, It is 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, It is 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, It is 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, It is 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, It is 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, It is 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 is used to match the feature set of the software under test with the feature set of the software in the software feature library, Determine at least one reference software of the software under test in a software feature library, wherein the software feature library includes a 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, It is 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, It is 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, It is 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, It is 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, It is 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, It is 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, It is 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, It is 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, It is 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.
Citation Information
Patent Citations
Method and device for detecting integrated or customized open source project bugs in software
CN106446691A
Software quality evaluation method and device, terminal equipment and storage medium
CN112199293A
Vulnerability detection method and device based on software dependency analysis, equipment and medium
CN113434870A
Software vulnerability detection method based on static analysis and dynamic analysis
CN116049831A
System And Method For Visualizing And Measuring Software Assets
US20210326239A1
