SecureReviewer: Enhancing Large Language Models for Secure Code Review through Secure-aware Fine-tuning

Fang Liu, Simiao Liu, Yinghao Zhu, Xiaoli Lian, Li Zhang
10/30/2025
cs.SEcs.AIcs.CL

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

Identifying and addressing security issues during the early phase of the development lifecycle is critical for mitigating the long-term negative impacts on software systems. Code review serves as an effective practice that enables developers to check their teammates' code before integration into the codebase. To streamline the generation of review comments, various automated code review approaches have been proposed, where LLM-based methods have significantly advanced the capabilities of automated review generation. However, existing models primarily focus on general-purpose code review, their effectiveness in identifying and addressing security-related issues remains underexplored. Moreover, adapting existing code review approaches to target security issues faces substantial challenges, including data scarcity and inadequate evaluation metrics. To address these limitations, we propose SecureReviewer, a new approach designed for enhancing LLMs' ability to identify and resolve security-related issues during code review. Specifically, we first construct a dataset tailored for training and evaluating secure code review capabilities. Leveraging this dataset, we fine-tune LLMs to generate code review comments that can effectively identify security issues and provide fix suggestions with our proposed secure-aware fine-tuning strategy. To mitigate hallucination in LLMs and enhance the reliability of their outputs, we integrate the RAG technique, which grounds the generated comments in domain-specific security knowledge. Additionally, we introduce SecureBLEU, a new evaluation metric designed to assess the effectiveness of review comments in addressing security issues. Experimental results demonstrate that SecureReviewer outperforms state-of-the-art baselines in both security issue detection accuracy and the overall quality and practical utility of generated review comments.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 3 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{liu2025securereviewer,
  title  = {SecureReviewer: Enhancing Large Language Models for Secure Code Review through Secure-aware Fine-tuning},
  author = {Fang Liu and Simiao Liu and Yinghao Zhu and Xiaoli Lian and Li Zhang},
  year   = {2025},
  eprint = {2510.26457},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.26457v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.26457.svg)](https://codeofpaper.com/paper/2510.26457)

Discussion