paper-with-me

Papers

CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generation

2025-01-14 · Jinjun Peng, Leyi Cui, Kele Huang, Junfeng Yang, Baishakhi Ray

Large Language Models (LLMs) have significantly aided developers by generating or assisting in code writing, enhancing productivity across various tasks. While identifying incorrect code is often straightforward, detecting vulnerabilities in functionally correct code is more challenging, especially for developers with limited security knowledge, which poses considerable security risks of using LLM-generated code and underscores the need for robust evaluation benchmarks that assess both functional correctness and security. Current benchmarks like CyberSecEval and SecurityEval attempt to solve it but are hindered by unclear and impractical specifications, failing to assess both functionality and security accurately. To tackle these deficiencies, we introduce CWEval, a novel outcome-driven evaluation framework designed to enhance the evaluation of secure code generation by LLMs. This framework not only assesses code functionality but also its security simultaneously with high-quality task specifications and outcome-driven test oracles which provides high accuracy. Coupled with CWEval-bench, a multilingual, security-critical coding benchmark, CWEval provides a rigorous empirical security evaluation on LLM-generated code, overcoming previous benchmarks' shortcomings. Through our evaluations, CWEval reveals a notable portion of functional but insecure code produced by LLMs, and shows a serious inaccuracy of previous evaluations, ultimately contributing significantly to the field of secure code generation. We open-source our artifact at: https://github.com/Co1lin/CWEval .

📄 PDF Abstract BibTeX arXiv:2501.08200

Code (1)

co1lin/cweval 공식 구현

Tasks

Code Generation

Similar Papers 제목 키워드 기반

Activating Latent Security Knowledge through LLM-Guided Risk Analysis for Secure Code Generation

2026-06-15 · Xiaoyun Xu, Lichao Wu, Jona te Lintelo, Siyu Zhang 외 arxiv

Large language models are pretrained on extensive software and security corpora, yet they frequently generate functionally correct code containing well-known vulnerabilities. Existing defenses commonly treat this behavio…

Code Generation

MACGen: Toward Functionally Correct and Secure Code Generation via Multi-Agent Collaboration

2026-08-26 · Miseon Yu, Jaehoon Choi, Younghan Lee, Yunheung Paek arxiv

Despite their strong ability to generate code, large language models often fail to produce secure code, as their outputs frequently contain security vulnerabilities. Secure code generation is inherently challenging becau…

Code Generation

SecPI: Secure Code Generation with Reasoning Models via Security Reasoning Internalization

2026-04-04 · Hao Wang, Niels Mündler, Mark Vero, Jingxuan He 외 arxiv

Reasoning language models (RLMs) are increasingly used in programming. Yet, even state-of-the-art RLMs frequently introduce critical security vulnerabilities in generated code. Prior training-based approaches for secure …

Code Generation

Why LLMs Fail: A Failure Analysis and Partial Success Measurement for Automated Security Patch Generation

2026-03-10 · Amir Al-Maamari arxiv

Large Language Models (LLMs) show promise for Automated Program Repair (APR), yet their effectiveness on security vulnerabilities remains poorly characterized. This study analyzes 319 LLM-generated security patchesacross…

Program Repair

SeClaw: Spec-Driven Security Task Synthesis for Evaluating Autonomous Agents

2026-06-01 · Hao Cheng, Changtao Miao, Tianle Song, Yin Wu 외 arxiv

Autonomous LLM agents increasingly operate in stateful environments where they access tools, files, memory, and external services. While such capabilities enable complex real-world workflows, they also introduce security…