Method for detecting CVE vulnerabilities of open source components in firmware file systems

By automatically identifying and unpacking components in the Linux firmware file system, querying the CPE information of NVD, and combining machine learning and deep learning algorithms, the problems of data source limitations, false positives and false negatives in the existing technology are solved, and an efficient, Intelligent CVE vulnerability detection improves detection accuracy and automation.

CN117807604BActive Publication Date: 2024-08-30TIANJIN HUALAI TECH CO LTD

Patent Information

Application Number
CN202410231735.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-01
Publication Date
2024-08-30
Estimated Expiration
2044-03-01

AI Technical Summary

Technical Problem

Existing CVE vulnerability detection technology for Linux firmware open source components or libraries has data source limitations, false positives and negatives, and lacks automation and intelligence, resulting in reduced detection efficiency and accuracy.

Method used

This paper proposes a method for detecting CVE vulnerabilities in open source components in the firmware file system. It automatically identifies and unpacks the firmware type, uses a preset program to parse the version information of the component or library, queries the CPE information of NVD, and searches for vulnerability data in the local database. Combining machine learning models and deep learning algorithms to achieve automated and intelligent detection.

Benefits of technology

It achieves low false positive and false negative rates, supports multiple types of firmware detection, and is highly automated and intelligent. Users only need to specify firmware to start fully automated CVE vulnerability detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117807604B
    Figure CN117807604B
Patent Text Reader

Abstract

The present invention provides a method for detecting CVE vulnerabilities of open source components in a firmware file system, including: automatic identification and unpacking of firmware types to obtain a complete firmware file system; a preset program traverses the file system from the root directory to find and record all ELFs, wherein the ELFs are executable and linkable formats; the preset program is used to parse the version information of each component or library in the firmware; according to the name of the acquired component or library and its version information, the preset program queries the corresponding CPE information through NVD, wherein the NVD is a network vulnerability database, and CPE is a general platform enumeration; the vulnerability data is searched in the local database according to the CPE information, and the search is performed according to a preset search method. Beneficial effects of the present invention: the scheme realizes low false alarm rate and missed alarm rate, supports detection of multiple types of firmware, is highly automated and intelligent, and the user only needs to specify the firmware to start fully automated CVE vulnerability detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of detection technology, and in particular relates to a method for detecting CVE vulnerabilities of open source components in a firmware file system. Background Art

[0002] With the rapid development of information technology, Linux system, as an open source operating system, has been widely used in various fields such as servers, embedded devices, and smart phones. However, with its widespread application, the network security issues of Linux system and its components have become increasingly prominent. CVE (Common Vulnerabilities and Exposures) is a public release platform for network security vulnerabilities. A large number of Linux firmware open source components or libraries have CVE vulnerabilities, which may be exploited by hackers and cause serious security threats. Therefore, the research and application of CVE vulnerability detection technology for Linux firmware open source components or libraries is particularly important.

[0003] In terms of CVE vulnerability detection in Linux firmware open source components or libraries, early methods mainly rely on manual detection and repair. These methods are not only time-consuming and labor-intensive, but also prone to missed reports and false positives. In order to solve these problems, some automated detection tools have begun to be developed and applied. These tools are mainly based on static analysis methods and can automatically detect some common vulnerabilities.

[0004] At present, there are some automated tools for CVE vulnerability detection for Linux firmware open source components or libraries, such as the open source CVE-Checker and the commercial Red Hat Security Tool. These tools can automatically detect some common vulnerabilities and generate corresponding reports. However, the existing technologies still have some problems and shortcomings, such as data source limitations, false positives and false negatives, and lack of automation and intelligence. Although the existing technologies are constantly developing and improving, they may still lack automation and intelligence functions, which may lead to increased operational complexity and costs, and also reduce detection efficiency and accuracy.

[0005] In summary, how to ensure the stability and integrity of vulnerability data sources, reduce false positives and negatives, increase adaptability to new vulnerabilities, and how to improve automation and intelligence have become issues that technical personnel in this field urgently need to solve. Summary of the invention

