A Slicing-Based Approach for Detecting and Patching Vulnerable Code Clones

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Alomari, Hakam, Vendome, Christopher, Gyawali, Hilal
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913820030533632
author Alomari, Hakam
Vendome, Christopher
Gyawali, Hilal
author_facet Alomari, Hakam
Vendome, Christopher
Gyawali, Hilal
contents Code cloning is a common practice in software development, but it poses significant security risks by propagating vulnerabilities across cloned segments. To address this challenge, we introduce srcVul, a scalable, precise detection approach that combines program slicing with Locality-Sensitive Hashing to identify vulnerable code clones and recommend patches. srcVul builds a database of vulnerability-related slices by analyzing known vulnerable programs and their corresponding patches, indexing each slice's unique structural characteristics as a vulnerability slicing vector. During clone detection, srcVul efficiently matches slicing vectors from target programs with those in the database, recommending patches upon identifying similarities. Our evaluation of srcVul against three state-of-the-art vulnerable clone detectors demonstrates its accuracy, efficiency, and scalability, achieving 91% precision and 75% recall on established vulnerability databases and open-source repositories. These results highlight srcVul's effectiveness in detecting complex vulnerability patterns across diverse codebases.
format Preprint
id arxiv_https___arxiv_org_abs_2505_02349
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle A Slicing-Based Approach for Detecting and Patching Vulnerable Code Clones
Alomari, Hakam
Vendome, Christopher
Gyawali, Hilal
Software Engineering
Cryptography and Security
Code cloning is a common practice in software development, but it poses significant security risks by propagating vulnerabilities across cloned segments. To address this challenge, we introduce srcVul, a scalable, precise detection approach that combines program slicing with Locality-Sensitive Hashing to identify vulnerable code clones and recommend patches. srcVul builds a database of vulnerability-related slices by analyzing known vulnerable programs and their corresponding patches, indexing each slice's unique structural characteristics as a vulnerability slicing vector. During clone detection, srcVul efficiently matches slicing vectors from target programs with those in the database, recommending patches upon identifying similarities. Our evaluation of srcVul against three state-of-the-art vulnerable clone detectors demonstrates its accuracy, efficiency, and scalability, achieving 91% precision and 75% recall on established vulnerability databases and open-source repositories. These results highlight srcVul's effectiveness in detecting complex vulnerability patterns across diverse codebases.
title A Slicing-Based Approach for Detecting and Patching Vulnerable Code Clones
topic Software Engineering
Cryptography and Security
url https://arxiv.org/abs/2505.02349