Manuscript Offprint

arXiv:2609.01187

Athena: Vulnerability-Affected Library Identification via Knowledge Graph Completion

Phong Trinh Duy, Trang Dang Yen, Hung Nguyen-Huu, Bach Le, Quyet-Thang Huynh, Dieu Hoang Vu, David Lo, Thanh Le-Cong

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

A single vulnerability in a widely used library can cascade through millions of dependent applications, yet more than half of vulnerability database entries contain missing or incorrect affected-library information. Existing automated approaches neglect the relational structure of vulnerability databases, treating identification as an isolated text retrieval problem. In this paper, we propose Athena, the first graph-based approach for vulnerability-affected library identification. Athena models vulnerability databases as a knowledge graph and reformulates the identification problem as knowledge graph completion (KGC). It comprises three key modules: a Modeling module that constructs a security knowledge graph integrating CVEs, libraries, CWE weakness types, CPE products, and software ecosystems; a Completion module that applies a modular KGC backbone to predict missing affected libraries for a given CVE via link prediction; and a Re-ranking module that retrieves KGC candidates and rescores them using a fine-tuned LLM augmented with knowledge graph embeddings, jointly leveraging structural and textual information. Our experiments on VulLib demonstrate that Athena significantly outperforms four state-of-the-art baselines, achieving a 32% improvement in Avg. F1 over the best baseline (i.e., VulLibGen). Notably, our KGC backbone with only 110M parameters already surpasses VulLibGen's best configuration at 7B parameters, demonstrating the effectiveness of graph-based modeling; the re-ranking module then provides substantial further gains, consistently outperforming the best baseline across all evaluated LLM backbones.

1 Introduction

The software supply chain has become a primary attack vector in modern cybersecurity. When a vulnerability is reported, security vendors such as

Snyk (Snyk Ltd., 2026) and Veracode (Veracode, Inc., 2026), and community-maintained databases such as the National Vulnerability Database (NVD) (National Institute of Standards and Technology, 2026) and GitHub Advisory (GitHub, Inc., 2026), must quickly determine which specific libraries are affected so that Software Composition Analysis (SCA) tools can alert the developers whose dependencies are at risk. Yet this identification step remains heavily manual, slow, and error-prone: existing studies have shown that more than half of vulnerability database entries contain missing or incorrect affected-library fields (Chen et al., 2020b; Haryono et al., 2022; Nguyen et al., 2025c,d), leaving developers exposed to threats that have already been publicly disclosed.

This problem has motivated a growing body of research on automated vulnerability-affected library identification, with existing approaches falling into three paradigms. Early works (Chen et al., 2020b; Haryono et al., 2022; Lyu et al., 2023) framed the problem as an extreme multi-label learning task, predicting affected library identifiers from a predefined label space given CVE report text, treating each library as an opaque label and each CVE as an isolated document. Subsequent approaches moved toward semantic matching: VulLibMiner (Chen et al., 2025) jointly encodes vulnerability and library descriptions to score candidates via similarity, while VulLibGen (Chen et al., 2024) and LibAlarm (Xu et al., 2025) fine-tune LLMs to directly generate affected package names from CVE descriptions.

Despite this progress, existing works rely on a common assumption: the information needed to identify affected libraries is fully contained in the text of vulnerability reports and library descriptions. This assumption gives rise to a core limitation: existing approaches overlook the rich relational structure present in vulnerability databases. In practice, a vulnerability database is not only a collection of

*Corresponding author: thanghq@soict.hust.edu.vn documents but also a network of interconnected entities. A CVE is associated with a weakness type (CWE), affects one or more libraries, targets a specific ecosystem, and may share characteristics with related CVEs. A library belongs to an ecosystem, may be depended upon by other libraries, and may have been affected by prior vulnerabilities of the same weakness class. These relational signals, e.g., the historical vulnerability profile of a library, or the co-occurrence of libraries across similar CVEs, are entirely invisible to text-based approaches, yet constitute strong predictive evidence for identifying newly affected libraries.