[0006] In view of this, the present invention aims to propose a CVE vulnerability detection method for open source components in a firmware file system, so as to at least solve at least one problem in the background technology.

[0007] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0008] The open source component CVE vulnerability detection method in the firmware file system includes:

[0009] S1. Automatic identification and unpacking of firmware type to obtain the complete firmware file system;

[0010] S2, preset program traverses the file system from the root directory, searches and records all ELFs, and the ELFs are in executable and linkable formats;

[0011] S3, using a preset program to parse out the version information of each component or library in the firmware;

[0012] S4. According to the name and version information of the acquired component or library, the preset program queries the corresponding CPE information through NVD, where NVD is a network vulnerability database and CPE is a general platform enumeration;

[0013] S5. Searching for vulnerability data in the local database according to the CPE information, and searching according to a preset search method;

[0014] S6. The preset program queries corresponding vulnerability data through interaction with NVD according to the CPE information of the component or library;

[0015] S7, the preset program writes the CPE information and corresponding vulnerability data retrieved from the NVD into the local database;

[0016] S8. The preset program generates a detection report based on the queried vulnerability data.

[0017] Furthermore, in step S1, for different types of firmware, Binwalk is used to extract the file system embedded in the firmware, and mount is used to mount the file system as an accessible directory.

[0018] Furthermore, in step S1, a machine learning model is used to classify and train different firmware types to improve recognition accuracy. At the same time, an unpacking tool library is established to automatically select appropriate tools for unpacking according to the firmware type to ensure that all contents of the firmware can be accessed, including:

[0019] C1. Data collection and preprocessing: used to collect different types of firmware samples, preprocess the firmware samples, and extract features, as follows:

[0020] Combining SVM and neural network, using SVM for basic classification and neural network to further handle edge cases:

[0021] , where α i is the Lagrange multiplier, y iis the category label of the i-th training sample, <x,x i > for x and x i The inner product of x is the input vector, x i is the i-th support vector;

[0022] C2. Model training: Select support vector machine or deep neural network, use preprocessed firmware samples for model training, and adjust parameters until the preset recognition accuracy is achieved;

[0023] C3, testing and optimization: Use firmware samples that have not participated in training to test the accuracy of the model, and further optimize the model based on the test results;

[0024] C4, integrated unpacking tool library: collect and integrate various firmware unpacking tools;

[0025] C5. Automated unpacking process: Automatically select and apply the most appropriate unpacking tool based on the firmware type identified by the machine learning model to ensure full access to the firmware content;

[0026] C6. System deployment and monitoring: Deploy the trained model and unpacking tool library to the actual vulnerability detection system, and regularly monitor its performance to ensure efficient and accurate identification and unpacking of firmware.

[0027] Furthermore, in step S3, the version information parsing method includes:

[0028] Extract version information by analyzing specific sections or other metadata of ELF files;

[0029] Furthermore, in step S3, the steps of using the deep learning algorithm to identify the version information of the component or library are as follows:

[0030] Furthermore, in step S5, searching according to a preset search method includes the following steps:

[0031] Dataset construction: Build a dataset containing rich component version information, use the preset data enhancement method to increase the generalization ability of the model, and use the constructed dataset for search. The data enhancement method includes the following steps:

[0032] A1. Use random perturbation methods, including random noise injection, random cropping, and rotation, combined with data enhancement methods in natural language processing such as synonym replacement, to apply to text data in firmware;

[0033] A2. Apply randomly selected perturbations to each sample, including random cropping of firmware files:

[0034] ,in is the enhanced sample, is the original sample, is a small random noise;

[0035] A3. Perform standardization on the enhanced data to ensure data consistency, expand the original data set, and combine the original and enhanced data for model training;

[0036] A4. Train the model on the expanded dataset and use cross-validation to evaluate the performance of the model on the augmented data.

