Back to Search Start Over

Vision Transformer Inspired Automated Vulnerability Repair.

Authors :
Fu, Michael
Nguyen, Van
Tantithamthavorn, Chakkrit
Phung, Dinh
Le, Trung
Source :
ACM Transactions on Software Engineering & Methodology; Mar2024, Vol. 33 Issue 3, p1-29, 29p
Publication Year :
2024

Abstract

Recently, automated vulnerability repair approaches have been widely adopted to combat increasing software security issues. In particular, transformer-based encoder-decoder models achieve competitive results. Whereas vulnerable programs may only consist of a few vulnerable code areas that need repair, existing AVR approaches lack a mechanism guiding their model to pay more attention to vulnerable code areas during repair generation. In this article, we propose a novel vulnerability repair framework inspired by the Vision Transformer based approaches for object detection in the computer vision domain. Similar to the object queries used to locate objects in object detection in computer vision, we introduce and leverage vulnerability queries (VQs) to locate vulnerable code areas and then suggest their repairs. In particular, we leverage the cross-attention mechanism to achieve the cross-match between VQs and their corresponding vulnerable code areas. To strengthen our cross-match and generate more accurate vulnerability repairs, we propose to learn a novel vulnerability mask (VM) and integrate it into decoders' cross-attention, which makes our VQs pay more attention to vulnerable code areas during repair generation. In addition, we incorporate our VM into encoders' self-attention to learn embeddings that emphasize the vulnerable areas of a program. Through an extensive evaluation using the real-world 5,417 vulnerabilities, our approach outperforms all of the automated vulnerability repair baseline methods by 2.68% to 32.33%. Additionally, our analysis of the cross-attention map of our approach confirms the design rationale of our VM and its effectiveness. Finally, our survey study with 71 software practitioners highlights the significance and usefulness of AI-generated vulnerability repairs in the realm of software security. The training code and pre-trained models are available at https://github.com/awsm-research/VQM. [ABSTRACT FROM AUTHOR]

Details

Language :
English
ISSN :
1049331X
Volume :
33
Issue :
3
Database :
Complementary Index
Journal :
ACM Transactions on Software Engineering & Methodology
Publication Type :
Academic Journal
Accession number :
176329743
Full Text :
https://doi.org/10.1145/3632746