LLM-based open source vulnerability repair scheme generation method and system
By combining large language model technology with SCA tools and component official website information, an open source vulnerability repair solution is generated, which solves the shortcomings of SCA tools in compatibility description, improves development efficiency and security, adapts to the needs of different organizations, and reduces upgrades Version compatibility issues.
Patent Information
- Application Number
- CN202411023523.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-07-29
AI Technical Summary
The lack of compatibility descriptions in existing SCA scanning tools when dealing with the security of open source components, resulting in compatibility issues during the upgrade process, reducing development efficiency and system stability, and the cost of summarizing third-party component official websites is high and incomplete.
Combining large language model (LLM) technology with information from SCA tools and components official websites, it provides a method to generate open source vulnerability repair solutions, including data collection, preprocessing, model training and inference output layers, generating compatibility descriptions and customized repairs Requirements, reduce compatibility issues in upgraded versions.
It realizes rapid and accurate acquisition of compatibility instructions, reduces the time for developers to manually search for compatibility information, improves development efficiency and code quality, enhances security protection capabilities, adapts to the needs of different organizations, and reduces the upgraded version of the application system adverse effects.
Smart Images

Figure CN119089446A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, system, electronic device, readable storage medium and program product for generating an open source vulnerability repair solution based on LLM. Background Art
[0002] Prior art CN 117032782 A discloses a software security version identification method, system and processing equipment based on SCA, which relates to the field of software security technology and solves the technical problem that existing SCA tools are difficult to quickly and accurately identify security versions from multiple versions of a software package, thereby reducing development efficiency. Specifically, the method includes obtaining the version numbers of all public versions of the target software to obtain a version data set; sorting all versions of the target software according to preset rules to obtain a version sequence set; analyzing the component data of each public version through SCA, and obtaining the vulnerability data of the component data, correlating and matching the version sequence set, component data, and vulnerability data to obtain a vulnerable version affected by the vulnerability in the version sequence set; adding marking information to the vulnerable version, and treating the unmarked version as a secure version.
[0003] The repair solutions provided by SCA scanning tools are all to upgrade third-party components to safe versions, and generally lack descriptions on component upgrade compatibility. The occurrence of compatibility issues will cause application system operation abnormalities, making upgrading open source component vulnerabilities a problem for developers. Only the official website of third-party components will have compatibility descriptions, but for SCA scanning tools, there are many sources of component official websites, and summarizing them requires a lot of cost, and cannot guarantee comprehensiveness and timeliness. Summary of the invention
[0004] In order to solve the shortcomings of the existing technology in dealing with the security of open source components, the present invention cleverly uses the large language model (LLM) technology. By deeply integrating the existing software component analysis (SCA) tool with the compatibility description information of the official website of each component, the present invention provides a comprehensive and efficient open source vulnerability repair solution output method.
[0005] This method not only outputs unified fixes for detected open source vulnerabilities, but also provides a detailed set of upgrade versions and compatibility descriptions between versions. This means that developers no longer need to spend a lot of time and energy manually searching, comparing, and verifying the compatibility information of different versions; instead, they can directly obtain accurate and reliable compatibility descriptions from the system, allowing them to make decisions faster and more accurately.
[0006] In addition, the method of the present invention is highly flexible and customizable. It can flexibly combine customized repair solutions within an organization according to the specific needs and internal standards of the organization. This flexibility enables the method to better adapt to the actual conditions of different organizations and reduce the adverse effects that the compatibility issues of the upgraded versions may have on the application system.
[0007] In addition, the method of the present invention can be easily applied to the development platform within the organization to achieve flexible access. Whether integrated into the existing development environment or used as an independent tool, it can provide developers with convenient and efficient security support. This not only helps to improve development efficiency and code quality, but also significantly enhances the security protection capabilities of the organization.
[0008] To achieve the above objectives, the technical solutions adopted by the present invention include:
[0009] A method for generating an open source vulnerability repair solution based on LLM, characterized by comprising:
[0010] S1. Collect SCA scan results, real-time component official documentation information, and historical repair cases within the organization;
[0011] S2. Clean, format and annotate the collected data to meet the input requirements of LLM;
[0012] S3. Training using LLM includes a pre-training phase and a fine-tuning phase; wherein the pre-training phase uses the SCA scan results and the real-time component official document information to train the model; and the fine-tuning phase uses historical repair cases within the organization to further train the model;
[0013] S4. After the training is completed, LLM generates a recommended version with compatibility instructions and customized repair requirements based on the new round of SCA scanning results, and pushes the recommended version generated by LLM to developers in a friendly manner for selection and application.
[0014] Furthermore, the S3 utilizes LLM to perform training in a set fixed period cycle.
[0015] Furthermore, the recommended version in S4 includes a set of upgraded versions and compatibility descriptions between the versions.
[0016] Furthermore, the method also includes docking the SCA scanning tool with the devsecops process.
[0017] Furthermore, the method also includes integrating the method into a development environment, inputting component information and outputting development vulnerability information.
[0018] Furthermore, the output development vulnerability information includes but is not limited to the impact scope of the vulnerability and known attack vectors.
[0019] The present invention also provides a system for generating an open source vulnerability repair solution based on LLM, characterized in that it includes a data collection layer, a preprocessing layer, a model training layer, and an inference output layer, wherein the data collection layer is used to collect SCA scanning results, real-time component official document information, and historical repair cases within the organization;
[0020] The preprocessing layer is used to clean, format and annotate the collected data to meet the input requirements of LLM;
[0021] The model training layer is used for training using LLM, including a pre-training stage and a fine-tuning stage; wherein the pre-training stage uses the SCA scan results and the component official document information to train the model; and the fine-tuning stage uses historical repair cases within the organization to further train the model;
[0022] The reasoning output layer is used to generate a recommended version with compatibility descriptions and customized repair requirements based on the new round of SCA scan results after the LLM training is completed, and push the recommended version generated by the LLM to developers in a friendly manner for selection and application.
[0023] The present invention also provides a computer-readable storage medium, characterized in that a readable computer program is stored on the storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
[0024] The present invention also provides an electronic device, characterized in that it includes a processor and a memory;
[0025] The memory is used to store computer programs;
[0026] The processor is configured to execute the method according to any one of claims 1 to 6 by calling a stored computer program.
[0027] The present invention also relates to a computer program product, comprising a computer program and / or instructions, characterized in that the computer program and / or instructions implement the steps of the above method when executed by a processor.
[0028] The beneficial effects of the present invention are as follows: the present invention uses LLM technology, combines existing SCA tools with compatibility description information on the official websites of each component, and uniformly outputs open source vulnerability repair solutions (including upgrade version sets and compatibility descriptions between versions). It can also flexibly combine customized repair solutions within the organization to reduce the adverse effects of compatibility issues of upgraded versions on application systems. Moreover, this method can be applied to development platforms within an organization and can achieve flexible access. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 The present invention is a flowchart of a method for generating an open source vulnerability repair solution based on LLM.
[0030] Figure 2 This is a schematic diagram of the structure of a system for generating an open source vulnerability repair solution based on LLM in the present invention. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0032] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0033] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0034] The first aspect of the present invention relates to a method for generating an open source vulnerability repair solution based on LLM. Figure 1 As shown, including:
[0035] S1. Collect SCA scan results, real-time component official documentation information, and historical repair cases within the organization;
[0036] Specifically, in this step, the main work is to collect data. First, scan the software project through the SCA (Software Composition Analysis) tool to collect information about open source components, their versions, known vulnerabilities, etc. At the same time, obtain the latest information about these components from the official website or documentation of the components, especially those related to compatibility, updates, and fixes. In addition, it is necessary to collect historical repair cases from within the organization, which may contain previously encountered security issues and their solutions. Through this step, a comprehensive and up-to-date dataset can be established to provide a basis for subsequent training and recommendations.
[0037] S2. Clean, format and annotate the collected data to meet the input requirements of LLM;
[0038] Specifically, the collected raw data needs to be processed. Data cleaning is to remove duplicate, erroneous or incomplete data. Formatting is to convert the data into a format acceptable to LLM (Large Language Model), such as a specific text structure or encoding method. Annotation is to add additional information to the data, such as classification labels, keywords, etc., to help LLM better understand and process the data. The processed data is of higher quality and more suitable for training LLM, thereby improving the accuracy and effectiveness of subsequent recommendations.
[0039] S3. Training using LLM includes a pre-training phase and a fine-tuning phase; wherein the pre-training phase uses the SCA scan results and the real-time component official document information to train the model; and the fine-tuning phase uses historical repair cases within the organization to further train the model;
[0040] Specifically, LLM is used for two stages of training. The pre-training stage mainly uses SCA scan results and real-time component official documentation information to train the model so that it can understand and analyze this data. The fine-tuning stage uses historical repair cases within the organization to further train the model so that it can more accurately generate recommendations based on the organization's actual situation and needs. Through these two stages of training, LLM can better understand the security issues of open source components and the specific needs of the organization, thereby generating more accurate and practical recommendations.
[0041] S4. After the training is completed, LLM generates a recommended version with compatibility instructions and customized repair requirements based on the new round of SCA scanning results, and pushes the recommended version generated by LLM to developers in a friendly manner for selection and application.
[0042] Specifically, in this step, the trained LLM will generate recommendations based on the latest SCA scan results. These recommendations not only include possible fixes, but also come with instructions on compatibility and fix requirements customized according to the organization's internal needs. These recommendations will then be presented to developers in an easy-to-understand and easy-to-operate manner for them to choose and apply. Developers can obtain information and fixes about the security of open source components more conveniently and quickly, thereby improving development efficiency and code security. At the same time, because the recommendations are generated based on the actual situation and needs of the organization, they are more practical and targeted.
[0043] The present application also provides an implementation manner, wherein S3 utilizes LLM to perform training in a set fixed period cycle.
[0044] Specifically, in step S3, the training process using LLM (Large Language Model) is not a one-time process, but a cycle within a set fixed period. This means that the model is retrained regularly to adapt to new data and situations. Through regular cycle training, LLM can continue to learn and adapt to new data, thereby improving its accuracy and performance. This is particularly important for dealing with the ever-changing security issues of open source components, as new vulnerabilities and fixes continue to emerge.
[0045] The present application also provides an implementation manner, wherein the recommended version in S4 includes an upgraded version set and a compatibility description between each version.
[0046] Specifically, the recommended versions generated in step S4 not only include possible upgrade versions, but also provide compatibility descriptions between these versions. This means that developers can clearly understand the compatibility relationship between different versions and the impact that upgrading to a certain version may have on other components or the entire system. Providing compatibility descriptions can help developers more comprehensively evaluate the risks and costs of upgrades and make more informed decisions. This helps reduce problems caused by version incompatibility and improves system stability and security.
[0047] The present application also provides an implementation manner, wherein the method further comprises connecting the SCA scanning tool with the devsecops process.
[0048] Specifically, the method also includes docking the SCA (Software Composition Analysis) scanning tool with the DevSecOps process. This means that the results of the SCA scan can be directly input into the DevSecOps process and integrated with other security and development activities. By docking the SCA scanning tool with the DevSecOps process, early discovery and repair of security vulnerabilities can be achieved, improving security and efficiency in the development process. This helps reduce the cost and risk of later repairs and speeds up software delivery.
[0049] The present application also provides an implementation mode, wherein the method further comprises integrating the method into a development environment, inputting component information and outputting development vulnerability information.
[0050] Specifically, the method can be integrated into the development environment, allowing developers to directly input component information and receive development vulnerability information about these components as output. By integrating into the development environment, the method can provide developers with real-time security feedback, helping them to find and fix vulnerabilities in a timely manner during the development process. This helps improve the quality and security of the code and reduce potential security risks.
[0051] The present application also provides an implementation manner, wherein the output development vulnerability information includes but is not limited to the impact scope of the vulnerability and known attack vectors.
[0052] Specifically, the output development vulnerability information includes details such as the scope of the vulnerability and known attack vectors. This information can help developers more fully understand the nature and potential risks of the vulnerability. Providing detailed vulnerability information allows developers to more accurately assess the severity and priority of the vulnerability, thereby developing more effective remediation strategies. This helps speed up the remediation of vulnerabilities and improve the overall security of the system.
[0053] Another aspect of the present invention also relates to a system for generating an open source vulnerability repair solution based on LLM, the structure of which is as follows: Figure 2 As shown, including:
[0054] Data collection layer, preprocessing layer, model training layer, inference output layer, among which,
[0055] The data collection layer is used to collect SCA scan results, real-time component official documentation information, and historical repair cases within the organization;
[0056] The preprocessing layer is used to clean, format and annotate the collected data to meet the input requirements of LLM;
[0057] The model training layer is used for training using LLM, including a pre-training stage and a fine-tuning stage; wherein the pre-training stage uses the SCA scan results and the component official document information to train the model; and the fine-tuning stage uses historical repair cases within the organization to further train the model;
[0058] The reasoning output layer is used to generate a recommended version with compatibility descriptions and customized repair requirements based on the new round of SCA scan results after the LLM training is completed, and push the recommended version generated by the LLM to developers in a friendly manner for selection and application.
[0059] By using this system, the above-mentioned operation processing method can be executed and the corresponding technical effects can be achieved.
[0060] An embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps in the method in the above embodiment, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all the steps in the method in the above embodiment are implemented.
[0061] An embodiment of the present invention also provides an electronic device for executing the above method. As an implementation device of the method, the electronic device has at least a processor and a memory, and in particular, the memory stores data and related computer programs required for executing the method, such as storing model program software based on LLM training, etc., and the processor calls the data and program in the memory to execute all the steps of the implementation method and obtains the corresponding technical effect.
[0062] Preferably, the electronic device may include a bus architecture, the bus may include any number of interconnected buses and bridges, and the bus will include various circuits linked together by one or more processors and memories. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are all well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and transmitter may be the same component, i.e., a transceiver, providing a unit for communicating with various other systems over a transmission medium. The processor is responsible for managing the bus and general processing, while the memory may be used to store data used by the processor when performing operations.
[0063] In addition, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, and a power supply. The processor (or controller, operation control) used may include a microprocessor or other processor device and / or a logic device, which receives input and controls the operation of various components of the electronic device; the memory may be one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices, which may store the above-mentioned related data information, and may also store a program for executing related information, and the processor may execute the program stored in the memory to realize information storage or processing, etc.; the input unit is used to provide input to the processor, for example, it may be a key or a touch input device; the power supply is used to provide power to the electronic device; the display is used to display display objects such as images and text, for example, it may be an LCD display. The communication module is a transmitter / receiver that sends and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal. Based on different communication technologies, multiple communication modules may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless local area network module, etc. The communication module (transmitter / receiver) is also coupled to a speaker and a microphone via an audio processor to provide an audio output via the speaker and receive an audio input from the microphone, thereby realizing a common telecommunication function. The audio processor may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor is also coupled to a central processor, so that recording can be performed on the machine through the microphone, and the sound stored on the machine can be played through the speaker.
[0064] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0065] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or boxes.
[0066] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0067] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in a box or multiple boxes. Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0068] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for generating an open source vulnerability repair solution based on LLM, characterized in that: include: S1. Collect SCA scan results, real-time component official documentation information, and historical repair cases within the organization; S2. Clean, format and annotate the collected data to meet the input requirements of LLM; S3. Training using LLM, Including, pre-training stage and fine-tuning stage; The pre-training stage uses the SCA scan results and the real-time component official document information to train the model; the fine-tuning stage uses historical repair cases within the organization to further train the model; S4. After the training is completed, LLM generates a recommended version with compatibility instructions and customized repair requirements based on the new round of SCA scanning results, and pushes the recommended version generated by LLM to developers in a friendly manner for selection and application.
2. The method according to claim 1, characterized in that The S3 utilizes LLM to perform training in a set fixed period cycle.
3. The method according to claim 2, characterized in that: The recommended versions in S4 include an upgraded version set and compatibility descriptions between the versions.
4. The method according to claim 3, characterized in that The method also includes docking the SCA scanning tool with the devsecops process.
5. The method according to claim 4, characterized in that The method also includes integrating the method into a development environment, inputting component information and outputting development vulnerability information.
6. The method according to claim 5, characterized in that The output development vulnerability information includes but is not limited to the impact scope of the vulnerability and known attack vectors.
7. A multi-party real-time reconciliation system based on a message queue, characterized in that: It includes data collection layer, preprocessing layer, model training layer, and inference output layer, among which, The data collection layer is used to collect SCA scan results, real-time component official document information, and historical repair cases within the organization; The preprocessing layer is used to clean, format and annotate the collected data to meet the input requirements of LLM; The model training layer is used for training using LLM, including a pre-training stage and a fine-tuning stage; wherein the pre-training stage uses the SCA scan results and the component official document information to train the model; and the fine-tuning stage uses historical repair cases within the organization to further train the model; The reasoning output layer is used to generate a recommended version with compatibility descriptions and customized repair requirements based on the new round of SCA scan results after the LLM training is completed, and push the recommended version generated by the LLM to developers in a friendly manner for selection and application.
8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 6 by calling a stored computer program.
10. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method and device for analyzing compatibility among versions of open source component, equipment and medium
CN117170729A
LLM-based ASOC vulnerability assessment method, apparatus and device, and medium
CN118395457A
Remote Embedded Device Update Platform Apparatuses, Methods and Systems
US20160117162A1
Cited By
Method and system for generating open source component repair opinions and storage medium
CN120611388A