[0037] Further, in step S8, the detection report includes version information of each identified component, corresponding CPE information, detected vulnerabilities and descriptions thereof.

[0038] Furthermore, the present solution discloses an electronic device, comprising a processor and a memory that is communicatively connected to the processor and is used to store executable instructions of the processor, wherein the processor is used to execute a CVE vulnerability detection method for open source components in a firmware file system.

[0039] Furthermore, the present solution discloses a server comprising at least one processor and a memory communicatively connected to the processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor so that the at least one processor executes a CVE vulnerability detection method for open source components in a firmware file system.

[0040] Furthermore, the present solution discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a method for detecting CVE vulnerabilities of open source components in a firmware file system.

[0041] Compared with the prior art, the open source component CVE vulnerability detection method in the firmware file system of the present invention has the following beneficial effects:

[0042] The open source component CVE vulnerability detection method in the firmware file system described in the present invention achieves low false alarm rate and missed alarm rate, supports detection of multiple types of firmware, is highly automated and intelligent, and the user only needs to specify the firmware to enable fully automated CVE vulnerability detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0044] Figure 1 Schematic diagram of a method for detecting CVE vulnerabilities of open source components in a firmware file system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0045] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0046] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0047] This solution discloses a method for detecting CVE vulnerabilities of open source components in a firmware file system, which mainly includes the following steps:

[0048] S1. Automatic identification and unpacking of firmware type to obtain the complete firmware file system;

[0049] S2, preset program traverses the file system from the root directory, searches and records all ELFs, and the ELFs are in executable and linkable formats;

[0050] S3, using a preset program to parse out the version information of each component or library in the firmware;

[0051] S4. According to the name and version information of the acquired component or library, the preset program queries the corresponding CPE information through NVD, where NVD is a network vulnerability database and CPE is a general platform enumeration;

[0052] S5. Searching for vulnerability data in the local database according to the CPE information, and searching according to a preset search method;

[0053] S6. The preset program queries corresponding vulnerability data through interaction with NVD according to the CPE information of the component or library;

[0054] S7, the preset program writes the CPE information and corresponding vulnerability data retrieved from the NVD into the local database;

[0055] S8. The preset program generates a detection report based on the queried vulnerability data.

[0056] In step S1, a machine learning model such as a support vector machine (SVM) or a neural network is used to classify and train different firmware types to improve recognition accuracy. At the same time, an unpacking tool library is established to automatically select a suitable tool for unpacking according to the firmware type to ensure that all contents of the firmware can be accessed;

[0057] The steps for using machine learning models to identify firmware types and automatically unpack are as follows:

[0058] Data collection and preprocessing: Collect different types of firmware samples, including but not limited to firmware of routers, cameras, smart devices, etc., preprocess these firmware samples, and extract features such as file size, structure, header information, etc. The specific implementation process includes:

[0059] Combining SVM and neural network, using SVM for basic classification and neural network to further handle edge cases:

[0060] , where α i is the Lagrange multiplier, y i is the category label of the i-th training sample, <x,x i > for x and x i The inner product of x is the input vector, x i is the i-th support vector;

[0061] The neural network structure may include convolutional layers and recurrent layers to capture the spatial and temporal characteristics of the firmware data.

[0062] Model training: Select a suitable machine learning model, such as support vector machine (SVM) or deep neural network, use the preprocessed firmware samples to train the model, and adjust the parameters until a high recognition accuracy is achieved;

[0063] Testing and optimization: Use firmware samples that have not participated in training to test the accuracy of the model, and further optimize the model based on the test results;

[0064] Integrated unpacking tool library: collects and integrates various firmware unpacking tools, such as Binwalk, Firmware Mod Kit, etc.

[0065] Automated unpacking process: Automatically select and apply the most appropriate unpacking tool based on the firmware type identified by the machine learning model to ensure full access to the firmware content;

[0066] System deployment and monitoring: Deploy the trained model and unpacking tool library to the actual vulnerability detection system and regularly monitor its performance to ensure efficient and accurate identification and unpacking of firmware;

