Security of Language Models for Code: A Systematic Literature Review

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 68 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.

Authors

Institutions

Publication Details

Journal
ACM Transactions on Software Engineering and Methodology
Published
2025-08-12
DOI
https://doi.org/10.1145/3735554
Citations
4
Primary Topic
Advanced Malware Detection Techniques
Type
article
Field-Weighted Citation Impact
5.94

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Security of Language Models for Code: A Systematic Literature Review

Weisong Sun, Tingxu Han, Zhenpeng Chen, Chunrong Fang et al.
4 citations
ACM Transactions on Software Engineering and Methodology
Advanced Malware Detection Techniques
5.94
article

Security of Language Models for Code: A Systematic Literature Review

Weisong Sun, Tingxu Han, Zhenpeng Chen, Chunrong Fang, Baowen Xu, Yang Liu, Zhenyu Chen, Yuchen Chen, Quanjun Zhang, Yifei Ge
article en
4 citations

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 68 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.

ACM Transactions on Software Engineering and Methodology
Nanyang Technological University (SG), Nanjing University (CN)
National Research Foundation, National Research Foundation Singapore, National Natural Science Foundation of China, National Key Research and Development Program of China
Openalex Percentile: Top 4%
Advanced Malware Detection Techniques
5.94
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Security of Language Models for Code: A Systematic Literature Review — Weisong Sun, Tingxu Han, et al. · ACM Transactions on Software Engineering and Methodology (2025) | TGRS Research Map | TGRS