Gabriella Corona

Evaluating line-level localization ability of learning-based code vulnerability detection models

Giorgio Piras;Angelo Sotgiu
;
Maura Pintor;Battista Biggio
Ultimo
2026-01-01

Abstract

To address the extremely concerning problem of software vulnerability, system security is often entrusted to Machine Learning (ML) algorithms. Despite their now established detection capabilities, such models are limited by design to flagging the entire input source code function as vulnerable, rather than precisely localizing the concerned code lines. However, the detection granularity is crucial to support human operators during software development, ensuring that such predictions reflect the true code semantics to help debug, evaluate, and fix the detected vulnerabilities. To address this issue, recent work made progress toward improving the detector’s localization ability, thus narrowing down the vulnerability detection “window” and providing more fine-grained predictions. Such approaches, however, implicitly disregard the presence of spurious correlations and biases in the data, which often predominantly influence the performance of ML algorithms. In this work, we investigate how detectors comply with this requirement by proposing an explainability-based evaluation procedure. Our approach, defined as Detection Alignment (DA), quantifies the agreement between the input source code lines that most influence the prediction and the actual localization of the vulnerability as per the ground truth. Through DA, which is model-agnostic and adaptable to different detection tasks, not limited to our use case, we analyze multiple learning-based vulnerability detectors and datasets. As a result, we show how the predictions of such models are consistently biased by non-vulnerable lines, ultimately highlighting the high impact of biases and spurious correlations.
2026
2026
Inglese
115
4
94
1
19
19
https://doi.org/10.1007/s10994-025-06902-1
Esperti anonimi
internazionale
scientifica
software vulnerability; vulnerability detection; explainable AI; interpretable AI
no
Pintore, Marco; Piras, Giorgio; Sotgiu, Angelo; Pintor, Maura; Biggio, Battista
1.1 Articolo in rivista
info:eu-repo/semantics/article
1 Contributo su Rivista::1.1 Articolo in rivista
262
5
open
   European Lighthouse on Secure and Safe AI (ELSA)
   UK Research and Innovation
   Horizon Europe Guarantee
   10044744

   Cybersecurity for AI-Augmented Systems
   Sec4AI4Sec
   European Commission
   Horizon Europe Framework Programme - HORIZON Research and Innovation Actions
   101120393
File in questo prodotto:
File Dimensione Formato  
s10994-025-06902-1.pdf

accesso aperto

Descrizione: Pubblicazione in formato PDF rilasciata in open access dalla rivista.
Tipologia: versione editoriale (VoR)
Dimensione 2.72 MB
Formato Adobe PDF
2.72 MB Adobe PDF Visualizza/Apri

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Questionario e social

Condividi su:
Impostazioni cookie