[0067] In step S2, an intelligent file scanning system is developed, which can identify and confirm the signature code of the ELF file to ensure that other files are not mistaken for ELF files. At the same time, the system can identify ELF files in hidden or non-standard paths to ensure comprehensiveness;

[0068] In step S3, a deep learning algorithm, such as a convolutional neural network (CNN), is used to identify the version information of the component or library from various files and configurations of the firmware. This requires the establishment of a training dataset containing multiple component version information to achieve accurate version identification;

[0069] The steps of using deep learning algorithms to identify the version information of components or libraries are as follows:

[0070] Dataset construction: Collect firmware files and configuration information containing rich component version information to build a diverse training dataset. The specific implementation process includes:

[0071] Construct a dataset containing rich component version information and use the preset data enhancement method to increase the generalization ability of the model. The data enhancement method includes the following steps:

[0072] A1. Use random perturbation methods, including random noise injection, random cropping, rotation, etc., combined with data enhancement techniques in natural language processing (NLP), such as synonym replacement, which is applicable to text data in firmware;

[0073] A2. Apply randomly selected perturbations to each sample, including random cropping of firmware files:

[0074] ,in is the enhanced sample, is the original sample, is a small random noise;

[0075] A3. Perform standardization on the enhanced data to ensure data consistency, expand the original data set, and combine the original and enhanced data for model training;

[0076] A4. Train the model on the expanded dataset and use cross-validation to evaluate the performance of the model on the augmented data.

[0077] Feature extraction and preprocessing: preprocess the collected data to extract key features, such as file header information, specific strings, configuration file content, etc.;

[0078] Among them, extracting key features through deep learning models to improve model efficiency and accuracy includes the following steps:

[0079] B1. Design CNN architecture: Multi-layer convolution layer design is used to extract hierarchical features of firmware data, and sparse connections and separable convolutions are introduced to reduce the number of parameters and improve computational efficiency;

[0080] B2. Using activation function and normalization technology: Introducing a new activation function, ,in is the sigmoid function, are learnable parameters, using batch normalization or layer normalization to speed up training and reduce internal covariate shift;

[0081] B3. Model training and optimization: Use Adam or RMSprop optimizer for model training, and apply Dropout and L2 regularization to avoid overfitting;

[0082] B4. Feature fusion and attention mechanism: Fusion of features at different levels, using attention mechanism to focus on key information. , where Q, K, and V are query, key, and value respectively. is the dimension of the key;

[0083] B5. Performance evaluation and optimization: Evaluate model performance on the test set and further adjust model structure and parameters based on the test results;

[0084] Model selection and training: Select a suitable deep learning model, such as a convolutional neural network (CNN), and train it using the prepared dataset until the model can accurately identify the version information of different components;

[0085] Testing and optimization: Use unseen data to test the accuracy of the model, and adjust and optimize the model based on the test results;

[0086] Integration into vulnerability detection system: Integrate the trained model into the existing firmware vulnerability detection system to automatically identify component or library version information in the firmware;

[0087] Continuous update and maintenance: Regularly update the training data set to incorporate new components and version information to ensure the continued accuracy and effectiveness of the model;

[0088] In step S4, in addition to accessing NVD, other databases such as CVE Details and ExploitDatabase can be integrated. A database access layer is developed to manage and optimize queries to these databases, including automatically selecting the most appropriate data source;

[0089] In step S5, a local database containing extensive CVE data is established and regularly synchronized with the external database through automated scripts to ensure the data is up-to-date. At the same time, an efficient query algorithm is designed to quickly find relevant vulnerability information from a large amount of data;

[0090] The steps for designing an efficient vulnerability information query algorithm are as follows:

[0091] Demand analysis and planning: Analyze the specific requirements for querying vulnerability information, such as query speed, data volume, update frequency, etc., and formulate a detailed implementation plan accordingly;

[0092] Algorithm design: Design efficient query algorithms, and consider using technologies such as hash tables and index structures to improve retrieval speed. The specific implementation process includes:

