Evaluating and Improving the Robustness of Security Attack Detectors Generated by LLMs
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) are increasingly used in software development to generate functions, such as attack detectors, that implement security requirements. A key challenge is ensuring the LLMs have enough knowledge to address specific security requirements, such as information about existing attacks. For this, we propose an approach integrating Retrieval Augmented Generation (RAG) and Self-Ranking into the LLM pipeline. RAG enhances the robustness of the output by incorporating external knowledge sources, while the Self-Ranking technique, inspired by the concept of Self-Consistency, generates multiple reasoning paths and creates ranks to select the most robust detector. Our extensive empirical study targets code generated by LLMs to detect two prevalent injection attacks in web security: Cross-Site Scripting (XSS) and SQL injection (SQLi). Results show a significant improvement in detection performance while employing RAG and Self-Ranking, with an increase of up to 71%pt (on average 37%pt) and up to 43%pt (on average 6%pt) in the F2-Score for XSS and SQLi detection, respectively.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 17 of its 33 references that are in the map. First posted on arXiv 27 Nov 2024.
Builds on
17 of 33 references.
References · 17
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,878
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2023Retrieval-Augmented Generation for Large Language Models: A Surveycited by 2,185
- 2022Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language modelscited by 1,970
- 2021Scaling Language Models: Methods, Analysis & Insights from Training Gophercited by 1,199
- 2023Siren's Song in the AI Ocean: A Survey on Hallucination in Large Language Modelscited by 695
- 2022Do Users Write More Insecure Code with AI Assistants?cited by 186
5 more
- 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 149
- 2024CyberSecEval 2: A Wide-Ranging Cybersecurity Evaluation Suite for Large Language Modelscited by 84
- 2023How Secure is Code Generated by ChatGPT?cited by 77
- 2023The FormAI Dataset: Generative AI in Software Security Through the Lens of Formal Verificationcited by 32
- 2024An Investigation into Misuse of Java Security APIs by Large Language Modelscited by 11
Built on by
Citing papers per year: 2025: 1.
1 paper.
- 2025Evaluating LLM Generated Detection Rules in Cybersecurity20 Sep 2025
Similar, not cited
Close in wording, no citation either way
- 2025RAGRank: Using PageRank to Counter Poisoning in CTI LLM Pipelines
- 2025Token-Level Precise Attack on RAG: Searching for the Best Alternatives to Mislead Generation
- 2025Exploiting Web Search Tools of AI Agents for Data Exfiltration
- 2025SafeRAG: Benchmarking Security in Retrieval-Augmented Generation of Large Language Model
- 2025Traceback of Poisoning Attacks to Retrieval-Augmented Generation
- 2024Rag and Roll: An End-to-End Evaluation of Indirect Prompt Manipulations in LLM-based Application Frameworks
- 2024Data Extraction Attacks in Retrieval-Augmented Generation via Backdoors
- 2025Secure Retrieval-Augmented Generation against Poisoning Attacks