Despite their remarkable success, large language models (LLMs) have shown limited ability on safety-critical code tasks such as vulnerability detection. Typically, static analysis (SA) tools, like CodeQL, CodeGuru Security, etc., are used for vulnerability detection. SA relies on predefined, manually-crafted rules for flagging various vulnerabilities. Thus, effectiveness of SA in detecting vulnerabilities depends on human experts and is known to report high error rates. In this study we investigate whether LLM prompting can be an effective alternative to these static analyzers in the partial code setting. We propose prompting strategies that integrate natural language instructions of vulnerabilities with contrastive chain-of-thought reasoning, augmented using contrastive samples from a synthetic dataset. Our findings demonstrate that security-aware prompting techniques can be effective alternatives to the laborious, hand-crafted rules of static analyzers, which often result in high false negative rates in the partial code setting. When leveraging SOTA reasoning models such as DeepSeek-R1, each of our prompting strategies exceeds the static analyzer baseline, with the best strategies improving accuracy by as much as 31.6%, F1-scores by 71.7%, pairwise accuracies by 60.4%, and reducing FNR by as much as 37.6%.
ChartAttack: Testing the Vulnerability of LLMs to Malicious Prompting in Chart Generation
INSAIT, Sofia University "St. Kliment Ohridski"(INSAIT索菲亚大学"圣克莱门特·欧赫里迪斯基");Ubiquitous Knowledge Processing Lab (UKP Lab), Department of Computer Science, TU Darmstadt and National Research Center for Applied Cybersecurity ATHENE(无处不在知识处理实验室(UKP实验室)、计算机科学系、图腾达姆斯塔特大学和应用网络安全国家研究中心ATHENE);Arizona State University(亚利桑那州立大学)
An Empirical Evaluation of LLM-Generated Code Security Across Prompting Methods
Department of Computer Science, Birzeit University(计算机科学系,巴勒斯坦比泽大学);King Fahd University of Petroleum and Minerals(国王法赫德石油和矿物大学);University of Central Florida(中央佛罗里达大学)
Harnessing Large Language Models for Software Vulnerability Detection: A Comprehensive Benchmarking Study
School of Information Technologies Tallinn University of Technology(塔林理工大学信息技术学院);School of Informatics, Computing, and Cyber Systems Northern Arizona University(北亚利桑那大学信息学、计算与网络系统学院)
CGP-Tuning: Structure-Aware Soft Prompt Tuning for Code Vulnerability Detection
School of Computer Science and Engineering, University of New South Wales (UNSW)(新南威尔士大学计算机科学与工程学院);Department of Electrical Engineering and Information Technology, University of Naples Federico II(那不勒斯费德里克二世大学电气工程与信息技术系)
PromptGuard: An Orchestrated Prompting Framework for Principled Synthetic Text Generation for Vulnerable Populations using LLMs with Enhanced Safety, Fairness, and Controllability
Posts and Telecommunications Institute of Technology(邮电技术研究所);Hanoi Architectural University(河内建筑大学)
VulTriage: Triple-Path Context Augmentation for LLM-Based Vulnerability Detection
Tsinghua University(清华大学);Henan University(河南大学);Dalian Maritime University(大连海事大学);The Chinese University of Hong Kong(香港中文大学);Northwestern Polytechnical University(西北工业大学);BNU-HKBU United International College(北京理工大学-香港大学联合国际学院);Southeast University(东南大学);Jilin University(吉林大学);Sun Yat-sen University(中山大学);Peng Cheng Laboratory(鹏城实验室);Guangzhou Intelligence Communications Technology Co., Ltd.(广州智能通信技术有限公司);The Fifth Electronic Research Institute of MIIT(信息产业部第五电子研究所)
Security Degradation in Iterative AI Code Generation -- A Systematic Analysis of the Paradox
Department of Analytics and Information Systems(分析与信息系统系);University of San Francisco(旧金山大学);Department of Applied AI and Industry Innovation(应用人工智能与产业创新系);Vector Institute for Artificial Intelligence(人工智能研究院);Department of Management Science and Information Systems(管理科学与信息系统系);University of Massachusetts Boston(马萨诸塞大学波士顿分校)
Center for Frontier AI Research(前沿人工智能研究中心);Agency for Science, Technology and Research(科技研究局);Institute of High Performance Computing(高性能计算研究所);UWCSEA Dover High School(UWCSEA多佛高中)
Using Instruction-Tuned Large Language Models to Identify Indicators of Vulnerability in Police Incident Narratives
School for Business and Society, University of York(约克大学商业与社会学院);ESRC Vulnerability and Policing Futures Research Centre(经济与社会研究委员会脆弱性与警务未来研究中心);School of Law, University of Leeds(利兹大学法学院)
"Sorry, Come Again?" Prompting -- Enhancing Comprehension and Diminishing Hallucination with [PAUSE]-injected Optimal Paraphrasing
AI Institute, University of South Carolina(南卡罗来纳大学AI研究院);Indian Institute of Technology, Kharagpur(印度理工学院克勒格布尔分校);Islamic University of Technology(伊斯兰科技大学);Stanford University(斯坦福大学);Amazon AI(亚马逊AI研究院)