[0093] Design a query algorithm based on graph theory, combining breadth-first search and Dijkstra algorithm to optimize the retrieval path:

[0094] ,in is the shortest path length from the source point to point v.

[0095] Database optimization: Optimize database design, such as using appropriate data models and storage structures to ensure efficient data access;

[0096] Implementation and testing: Implement the designed query algorithm and test it on the actual database to evaluate the query efficiency and accuracy;

[0097] Integration and optimization: Integrate the query algorithm into the vulnerability detection system and make optimization adjustments based on the actual operation situation;

[0098] System monitoring and maintenance: Regularly monitor system performance to ensure that query algorithms can run stably in a big data environment, and perform maintenance and upgrades as needed.

[0099] In step S6, use automated API calls to interact with databases such as NVD. Optimize query scripts and improve query efficiency through parallel processing and caching mechanisms;

[0100] In step S7, an efficient database writing module is designed to quickly process large amounts of data. Transaction processing and error rollback mechanisms are used to ensure data consistency and integrity;

[0101] In step S8, a report generation module is developed, which can automatically select a suitable template based on the detection results and generate a detailed report including data visualization. The report should include vulnerability details, impact assessment, repair suggestions, etc.

[0102] In the specific implementation process, this solution proposes another embodiment, and its workflow is as follows:

[0103] 1. The program automatically identifies the type of firmware. According to the different types, you can select the corresponding unpacking method by yourself. Use binwalk or mount to automatically unpack and obtain the complete firmware file system (FileSystem);

[0104] 2. After obtaining the firmware file system, search and record the ELF (Executable and Linkable Format) file from the root directory;

[0105] 3. Parse the version information of the component / library through regular matching and reverse analysis;

[0106] 4. Based on the component / library and its version information, query the corresponding CPE information through NVD;

[0107] 5. First, retrieve the vulnerability data from the local data according to the CPE information. If there is no corresponding vulnerability data in the local database, proceed to steps 6 and 7;

[0108] 6. Based on the CPE information of the component / library, query the corresponding vulnerability data through NVD;

[0109] 7. Write the queried CPE information and corresponding vulnerability data into the local database;

[0110] 8. Generate a detection report based on the queried vulnerability data.

[0111] In order to ensure the stability and integrity of vulnerability data sources, reduce false positives and negatives, increase adaptability to new vulnerabilities, and improve automation and intelligence, this solution has made the following improvements:

[0112] 1. Ensure the stability and integrity of the vulnerability data source: The source of vulnerability data is the National Vulnerability Database NVD. NVD's public vulnerabilities and exposures are a dictionary of publicly known information security vulnerabilities and risk exposures. CVE's universal identifier enables data exchange between security products and provides benchmark index point assessments of the coverage of tools and services. In general, NVD is a very important network security resource and has great reference value for enterprises, organizations and individuals. Based on this data source, this patent uses the version information of the detected component to obtain the CPE information corresponding to the component from the CPE information query interface of NVD (CPE (Common Platform Enumeration) is an abbreviation for common platform enumeration, which is a standard vocabulary for identifying and describing operating systems, applications, browsers and other software products. CPE can help security researchers and organizations better identify and classify vulnerabilities and risks associated with software products.), assuming that the parsed version of libcurl is 7.28.0, the CPE data of curl is obtained through the request:

[0113] "cpe":{

[0114] "deprecated":false,

[0115] "cpeName": "cpe:2.3:a:haxx:curl:7.28.0:*:*:*:*:*:*:*",

[0116] "cpeNameId": "19A248F4-4F2F-4664-9BAF-81FAFC21A294",

[0117] "lastModified": "2013-05-08T14:49:12.480",

[0118] "created": "2013-04-30T15:34:26.603",

[0119] "titles": [{

[0120] "title": "Haxx Curl 7.28.0",

[0121] "lang": "en"}]}