To address this limitation, we propose Athena, the first graph-based approach for vulnerability-affected library identification. Athena models vulnerability databases as a knowledge graph and reformulates the identification problem as knowledge graph completion (KGC). The key idea is that modeling the problem as KGC enables exploitation of the rich relational structure latent in vulnerability databases to infer missing vulnerability–library associations. To realize this idea, we design a three-stage framework: Modeling, Completion, and Re-ranking. In the Modeling stage, we construct a domain-specific security knowledge graph that integrates five entity types (CVE, CWE, CPE, library, and ecosystem) from heterogeneous sources (NVD, Maven Central, and GitHub Advisory) under a coherent relational schema, providing the structural foundation on which KGC methods can operate effectively. In the Completion stage, we apply a modular KGC backbone to predict missing edges between vulnerability reports and libraries by exploiting both graph structure and textual descriptions. In the Re-ranking stage, we adapt DIFT (Liu et al., 2024), a recently proposed re-ranking method in KGC, to the multi-label setting since a single CVE may affect multiple libraries simultaneously, a characteristic that existing KGC re-ranking approaches do not handle. Concretely, we introduce multi-instance instruction tuning paired with a promote-then-fill inference strategy, in which the LLM first promotes the most likely library to the top position and then fills the remaining slots conditioned on the KGC backbone's candidate set.

We implement Athena with two representative contrastive KGC backbones, SimKGC (Wang et al., 2022) and RAA-KGC (Yuan et al., 2025), and eight different LLM backbones for re-ranking, including LLaMA-2 7B, LLaMA-2 13B, Vicuna-7B, Vicuna 13B, Qwen3.6 27B, Qwen3.6 35B-A3B, Gemma4 26B-A4B, and Gemma4 31B. We then train and evaluate it on the VuLib (Chen et al., 2025) benchmark against four state-of-the-art baselines. Our experiments demonstrate that Athena significantly outperforms all baselines, achieving a 32% improvement in Avg. F1 over the best baseline (i.e., VuLibGen). Notably, even without the re-ranking module, our KGC backbone with only 110M parameters outperforms VuLibGen's best configuration with 7B parameters, showing the effectiveness of graph-based modeling. With the re-ranking, Athena achieves further large gains, consistently outperforming VuLibGen across all evaluated LLM backbones and model scales by 18 to 28% in Avg. F1.

In summary, the main contributions of this paper are as follows:

  • We are the first to propose the formulation of vulnerability-affected library identification as a KGC problem, enabling the leverage of relational structure of vulnerability database that is invisible to text-based approaches.

  • We propose a domain-specific security knowledge graph that integrates five entity types (CVEs, libraries, CWE weakness categories, CPE products, and software ecosystems) from heterogeneous sources under a chronological partitioning strategy that approximates real-world deployment conditions.

  • We present Athena, a novel framework for affected library identification which systematically constructs a security knowledge graph, applies a plug-and-play KGC backbone for prediction, and utilizes LLM-based re-ranking to refine candidate order. Our extensive experiments and ablation studies demonstrate the effectiveness of Athena and the complementary contributions of each component.

  • We support open science initiatives by releasing our replication package, including all code, models, and experiment scripts at https://github.com/thanhlecongg/Athena.

References (12)

  • Github security advisories
  • Llama 2: Open Foundation and Fine-Tuned Chat Models
  • Veracode - application security testing and analysis
  • Liang Yao, Chengsheng Mao, and Yuan Luo. 2019. Kgbert: Bert for knowledge graph completion. arXiv preprint arXiv:1909.03193. (opens arXiv in a new tab)
  • These attributes may include entity names, descriptions, documentation, or other textual metadata
  • Knowledge Graph Completion (KGC) aims to address this issue by automatically inferring missing facts based on the existing knowledge in the graph
  • The model is trained using a contrastive learning objective (Le-Khac et al., 2020) that maximizes cosine similarity between valid triples while separating them from invalid ones via the InfoNCE loss (Chen et al., 2020a; Yang et al., 2019)
  • For a query $(h, r, ?)$, the method identifies entities connected to $h$ via the same relation $r$ in the training graph, samples a subset as anchors, and appends each anchor to the original query to form an anchor-enhanced representation
  • The relation field specifies the relation type affect_library
  • This identifier-description representation is applied consistently across all entity types in the graph, allowing triples of any relation type to be represented using the same five-field schema
  • node degree (CVE)</td><td>5.75</td></tr><tr><td>Max
  • Among these entities, 2,853 are CVEs, each connected to 5.75 other entities on average