Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
38 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
41 tokens/sec
o3 Pro
7 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Can You Really Trust Code Copilots? Evaluating Large Language Models from a Code Security Perspective (2505.10494v1)

Published 15 May 2025 in cs.CL

Abstract: Code security and usability are both essential for various coding assistant applications driven by LLMs. Current code security benchmarks focus solely on single evaluation task and paradigm, such as code completion and generation, lacking comprehensive assessment across dimensions like secure code generation, vulnerability repair and discrimination. In this paper, we first propose CoV-Eval, a multi-task benchmark covering various tasks such as code completion, vulnerability repair, vulnerability detection and classification, for comprehensive evaluation of LLM code security. Besides, we developed VC-Judge, an improved judgment model that aligns closely with human experts and can review LLM-generated programs for vulnerabilities in a more efficient and reliable way. We conduct a comprehensive evaluation of 20 proprietary and open-source LLMs. Overall, while most LLMs identify vulnerable codes well, they still tend to generate insecure codes and struggle with recognizing specific vulnerability types and performing repairs. Extensive experiments and qualitative analyses reveal key challenges and optimization directions, offering insights for future research in LLM code security.

LLMs: Assessing Code Security

In the paper titled "Can You Really Trust Code Copilots? Evaluating LLMs from a Code Security Perspective," the authors critically evaluate the security aspect of code generation by LLMs. As LLMs begin to automate and enhance various coding activities, their efficacy in generating secure code is imperative. This paper proposes CoV-Eval, a comprehensive multi-task benchmark to assess LLMs across various security tasks, identifying key challenges and suggesting directions for improvement.

Core Contributions

CoV-Eval Benchmark:

The paper introduces CoV-Eval, a multifaceted benchmark encompassing multiple tasks beyond traditional code generation and completion. This benchmark includes secure code generation, vulnerability repair, and classification tasks, intending to simulate diverse real-world coding scenarios. CoV-Eval offers a qualitative improvement over existing benchmarks, which typically focus on isolated tasks or test only for usability without significant consideration of security risks inherent in generated code.

VC-Judge Model:

The authors develop VC-Judge, an improved automated judgment model that mimics human evaluation closely, for reviewing code generated by LLMs. This model fosters more reliable vulnerability assessment, addressing the limitations of manual inspection and previously used static analysis tools.

Evaluation and Findings

The researchers conducted an empirical evaluation involving 20 LLMs, thoroughly testing proprietary systems like GPT-4 and Claude alongside popular open-source variants. The results indicate that while many LLMs adeptly identified vulnerable code, they often produced insecure code and struggled with precise vulnerability categorization and repair.

The findings are notable:

  • Most LLMs demonstrated relatively high proficiency in detecting vulnerabilities but exhibited limitations in repairing them once identified.
  • Open-source LLMs typically underperform compared to their proprietary counterparts in terms of both security and usability.
  • Fine-tuning LLMs using code-specific data enhances security and usability, though the benefit depends heavily on the quality of the dataset.

Implications and Future Directions

The paper's results hold significant implications for developing secure LLM-driven coding assistants. Practically, these insights underscore the importance of integrating robust security features into coding copilots, facilitating broader adoption within corporate settings. Theoretical implications suggest improving LLMs’ comprehension of complex security vulnerabilities, potentially through enriched training datasets focusing on real-world vulnerability examples.

Future developments should focus on the following:

  1. Dataset Enrichment: Expanding high-quality datasets with real-world vulnerabilities and secure coding practices to enhance LLM training.
  2. Model Integration: Leveraging multi-task learning frameworks that incorporate security detection and repair tasks might foster LLMs' ability to create secure code autonomously.
  3. Evaluation Metrics: Refining evaluation metrics to assess both code functional usability and its security simultaneously could offer better insights into LLM capabilities.

This paper is crucial in the ongoing discourse about employing LLMs in software engineering, emphasizing the necessity of balancing code usability with stringent security protocols to prevent vulnerable outputs that could undermine system integrity.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (5)
  1. Yutao Mou (16 papers)
  2. Xiao Deng (15 papers)
  3. Yuxiao Luo (6 papers)
  4. Shikun Zhang (82 papers)
  5. Wei Ye (110 papers)
Youtube Logo Streamline Icon: https://streamlinehq.com