[0122] Then, according to the CPE information of the component, the corresponding vulnerability data is obtained from the CVE vulnerability query interface of the data source NVD, and the request is constructed as follows:

[0123] "cve": {

[0124] "id": "CVE-2014-2522",

[0125] "sourceIdentifier": "cve@mitre.org",

[0126] "published": "2014-04-18T22:14:38.587",

[0127] "lastModified": "2017-04-29T01:59:01.413",

[0128] "vulnStatus": "Modified",

[0129] "descriptions": [{

[0130] "lang": "en",

[0131] "value":"curl and libcurl 7.27.0 through 7.35.0, when running onWindows and using the SChannel / Winssl TLS backend, does not verify that the server hostname matches a domain name in the subject's Common Name (CN) or subjectAltName field of the X.509 certificate when accessing a URL that uses a numerical IP address, which allows man-in-the-middle attackers to spoofservers via an arbitrary valid certificate."},]}

[0132] A failure retry mechanism is used during the data request process to avoid data acquisition failure due to a small probability of network problems.

[0133] 2. Reduce false positives and false negatives: In existing technologies, regular expressions are usually used to parse the version information of components / libraries. The disadvantage of this method is that if the regular expression is exhausted and multiple results are obtained or the result is not matched, the next vulnerability detection cannot be performed, which increases false positives and false negatives. In order to solve the problem of false positives and false negatives, this technology not only uses regular expressions to directly match version information, but also uses technology to reverse analyze components. Two core Python third-party libraries, r2pipe and qiling, are used here. Assume that the version number of the libcurl library needs to be parsed. The absolute path of the library file libcurl.so.4 in the firmware file system is " / path / to / libcurl.so.4". Then, r2=r2pipe.open(" / path / to / libcurl.so.4") is used to create an r2 session. Then, r2.cmd("aaa") is used to reverse analyze libcurl.so.4. Finally, r2.cmd("afl") is used to obtain all function names and addresses in libcurl.so.4. Among these function names, the keywords "version" and "curl" are matched at the same time to find the function "cur related to the libcurl version". l_version_info" and its address. There are two ways to get the version number. The program first uses r2pipe to use the izz instruction in the context of the function curl_version_info to get all the strings inside curl_version_info, and then uses a regular expression to match the version number. If it matches and only matches one result, it is considered that the version number is successfully obtained. Otherwise, the open source binary program analysis framework qiling is used to simulate the running of the libcurl library, and the instantiation object ql of Qiling is created through ql=Qiling(). The curl_version_info function is simulated and run through ql.run(begin="curl_version_info.address") to obtain the version information of the component.

[0134] Lack of automation and intelligence: This solution uses Python to write code to achieve automated workflow and intelligent decision-making. The first is automatic unpacking. The program automatically selects the correct firmware unpacking method by judging the file type of the firmware package. When the firmware format is bin, binwalk is called for unpacking. When the firmware format is img, the mounting method is used to achieve automatic unpacking. The second point is to distinguish between open source libraries and closed source libraries (SDK or link library provided by the supplier). This system is designed to detect CVE vulnerabilities in open source components or libraries. How to find open source libraries in numerous component libraries is crucial. First, parse each lib library in the lib directory and use strings to obtain all strings of the lib library. Among them, open source lib libraries will follow a certain open source protocol. Common open source protocols include GNU, MIT, Apache, BSD, GPL v3, etc., and determine whether it is an open source library by looking for content related to the open source protocol in the string; through Python's rich libraries and frameworks, it is easy to process large amounts of data, implement complex algorithms, and perform advanced data analysis. Radare2 and Qiling are both open source reverse analysis frameworks suitable for binary file analysis. By using Radare2 and Qiling, the analysis process of binary files can be automated and the level of intelligence of the analysis can be improved. Binary reverse analysis is a process of converting from machine language back to high-level language to understand and analyze the internal structure and functions of software. Using binary reverse analysis technology, the version information of the target binary file is automatically extracted and analyzed to improve the accuracy and intelligence of the analysis. By integrating these technologies and tools, this patent can achieve a more efficient and intelligent firmware and binary component analysis process, improve the degree of automation, reduce manual intervention, and provide more accurate results.

