Security of Language Models for Code: A Systematic Literature Review
Authors:
- Yuchen ChenYCYuchen Chen
- Weisong SunWSWeisong Sun
- Chunrong FangCFChunrong Fang
- Zhenpeng ChenZCZhenpeng Chen
- Yifei GeYGYifei Ge
- Tingxu HanTHTingxu Han
- Quanjun ZhangQZQuanjun Zhang
- Yang LiuYLYang Liu
- Zhenyu ChenZCZhenyu Chen
- Baowen XuBXBaowen Xu
Preprint
Abstract
Language models for code (CodeLMs) have emerged as powerful tools for code-related tasks, outperforming traditional methods and standard machine learning approaches. However, these models are susceptible to security vulnerabilities, drawing increasing research attention from domains such as software engineering, artificial intelligence, and cybersecurity. Despite the growing body of research focused on the security of CodeLMs, a comprehensive survey in this area remains absent. To address this gap, we systematically review 67 relevant papers, organizing them based on attack and defense strategies. Furthermore, we provide an overview of commonly used language models, datasets, and evaluation metrics, and highlight open-source tools and promising directions for future research in securing CodeLMs.Keywords
All Related Versions
This publication has 55 references indexed in Scilit:
- A survey on large language models for software engineeringScience China Information Sciences, 2026
- Adversarial Attacks Against Binary Similarity SystemsIEEE Access, 2024
- Enhancing robustness of AI offensive code generators via data augmentationEmpirical Software Engineering, 2024
- CodeBERT‐Attack: Adversarial attack against source code deep learning models via pre‐trained modelJournal of Software: Evolution and Process, 2023
- A comparative study of adversarial training methods for neural models of source codeFuture Generation Computer Systems, 2022
- Mitigating backdoor attacks in LSTM-based text classification systems by Backdoor Keyword IdentificationNeurocomputing, 2021
- A survey on adversarial attacks and defencesCAAI Transactions on Intelligence Technology, 2021
- Pre-trained models: Past, present and futureAI Open, 2021
- Identifying relevant studies in software engineeringInformation and Software Technology, 2011
- Qualitative methods in empirical studies of software engineeringIEEE Transactions on Software Engineering, 1999