A Deep Learning Method for Vulnerability Normalization with Joint Entity Extraction
Through deep learning algorithms, the similarity between vulnerability description information and entity word lists is calculated, combined with sorting and threshold filtering, the problems of high false alarm rate and low efficiency in the existing technology are solved, and the vulnerability consistency of high accuracy and high efficiency are achieved Method of transformation.
Patent Information
- Application Number
- CN202410342072.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-25
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-03-25
AI Technical Summary
The existing vulnerability normalization methods rely on rule bases and manual features, resulting in high false positive rates and low efficiency, which cannot meet the growing demand for vulnerabilities.
Deep learning algorithms are used to collect vulnerability data disclosed on the Internet, build data sets, calculate the semantic similarity of vulnerability description information and the similarity of entity word list, and combine similarity sorting and threshold filtering to achieve vulnerability normalization.
It improves the accuracy of vulnerability normalization, reduces the false alarm rate, and realizes vulnerability management and library construction with high intelligence and high efficiency.
Smart Images

Figure CN118260764B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of vulnerability management, and in particular relates to a vulnerability normalization deep learning method for joint entity extraction. Background Art
[0002] Vulnerability scanning systems emerge in an endless stream, and the vulnerability libraries of various systems are also different. Most vulnerabilities have unified vulnerability numbers, such as CVE, CWE, CNVD, CNNVD, etc., but there are also a certain number of vulnerabilities that do not have unified vulnerability numbers, such as Redis weak password, Mysql weak password, etc. Because the vulnerability description information is unstructured natural language, when security assessors integrate different vulnerability scanning data, they encounter problems such as low integration efficiency and inaccurate vulnerability statistics.
[0003] At present, a document on a device and method for normalizing data of a heterogeneous vulnerability scanner proposes that vulnerability normalization is performed by associating a rule base. This situation is heavily dependent on the rule base, which needs to be manually extracted and continuously updated, which is time-consuming and labor-intensive. A document on a method, device and equipment for deduplication of baseline scanning vulnerabilities based on cross-validation proposes that vulnerability normalization is performed by training a machine learning algorithm. This method relies on manual feature search and has problems such as high false alarm rate and low efficiency. It can no longer meet the normalization needs of the growing number of vulnerabilities. A more intelligent and efficient algorithm is urgently needed to solve the above problems. Summary of the invention
[0004] 1. Purpose of the invention
[0005] The purpose of the present invention is to provide a deep learning method for vulnerability normalization based on joint entity extraction, so as to solve the problems of high false alarm rate and low efficiency existing in vulnerability normalization methods based on rule base matching and artificial feature machine learning algorithms.
[0006] (II) Technical solution
[0007] The overall technical idea of the present invention is: first, to solve the training data required by the deep learning algorithm, it is necessary to collect public vulnerability data from the Internet; then, a deep learning algorithm is constructed, and the training data is used as input to train the deep learning algorithm model, and the cosine similarity of two vulnerabilities is calculated by the deep learning algorithm; in order to solve the false alarm problem that the vulnerability description information is similar but the vulnerabilities are not the same entity, the vulnerability entity word list is extracted, and the similarity of the two vulnerability entity word lists is calculated using the deep learning algorithm; finally, the vulnerability cosine similarity and the entity word list similarity are comprehensively considered to calculate the final similarity of the two vulnerabilities, and the normalized result is obtained based on the similarity sorting and threshold filtering method.
[0008] The specific steps include:
[0009] Step S1: In order to provide sufficient training data for the vulnerability normalization deep learning algorithm, the data set required by the algorithm is first constructed. Vulnerability data from different vulnerability scanning vendors are collected from the Internet, all vulnerability description information is sorted out, and vulnerabilities with the same vulnerability number are paired according to vulnerability numbers such as CVE, CNVD or CNNVD, and vulnerabilities with different vulnerability numbers are randomly paired to construct the data set required by the deep learning algorithm;
[0010] Step S2, the training data set is all unstructured natural language. In order to better understand these natural languages, a deep learning algorithm is constructed to vectorize the data set in step S1, obtain the semantic information of the vulnerability description in the vector space, and calculate the semantic similarity between two vulnerability description information;
[0011] Step S3: In order to solve the problem of false positives when the vulnerability description information is very similar but does not describe the same entity, the entity word list of the vulnerability description information is obtained by text segmentation and entity word filtering, and the similarity of the entity word lists of the two vulnerabilities is calculated using a deep learning algorithm;
[0012] Step S4: Comprehensively consider the semantic similarity of vulnerability descriptions and the similarity of vulnerability entity word lists, and by constructing a calculation formula, combine the results obtained in steps S2 and S3 to calculate the similarity between vulnerability texts, and obtain a normalized result based on the similarity sorting and threshold filtering method.
[0013] Preferably, in step S1, vulnerability data from different manufacturers collected from the Internet are classified into two categories, one of which is data containing vulnerability numbers such as CVE, CNVD or CNNVD, and the other is data that does not contain vulnerability numbers. Among them, the vulnerabilities containing numbers are sorted, and the vulnerability data with the same number from two different manufacturers are paired to form positive sample pairs in the data set, and the vulnerability data with different numbers from two different manufacturers are randomly paired to form negative sample pairs in the data set, and the ratio of positive samples to negative sample pairs is 1:1. Finally, the data set is divided into a training set, a validation set, and a test set in a ratio of 7:2:1.
[0014] Preferably, the training set is used for deep learning algorithm parameter training, the validation set is used for the optimal solution of the deep learning algorithm model, and the test set is used to test the effect of the deep learning algorithm.
[0015] Preferably, in step S2, constructing a deep learning algorithm mainly includes three steps:
[0016] Step 21: In the first step, BERT is selected as the basic precoding model, which can directly transform the vulnerability description information of the data set in step S1 into the vector space;
[0017] Step 22: Use the training set and validation set of the data set in step S1 as the input of the model in step 21. Based on step 21, further construct a fully connected layer, select the cosine distance as the similarity distance between the two vulnerability description information, and train the model to obtain a deep learning algorithm model based on the current data set.
[0018] Step 23: Use the test set of the data set in step S1 as the input of the model in step 22 to obtain the similarity distance between the two vulnerability description information in the test set;
[0019] Preferably, in step S3, it is further considered that the cosine similarity distances of some vulnerability description information are very close, but the vulnerabilities described therein may not be the same vulnerability entity, for example:
[0020] [Example 1] Redis weak passwords can be easily cracked by brute force. If there are users with weak passwords, they can log in to the Redis database with the weak passwords.
[0021] [Example 2] MySQL weak passwords can be easily cracked by brute force. If there are users with weak passwords, they can log in to the MySQL database with the weak passwords.
[0022] In the above examples, we can see that although both describe weak password vulnerabilities, the actual object entities they refer to are completely different. It is easy to make misjudgments based solely on text similarity. Therefore, it is necessary to extract the entity words in the vulnerability text and use the same deep learning algorithm structure as step 2 to train the vulnerability entity words and calculate the similarity of the two vulnerability entity word lists. Then use the similarity of the entity word lists as the second dimension of judgment criteria;
[0023] Preferably, in step S4, the cosine similarity and entity word similarity of the two vulnerabilities are comprehensively judged, the final similarity scores of the two vulnerabilities are calculated, and sorting or threshold filtering is performed based on the similarity to obtain the normalized results of the two vulnerabilities.
[0024] (III) Beneficial effects
[0025] The vulnerability normalization deep learning method provided by the present invention first collects the vulnerability data disclosed on the Internet and sorts out the data set required by the algorithm; further constructs a deep learning algorithm to calculate the similarity of two vulnerability description information, thereby solving the problems of high false alarm rate, low efficiency, and time-consuming and labor-intensive manual search for rules and features in machine learning algorithms based on rule matching and artificial features; further considering the problem that the similarity of some vulnerability description information is very high, but the description may not be the same vulnerability entity, constructs a vulnerability entity extraction method, and calculates the similarity of two vulnerability entity word lists, further improving the accuracy of vulnerability normalization; finally, comprehensively considers the similarity of vulnerability description and the similarity of vulnerability entity word lists to obtain the similarity of two vulnerabilities, and obtains the normalized result based on the method of similarity sorting and threshold filtering. The method has a high degree of intelligence and a low false alarm rate, and can play a vital role in vulnerability management and vulnerability library construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A flow chart of a vulnerability normalization deep learning method provided by an embodiment of the present invention;
[0027] Figure 2 Schematic diagram of the deep learning method for calculating the similarity of two vulnerability description information;
[0028] Figure 3 Schematic diagram of the deep learning method for calculating the similarity of two vulnerability entity word lists. DETAILED DESCRIPTION
[0029] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.
[0030] The present invention discloses a vulnerability normalization deep learning method for joint entity extraction. Figure 1 This is a flow chart of a vulnerability normalization deep learning method according to an embodiment of the present invention, the method comprising:
[0031] Step S1, collecting vulnerability data from different vulnerability scanning vendors on the Internet, sorting out all vulnerability description information, and pairing vulnerabilities with the same vulnerability number according to vulnerability numbers such as CVE, CNVD or CNNVD, and randomly pairing vulnerabilities with different vulnerability numbers to construct a data set required for a deep learning algorithm;
[0032] In the embodiment of the present invention, different vulnerability scanning vendors include well-known domestic and foreign security vendors such as NSFOCUS and Nessus, and vulnerability data is collected and sorted from their public vulnerability sites on the Internet.
[0033] First, the collected vulnerability data is classified into two categories: one is the vulnerabilities with vulnerability numbers such as CVE, CNVD or CNNVD, and the other is the vulnerabilities without vulnerability numbers. Among them, CVE, CNVD and CNNVD represent the numbers of security vulnerabilities in software, systems, devices, etc. released on the Internet. Because some security vulnerabilities are not included in the relevant vulnerability library, these vulnerabilities do not have a unified vulnerability number.
[0034] Secondly, a data set is constructed for all data with unified vulnerability numbers for training deep learning algorithms. The construction process is as follows:
[0035] Step S11: Pair all data with the same vulnerability number from different vulnerability vendors as positive samples and label them as 1;
[0036] Step S12: Pair all data with different vulnerability numbers and from different vulnerability vendors as negative samples and label them as 0;
[0037] Step S13: divide the data constructed in steps S11 and S12 into a training set, a validation set, and a test set in a ratio of 7:2:1.
[0038] For vulnerabilities without vulnerability numbers, they are used to manually verify the effect of the final model.
[0039] Step S2: construct a deep learning algorithm, vectorize the data set in step S1, obtain the semantic information of the vulnerability description in the vector space, and calculate the semantic similarity between two vulnerability description information;
[0040] In the embodiment of the present invention, constructing a deep learning algorithm and calculating the semantic similarity between two vulnerability description information mainly includes three parts, such as Figure 2 As shown:
[0041] Step S21, vectorize the sentence. Because the vulnerability description information is unstructured natural language, it needs to be converted into a vector space to facilitate semantic calculation. Therefore, in this part, the vulnerability description information is first preprocessed, mainly removing some special characters and then inputting it into the BERT model to convert all words into 384-dimensional vectors;
[0042] Step S22: construct two fully connected layers to further extract the semantic features of the two sentences. In this part, the fully connected layer mainly further strengthens the correlation characteristics between the two semantics based on step S21.
[0043] Step S23, selecting the cosine distance as the output of the model, and using the data set constructed in step S1 to train the model so that the model can obtain the optimal solution;
[0044] The cosine calculation formula for the similarity between two vulnerability descriptions is as follows:
[0045] ;
[0046] Among them, X represents the vector of the first vulnerability description information after passing through the fully connected layer, Y represents the vector of the second vulnerability description information after passing through the fully connected layer, and TextSimilarit(X,Y) represents the cosine similarity of the two vulnerability description information.
[0047] Step S3: Obtain an entity word list of vulnerability description information by means of text segmentation and entity word filtering, and calculate the similarity of the entity word lists of two vulnerabilities;
[0048] After analyzing the data set, it is found that most vulnerability entity words are composed of English. Therefore, in the embodiment of the present invention, all English parts in the vulnerability text are extracted, and after word segmentation, they are compared with the English entity library (where the English entity library has about 53,146 entities). Only words with entity meanings are retained as the entity word list of the vulnerability text. The main steps include:
[0049] Step S31, input vulnerability text;
[0050] Step S32, removing Chinese text by regular expression;
[0051] Step S33, segmenting the remaining English words;
[0052] Step S34: Filter using the English entity library to obtain a list of entity words of the vulnerability text;
[0053] Step S35: After obtaining the entity word list, the same deep learning algorithm model structure as in step S2 is used for training to obtain a deep learning algorithm model based on entity word similarity, such as Figure 3 As shown, the similarity of the two vulnerability entity word lists is calculated through the model. The calculation formula is as follows:
[0054] ;
[0055] Among them, X' represents the vector of the first vulnerability entity word list after passing through the fully connected layer, Y' represents the vector of the second vulnerability entity word list after passing through the fully connected layer, and EntitySimilarity (X',Y') represents the cosine similarity of the two vulnerability entity word lists.
[0056] Step S4: By constructing a calculation formula, the results obtained in steps S2 and S3 are combined to calculate the similarity between the vulnerability texts, and a normalized result is obtained based on a similarity sorting and threshold filtering method.
[0057] Through step S2 and step S3, the similarity scores of the two dimensions can be obtained. In the example of the present invention, the scores of the two dimensions are combined in a weighted manner to obtain the final similarity scores of the two vulnerability texts. The specific formula is as follows:
[0058] ;
[0059] in:
[0060] TextSimilarity(X,Y) represents the cosine similarity score of step S2, and EntitySimilarity(X',Y') represents the entity word list similarity score of step S3.
[0061] The above contents are further detailed descriptions of the present invention in combination with specific implementation methods, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A vulnerability normalization deep learning method for joint entity extraction, characterized in that: The following steps are involved: Step S1, constructing a data set required for a deep learning algorithm; Collect vulnerability data from different vulnerability scanning vendors on the Internet, organize all vulnerability description information, and pair vulnerabilities with the same vulnerability number according to CVE, CNVD or CNNVD vulnerability numbers, and randomly pair vulnerabilities with different vulnerability numbers to build the data set required for the deep learning algorithm; In step S1, the collection and organization of vulnerability data includes: First, the collected vulnerability data is classified into two categories: one is the vulnerabilities that include CVE, CNVD or CNNVD vulnerability numbers, and the other is the vulnerabilities that do not include vulnerability numbers; Secondly, a data set is constructed for all data with a unified vulnerability number for training the deep learning algorithm. The construction process of the data set is as follows: Step S11: Pair all data with the same vulnerability number from different vulnerability vendors as positive samples and label them as 1; Step S12: Pair all data with different vulnerability numbers and from different vulnerability vendors as negative samples and label them as 0; Step S13, dividing the data constructed in steps S11 and S12 into a training set, a validation set and a test set in a ratio of 7:2:1; For vulnerabilities without vulnerability numbers, they are used to manually verify the effect of the final model; Step S2, constructing a deep learning algorithm; Vectorizing the data set in step S1, obtaining semantic information of the vulnerability description in the vector space, and calculating the semantic similarity between two vulnerability description information; step S2, constructing a deep learning algorithm and calculating the semantic similarity between two vulnerability description information, comprises the following steps: S21, vectorize the sentence; The vulnerability description information is preprocessed to remove special characters, and then input into the BERT model to convert all words into 384-dimensional vectors; the BERT model represents a deep learning algorithm model that converts text into vectors and retains text context information; S22, constructing two fully connected layers to further extract semantic features of the two sentences; the fully connected layers represent mapping a certain spatial dimension to another spatial dimension; S23, select the cosine distance as the output of the model, and use the data set constructed in step S1 to train the model so that the model can obtain the optimal solution. The cosine formula is calculated as follows: Among them, X represents the vector of the first vulnerability description information after passing through the fully connected layer, Y represents the vector of the second vulnerability description information after passing through the fully connected layer, and TextSimilarit(X,Y) represents the cosine similarity of the two vulnerability description information; Step S3, calculating the similarity of the entity word lists of the two vulnerabilities; By using text segmentation and entity word filtering, we obtain the entity word list of the vulnerability description information, and calculate the similarity of the entity word lists of the two vulnerabilities. The specific implementation process of step S3 is as follows: extract all English parts in the vulnerability text, compare them with the English entity library after word segmentation, and only retain words with entity meaning as entity words of the vulnerability text, including the following steps: Step S31, input vulnerability text; Step S32, removing Chinese text by regular expression; Step S33, segmenting the remaining English words; Step S34: Filter using the English entity library to obtain a list of entity words of the vulnerability text; After obtaining the entity word list, the same deep learning algorithm model structure as in step S2 is used for training to obtain a deep learning algorithm model based on entity word similarity, and the similarity of the two vulnerability entity word lists is calculated through the model; Among them, X' represents the vector of the first vulnerability entity word list after passing through the fully connected layer, Y' represents the vector of the second vulnerability entity word list after passing through the fully connected layer, and EntitySimilarity(X',Y') represents the cosine similarity of the two vulnerability entity word lists; Step S4, obtaining a normalized result; By constructing a calculation formula, the results obtained in steps S2 and S3 are combined to calculate the similarity between the vulnerability texts. Based on the similarity sorting and threshold filtering method, the normalized result is obtained. The specific formula is as follows: Score=0.7*TextSimilarity(X,Y)+0.3*EntitySimilarity(X′,Y′)where: TextSimilarity(X,Y) represents the cosine similarity score of step S2, EntitySimilarity(X',Y') represents the similarity score of the entity word list in step S3.
2. According to claim 1, a vulnerability normalization deep learning method for joint entity extraction is characterized in that: In step S1, different vulnerability scanning vendors are NSFOCUS and Nessus security vendors, and vulnerability data is collected and sorted from their public vulnerability sites on the Internet.
Citation Information
Patent Citations
Data normalization processing apparatus and method for heterogeneous vulnerability scanner
CN106407813A
Vulnerability similarity comparison method and system based on text pre-training model
CN115563619A
