Skip to main content
QUICK REVIEW

[Paper Review] VulLibGen: Generating Names of Vulnerability-Affected Packages via a Large Language Model

Tianyu Chen, Lin Li|arXiv (Cornell University)|Aug 9, 2023
Web Application Security VulnerabilitiesComputer Science3 citations
TL;DR

VulLibGen is the first generative approach that uses fine-tuned large language models (LLMs) to automatically generate accurate lists of vulnerable third-party libraries from vulnerability descriptions alone. By leveraging LLMs' prior knowledge of library functionalities and using input augmentation and post-processing, it achieves an F1 score of 0.626—outperforming state-of-the-art methods by 10% on average and improving zero-shot library detection by 39%.

ABSTRACT

Security practitioners maintain vulnerability reports (e.g., GitHub Advisory) to help developers mitigate security risks. An important task for these databases is automatically extracting structured information mentioned in the report, e.g., the affected software packages, to accelerate the defense of the vulnerability ecosystem. However, it is challenging for existing work on affected package identification to achieve a high accuracy. One reason is that all existing work focuses on relatively smaller models, thus they cannot harness the knowledge and semantic capabilities of large language models. To address this limitation, we propose VulLibGen, the first method to use LLM for affected package identification. In contrast to existing work, VulLibGen proposes the novel idea to directly generate the affected package. To improve the accuracy, VulLibGen employs supervised fine-tuning (SFT), retrieval augmented generation (RAG) and a local search algorithm. The local search algorithm is a novel postprocessing algorithm we introduce for reducing the hallucination of the generated packages. Our evaluation results show that VulLibGen has an average accuracy of 0.806 for identifying vulnerable packages in the four most popular ecosystems in GitHub Advisory (Java, JS, Python, Go) while the best average accuracy in previous work is 0.721. Additionally, VulLibGen has high value to security practice: we submitted 60 pairs to GitHub Advisory (covers four ecosystems). 34 of them have been accepted and merged and 20 are pending approval. Our code and dataset can be found in the attachments.

Motivation & Objective

  • Address the critical problem that 53.3% of NVD vulnerability reports lack any mention of affected libraries, and 59.82% of included lists are incomplete or incorrect.
  • Overcome limitations of existing NER, XML, and entity-linking approaches that struggle with false positives, false negatives, and high computational costs when scaling to large library repositories.
  • Enable accurate identification of vulnerable libraries—especially zero-shot libraries not seen during training—using LLMs' prior knowledge of library semantics and structure.
  • Reduce reliance on expensive library matching or TF-IDF filtering by leveraging generative LLMs to directly predict library names from vulnerability descriptions.
  • Improve reliability and precision of library vulnerability identification through post-processing to correct hallucinations and input augmentation to enhance zero-shot detection.

Proposed method

  • Fine-tune a pre-trained LLaMA model on the Maven corpus in an unsupervised manner to enable it to map library descriptions to their corresponding library names, activating prior knowledge of library identities.
  • Perform supervised fine-tuning on labeled vulnerability datasets where the input is a vulnerability description and the output is the ground-truth list of affected libraries, enabling the model to generate accurate name lists.
  • Apply input augmentation by rephrasing or paraphrasing vulnerability descriptions to expose the model to diverse phrasings, improving generalization to zero-shot libraries not present in the training data.
  • Introduce a post-processing module that filters and corrects LLM-generated library lists using a curated library name dictionary and syntactic/semantic validation to reduce hallucinations.
  • Leverage the LLM’s in-context reasoning to correlate vulnerability characteristics (e.g., memory corruption, authentication bypass) with library functionalities and known vulnerabilities.
  • Use a two-stage training pipeline: first unsupervised pre-training on library descriptions to learn library identity, then supervised fine-tuning on vulnerability-description-to-library-list pairs to learn vulnerability-specific generation.

Experimental results

Research questions

  • RQ1Can a large language model generate accurate, complete, and correct lists of vulnerable third-party libraries solely from vulnerability descriptions, without requiring library name dictionaries or external matching?
  • RQ2How effective is the proposed input augmentation technique in improving the identification of zero-shot vulnerable libraries not seen during training?
  • RQ3To what extent does the post-processing technique reduce hallucinations in LLM-generated library lists and improve precision?
  • RQ4How does VulLibGen compare in performance to state-of-the-art approaches (e.g., LightXML, Chronos, VulLibMiner) in identifying vulnerable libraries on real-world datasets?
  • RQ5Can LLMs with prior knowledge of libraries outperform traditional NLP and deep learning models in vulnerability library identification tasks?

Key findings

  • VulLibGen achieves an average F1 score of 0.626 in identifying vulnerable libraries, outperforming state-of-the-art approaches (LightXML, Chronos, VulLibMiner), which achieve only 0.561 on average.
  • The post-processing technique improves F1@1 by 9.3% on average, significantly reducing false positives caused by LLM hallucinations.
  • The input augmentation technique boosts F1@1 performance by 39% on average when identifying zero-shot vulnerable libraries, demonstrating strong generalization to unseen libraries.
  • VulLibGen effectively identifies vulnerable libraries without relying on expensive TF-IDF filtering or library name dictionaries, reducing computational overhead compared to entity-linking methods.
  • The model’s performance is robust across diverse vulnerability types, including those involving complex library interactions or subtle functional differences.
  • The two-stage fine-tuning approach—unsupervised pre-training on library descriptions followed by supervised fine-tuning on vulnerability pairs—enables the LLM to learn both library identity and vulnerability-specific associations effectively.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.