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

  • Ahmed Lekssays
  • , Hamza Mouhcine
  • , Khang Tran
  • , Ting Yu
  • , Issa Khalil

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

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 based approaches show promise for vulnerability detection, recent studies reveal critical limitations in terms of accuracy and robustness: 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 to 90.93% while preserving vulnerability-relevant context. Our approach’s ability to provide a more concise and accurate representation of code snippets enables the analysis of larger code segments, including entire projects. This concise representation is a key factor behind the improved detection capabilities of our method, as it can now identify vulnerabilities that span multiple functions. Empirical evaluation demonstrates LLMxCPG’s effectiveness across verified datasets, achieving 15-40% improvements in F1-score over state-of-the-art baselines. Moreover, LLMxCPG maintains high performance across function-level and multi-function codebases while exhibiting robust detection efficacy under various syntactic code modifications.

Original languageEnglish
Title of host publicationProceedings of the 34th USENIX Security Symposium
PublisherUSENIX Association
Pages489-507
Number of pages19
ISBN (Electronic)9781939133526
Publication statusPublished - 2025
Event34th USENIX Security Symposium, USENIX Security 2025 - Seattle, United States
Duration: 13 Aug 202515 Aug 2025

Publication series

NameProceedings of the 34th USENIX Security Symposium

Conference

Conference34th USENIX Security Symposium, USENIX Security 2025
Country/TerritoryUnited States
CitySeattle
Period13/08/2515/08/25

Fingerprint

Dive into the research topics of 'LLMxCPG: Context-Aware Vulnerability Detection Through Code Property Graph-Guided Large Language Models'. Together they form a unique fingerprint.

Cite this