[0135] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0136] In the several embodiments provided in the present application, it should be understood that the disclosed methods and systems can be implemented in other ways. For example, the division of the units described above is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The above-mentioned units may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0137] 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 replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.

[0138] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting CVE vulnerabilities in open source components in a firmware file system, characterized in that: include: S1. Automatic identification and unpacking of firmware type to obtain the complete firmware file system; S2, preset program traverses the file system from the root directory, searches and records all ELFs, and the ELFs are in executable and linkable formats; S3, using a preset program to parse out the version information of each component or library in the firmware; S4. According to the name and version information of the acquired component or library, the preset program queries the corresponding CPE information through NVD, where NVD is a network vulnerability database and CPE is a general platform enumeration; S5. Search for vulnerability data in the local database based on the CPE information and make a judgment based on the preset decision conditions; S6. The preset program queries corresponding vulnerability data through interaction with NVD according to the CPE information of the component or library; S7, the preset program writes the CPE information and corresponding vulnerability data retrieved from the NVD into the local database; S8. The preset program generates a detection report based on the queried vulnerability data; In step S1, a machine learning model is used to classify and train different firmware types to improve recognition accuracy. At the same time, an unpacking tool library is established to automatically select appropriate tools for unpacking according to the firmware type to ensure that all contents of the firmware can be accessed, including: C1. Data collection and preprocessing: used to collect different types of firmware samples, preprocess the firmware samples, and extract features, as follows: Combining SVM and neural network, using SVM for basic classification and neural network to further handle edge cases: where αi is the Lagrange multiplier, y i is the category label of the i-th training sample, <x,x i > for x and x i The inner product of x is the input vector, x i is the i-th support vector; C2. Model training: Select support vector machine or deep neural network, use preprocessed firmware samples for model training, and adjust parameters until the preset recognition accuracy is achieved; C3, testing and optimization: Use firmware samples that have not participated in training to test the accuracy of the model, and further optimize the model based on the test results; C4, integrated unpacking tool library: collect and integrate various firmware unpacking tools; C5. Automated unpacking process: Automatically select and apply the most appropriate unpacking tool based on the firmware type identified by the machine learning model to ensure full access to the firmware content; C6, System deployment and monitoring: Deploy the trained model and unpacking tool library to the actual vulnerability detection system, and regularly monitor its performance to ensure efficient and accurate identification and unpacking of firmware; In step S1, for different types of firmware, Binwalk is used to extract the file system embedded in the firmware, and mount is used to mount the file system as an accessible directory; In step S3, the version information parsing method includes: Extract version information by analyzing specific sections or other metadata of ELF files; In step S3, the steps of using the deep learning algorithm to identify the version information of the component or library are as follows: if the corresponding vulnerability data is found in the local database, the data is directly used, otherwise the subsequent steps S6 and S7 are executed; In step S8, the detection report includes version information of each component identified, corresponding CPE information, detected vulnerabilities and their descriptions; in, In step S3, the version information of the component or library is identified from various files and configurations of the firmware using a deep learning algorithm. The steps of identifying the version information of the component or library using a deep learning algorithm are as follows: Dataset construction: Collect firmware files and configuration information containing rich component version information to build a diverse training dataset. The specific implementation process includes: Construct a dataset containing rich component version information and use the preset data enhancement method to increase the generalization ability of the model. The data enhancement method includes the following steps: A1. Use random perturbation methods, including random noise injection, random cropping, and rotation, combined with data enhancement techniques in natural language processing to apply to text data in firmware; A2. Apply randomly selected perturbations to each sample, including random cropping of firmware files: x′=x[start:end]+∈, where x′ is the enhanced sample, x is the original sample, and ∈ is a small random noise; A3. Perform standardization on the enhanced data to ensure data consistency, expand the original data set, and combine the original and enhanced data for model training; A4. Train the model on the expanded dataset and use cross-validation to evaluate the performance of the model on the augmented data. Feature extraction and preprocessing: preprocess the collected data to extract key features, including file header information, specific strings, and configuration file contents; Among them, extracting key features through deep learning models to improve model efficiency and accuracy includes the following steps: B1. Design CNN architecture: Multi-layer convolution layer design is used to extract hierarchical features of firmware data, and sparse connections and separable convolutions are introduced to reduce the number of parameters and improve computational efficiency; B2. Use activation functions and normalization techniques: Introduce a new activation function, f(x) = x·σ(βx), where σ is the sigmoid function and β is a learnable parameter. Use batch normalization or layer normalization to speed up training and reduce internal covariate shift. B3. Model training and optimization: Use Adam or RMSprop optimizer for model training, and apply Dropout and L2 regularization to avoid overfitting; B4. Feature fusion and attention mechanism: Fusion of features at different levels, using attention mechanism to focus on key information. Where Q, K, and V are query, key, and value respectively. k is the dimension of the key; B5. Performance evaluation and optimization: Evaluate model performance on the test set and further adjust model structure and parameters based on the test results; Model selection and training: Select appropriate deep learning models, including convolutional neural networks, and train them using prepared datasets until the model can accurately identify version information of different components; Testing and optimization: Use unseen data to test the accuracy of the model, and adjust and optimize the model based on the test results; Integration into vulnerability detection system: Integrate the trained model into the existing firmware vulnerability detection system to automatically identify component or library version information in the firmware; Continuous update and maintenance: Regularly update the training data set to incorporate new components and version information to ensure the continued accuracy and effectiveness of the model; In step S5, a local database containing extensive CVE data is established and regularly synchronized with the external database through automated scripts to ensure the data is up-to-date; at the same time, an efficient query algorithm is designed to quickly find relevant vulnerability information from a large amount of data; The steps for designing an efficient vulnerability information query algorithm are as follows: Demand analysis and planning: Analyze the specific requirements for querying vulnerability information, including query speed, data volume, and update frequency, and formulate a detailed implementation plan accordingly; Algorithm design: Design efficient query algorithms, including: Design a query algorithm based on graph theory, combining breadth-first search and Dijkstra algorithm to optimize the retrieval path: d[υ]=min(d[υ], d[u]+w(u,υ)), where d[υ] is the shortest path length from the source point to point v; Database optimization: Optimize database design, including using appropriate data models and storage structures to ensure efficient data access; Implementation and testing: Implement the designed query algorithm and test it on the actual database to evaluate the query efficiency and accuracy; Integration and optimization: Integrate the query algorithm into the vulnerability detection system and make optimization adjustments based on the actual operation situation; System monitoring and maintenance: Regularly monitor system performance to ensure that query algorithms can run stably in a big data environment, and perform maintenance and upgrades as needed.

2. An electronic device, comprising a processor and a memory connected to the processor for storing instructions executable by the processor, characterized in that: The processor is used to execute the open source component CVE vulnerability detection method in the firmware file system described in claim 1 above.

3. A server, characterized in that: It includes at least one processor and a memory that is communicatively connected to the processor, wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the processor so that the at least one processor executes the open source component CVE vulnerability detection method in the firmware file system as described in claim 1.

4. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for detecting CVE vulnerabilities of open source components in a firmware file system according to claim 1 is implemented.

Citation Information

Patent Citations

  • Firmware type identification method, intelligent terminal and computer readable storage medium

    CN112527744A

  • Vulnerability detection method and system for Internet of Things equipment firmware

    CN112685746A

  • Open source component vulnerability detection method in PHP project

    CN113065137A

  • Multi-label microblog text classification method based on semi-supervised learning

    CN113254599A

  • Cross-framework automatic detection method and system for third-party component and security risk thereof

    CN113821804A

Cited By

  • Automated firmware analysis and reporting tool

    US20250238515A1