<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Based on Query Retrieval for CPE prediction</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jinrui Zhang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Linyi Han</string-name>
          <email>hanly2@tju.edu.cn</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Xiaowang Zhang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="editor">
          <string-name>CPE Prediction, Vulnerability Knowledge Graph, Large Language Model</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>College of Intelligence and Computing, Tianjin University</institution>
          ,
          <addr-line>Tianjin, 300350</addr-line>
          ,
          <country country="CN">China</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Textual vulnerability description (TVD) is the record of software vulnerability by software engineers. Software engineers use the common platform enumerations (CPE) in TVDs to find software related to the vulnerability record. However, CPE is always incomplete, which makes it dificult to comprehensively identify the software afected by the vulnerability. Existing work focuses on completing CPE through CPE prediction based on the Knowledge Graph Embedding (KGE) model. However, the KGE model cannot capture the potential connections between softwares in TVD. In this poster, we propose a knowledge fusion constraint method based on query retrieval. Firstly, we extract the subgraph related to TVDs from the graph, which contains known CPEs and vulnerability types. Then, we use a large language model (LLM) combined with the subgraph to rerank the candidate CPEs predicted by the KGE model. Experiments show that our framework improves the accuracy of TVD-CPE link prediction, providing valuable support for software developers in product security assessment.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>CEUR
ceur-ws.org</p>
    </sec>
    <sec id="sec-2">
      <title>1. Introduction</title>
      <p>
        Textual vulnerability description (TVD) is the record of software vulnerability by software
engineers. Common platform enumeration[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] (CPE) is a standardized naming convention
in TVD for uniquely identifying software, hardware, and applications. Software engineers
can find out the afected products through CPE in TVD. However, a TVD corresponds to
multiple CPEs, and it takes several weeks to find all CPEs in the TVD. Therefore, it is essential
to predict undiscovered CPEs in the TVD. Shi et al.[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] construct a vulnerability knowledge
graph and use the TransE[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] model to predict the link between TVD and CPE. ULTRA[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] is
an approach for learning universal and transferable graph representations. It builds relational
representations as a function conditioned on their interactions, which allows a pre-trained
ULTRA model to inductively generalize to unseen KGs. Alfasi et al.[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] propose the VulnScopper
framework, which uses a large language model(LLM) to represent TVD and then incorporate the
vulnerability embeddings into the ULTRA model for training. However, they do not consider
the relationship between softwares afected in TVD. We observe that CPEs in the same TVD
usually have similar software architectures or vulnerability types. In this poster, we construct a
knowledge fusion constrained framework based on query retrieve (KFC-QR) to predict CPEs.
Given a TVD, firstly, we generate candidate CPEs through the KGE model. Secondly, we retrieve
subgraphs of similar CVEs from the vulnerability knowledge graph, which contains known
CPEs and vulnerability types. Thirdly, we use LLM for re-ranking CPEs and average the scores
with those output by the KGE model to obtain the final prediction results. Experiments show
that our framework improves the accuracy of TVD-CPE link prediction.
      </p>
    </sec>
    <sec id="sec-3">
      <title>2. Approach</title>
      <sec id="sec-3-1">
        <title>2.1. Problem Definition</title>
        <p>Our task is to link prediction between TVD and CPE. Formally, the vulnerability knowledge
graph can be represented as G = {E, R}, where E and R represent the set of entities and relations
in G, respectively. Given a TVD   , the link prediction task ranks all entities as   = ( 1,  2, ...,   )
by calculating their scores as   = ( 1,  2, ...,   ).</p>
      </sec>
      <sec id="sec-3-2">
        <title>2.2. Approach Overview</title>
        <p>Our approach consists of the KGE model, the query-related subgraph retrieval module and the
knowledge fusion constrained inference module. We use ULTRA as the KGE model, which
allows KFC-QR to link predictions for unseen entities. We use the KGE model to predict
candidate CPEs for the given TVD. The Query-related Subgraph Retrieval module is used to
retrieve CVE subgraphs that are similar to the given TVD, providing query-related knowledge.
The Knowledge Fusion Constrained Inference module is used to fuse candidate CPEs, query
related knowledge into a prompt and instruct the LLM to rerank the candidate CPEs.</p>
      </sec>
      <sec id="sec-3-3">
        <title>2.3. Query-related Subgraph Retrieval</title>
        <p>This module is used to retrieve the subgraph for a given TVD, providing known CPEs and
vulnerability types. In the transductive setting, we directly use the TVD to query the vulnerability</p>
        <p>TransE 0.223</p>
        <p>ChatGPT 4 X
VulnScopper(SOTA) 0.573</p>
        <p>Ours 0.623
Ours KGE(ULTRA) 0.531
Ours w/o Subgraph 0.598</p>
        <p>TransE 0.310</p>
        <p>ChatGPT 4 X
VulnScopper(SOTA) 0.651</p>
        <p>Ours 0.693
