LLMxCPG: Context-Aware Vulnerability Detection Through Code Property Graph-Guided Large Language Models

Ahmed Lekssays and Hamza Mouhcine, Qatar Computing Research Institute; Khang Tran, New Jersey Institute of Technology; Ting Yu, Mohamed bin Zayed University of Artificial Intelligence; Issa Khalil, Qatar Computing Research Institute

Software vulnerabilities present a persistent security challenge, with over 25,000 new vulnerabilities reported in the Common Vulnerabilities and Exposures (CVE) database in 2024 alone. While deep learning approaches show promise for vulnerability detection, recent comprehensive evaluations reveal critical limitations: accuracy drops by up to 45% on rigorously verified datasets, and performance degrades significantly under simple code modifications. This paper presents LLMxCPG, a novel framework integrating Code Property Graphs (CPG) with Large Language Models (LLM) for robust vulnerability detection. Our CPG-based slice construction technique reduces code size by 67.84-90.93% while preserving vulnerability-relevant context. Empirical evaluation demonstrates LLMxCPG's effectiveness across both traditional and verified datasets, achieving 15-40% improvements in F1-score over state-of-the-art baselines. Unlike existing approaches, LLMxCPG maintains consistent performance across function-level and multi-function codebases while exhibiting robust detection efficacy under various syntactic modifications.

Category: 
Short Presentation

Open Access Media

USENIX is committed to Open Access to the research presented at our events. Papers and proceedings are freely available to everyone once the event begins. Any video, audio, and/or slides that are posted after the event are also free and open to everyone. Support USENIX and our commitment to Open Access.

BibTeX
@inproceedings {309680,
author = {Ahmed Lekssays and Hamza Mouhcine and Khang Tran and Ting Yu and Issa Khalil},
title = {{LLMxCPG}: {Context-Aware} Vulnerability Detection Through Code Property {Graph-Guided} Large Language Models},
booktitle = {34th USENIX Security Symposium (USENIX Security 25)},
year = {2025},
isbn = {978-1-939133-52-6},
address = {Seattle, WA},
pages = {489--507},
url = {https://www.usenix.org/conference/usenixsecurity25/presentation/lekssays},
publisher = {USENIX Association},
month = aug
}