arrow
Return

Detecting Rust Code Vulnerabilities Through Transfer Learning

delete2026-04-01
delete0
PRE
AI
I
Irfan Ali Khan
Y
Yu Luo
X
Xu, Weifeng
D
Dianxiang Xu *
DOI:10.1142/s0218194026500208delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Rust is designed to prevent common memory safety issues, yet it remains susceptible to various security vulnerabilities. The limited availability of labeled vulnerability data in Rust presents a significant challenge for applying Machine Learning (ML) techniques. To address this, we propose TL-HGNN, a novel transfer learning framework that employs Heterogeneous Graph Neural Networks (HGNNs) and LLMs to detect Rust vulnerabilities without the need for Rust-specific training. TL-HGNN utilizes Inter-procedural Compressed Code Property Graphs (ICCPGs) to represent source code from high-resource languages (C or Java), training HGNN models that capture semantic and structural relationships. Rust code is translated into the source language using an iterative LLM-based approach to ensure correct syntax. The translated code is then converted into an ICCPG representation and analyzed with pre-trained HGNN models. Evaluations on 82 real-world Rust CVE pairs across 44 CWEs indicate that TL-HGNN achieves higher performance than the evaluated baselines on this dataset, achieving an F1-score of 66.24%. Additionally, an ablation study suggests the advantages of ICCPG representation over prior graph methods and the effectiveness of LLM translation over dictionary-based mapping for transfer learning. Our results also indicate that Java serves as a more effective source language than C in this context, and GPT-4.0 achieves higher performance than several other LLMs in translation quality. TL-HGNN represents an early application of transfer learning to Rust vulnerability detection.
Keywords:
Code vulnerability
Rust
transfer learning
graph neural networks
large language models

Journal

I
International Journal of Software Engineering and Knowledge Engineering
IF:
0.6
Papers:
106
Citations:
543

Organization

U
University of Missouri Kansas City
Scholars:
151
Papers: 107
Citations: 0
U
university central missouri
Scholars:
194
Papers: 182
Citations: 1
University of Missouri System cover
University of Missouri System
Scholars:
2.9W
Papers: 2.7W
Citations: 75
researcher View more organizations