Ours KGE(ULTRA) 0.553
Ours w/o Subgraph 0.673
knowledge graph to get the subgraph. In the inductive setting, we retrieve the TVDs in the
vulnerability knowledge graph that are similar to the given TVD and use the subgraphs of
similar TVDs to provide knowledge for inference. We calculate the cosine similarity between
TVD embeddings to obtain candidate similar TVDs. Then we extract the afected products of
the candidate TVDs and filter the final similar TVDs by rules.</p>
      </sec>
      <sec id="sec-3-4">
        <title>2.4. Knowledge Fusion Constrained Inference</title>
        <p>
          Due to the natural language understanding capability of the LLM, we construct the vulnerability
knowledge as prompts and instruct the LLM to rerank the candidate CPEs. We convert the
triplet information of the TVD subgraph into natural language format using predefined rules,
which allows LLMs to understand the knowledge more accurately. Additionally, we replace the
original abstract symbols with the actual meanings of the common weakness enumeration[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
We replace complex CPEs with simple letters to reduce the omission and fabrication problems
in LLM generation.
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>3. Experiments</title>
      <p>
        We retrieve available vulnerability knowledge from NVD[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] API and construct it into a
vulnerability knowledge graph following the method of Shi et al. Our dataset has a total of 653,319
triples, of which 309,139 are TVD-CPE triples. In the transductive setup, we use 4,971 TVD-CPE
triples as the test set and ensure that the entities in the test set have appeared in the training set.
In the inductive setup, we divide the graph temporally, the training set contains triples up to
October 1st, 2023. The triples from October 1st, 2023 to April 17th, 2024 is used as the test set.
We use MRR and Hits@K as evaluation metrics. Table 1 presents the inductive and transductive
link prediction results on the test set. The evaluation results indicate that KFC-QR performs
better than all the other methods in predicting the link between CPE and TVD. We also conduct
ablation experiments to validate the efectiveness of the query-related subgraph module.
      </p>
    </sec>
    <sec id="sec-5">
      <title>4. Limitation</title>
      <p>Our model relies on the performance of the KGE model because we rerank the top K candidate
CPEs predicted by the KGE model. As shown in Figure 2, considering the accuracy of the model
and the size of the candidate CPEs, we set k=20. We rerank the top 20 candidate CPEs predicted
by the KGE model. In the application of other datasets, it is necessary to dynamically adjust
the K value according to the performance of the model to make the candidate CPEs cover the
correct CPEs as much as possible.</p>
    </sec>
    <sec id="sec-6">
      <title>5. Conclusion</title>
      <p>In this poster, we propose KFC-QR for link predictions between TVD and CPE, which considers
the similarity between CPEs afected by the same TVD. Experiments demonstrate that the
framework improves the link prediction accuracy between TVDs and CPEs. In the future, we
plan to extend this framework to link prediction for TVD and common weakness enumeration
to verify generalization.</p>
    </sec>
    <sec id="sec-7">
      <title>Acknowledgement</title>
      <p>This work was supported by the Project of Science and Technology Research and Development
Plan of China Railway Corporation (N2023J044).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>MITRE</surname>
          </string-name>
          ,
          <article-title>Oficial common platform enumeration (cpe) dictionary, 2024</article-title>
          . URL: https://nvd.nist. gov/products/cpe.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Shi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Matyunin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Grafi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Starobinski</surname>
          </string-name>
          ,
          <article-title>Uncovering cwe-cve-cpe relations with threat knowledge graphs</article-title>
          ,
          <source>ACM Transactions on Privacy and Security</source>
          <volume>27</volume>
          (
          <year>2024</year>
          )
          <fpage>1</fpage>
          -
          <lpage>26</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>A.</given-names>
            <surname>Bordes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Usunier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Garcia-Duran</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Weston</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Yakhnenko</surname>
          </string-name>
          ,
          <article-title>Translating embeddings for modeling multi-relational data</article-title>
          ,
          <source>Advances in neural information processing systems</source>
          <volume>26</volume>
          (
          <year>2013</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>M.</given-names>
            <surname>Galkin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Yuan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Mostafa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Tang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Zhu</surname>
          </string-name>
          ,
          <article-title>Towards foundation models for knowledge graph reasoning</article-title>
          ,
          <source>in: The Twelfth International Conference on Learning Representations</source>
          ,
          <year>2024</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>D.</given-names>
            <surname>Alfasi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Shapira</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. B.</given-names>
            <surname>Barr</surname>
          </string-name>
          ,
          <article-title>Unveiling hidden links between unseen security entities</article-title>
          ,
          <source>arXiv preprint arXiv:2403</source>
          .
          <year>02014</year>
          (
          <year>2024</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <article-title>[6] MITRE, Common weakness enumeration (cwe</article-title>
          ),
          <year>2024</year>
          . URL: https://cwe.mitre.org.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>NVD</surname>
          </string-name>
          ,
          <article-title>National vulnerability database (nvd</article-title>
          ),
          <year>2024</year>
          . URL: https://nvd.nist.gov/general.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>