A4 Vertaisarvioitu artikkeli konferenssijulkaisussa
A Prompt-Based Framework for Loop Vulnerability Detection Using Local LLMs
Tekijät: Adeseye, Adeyemi; Adeseye, Aisvarya
Toimittaja: Ferens, Ken; Deligiannidis, Leonidas; Arabnia, Hamid R.; de la Fuente, David; Olivas, José A.
Konferenssin vakiintunut nimi: World Congress in Computer Science, Computer Engineering, and Applied Computing
Kustantaja: Springer Nature Switzerland
Julkaisuvuosi: 2026
Lehti: Communications in Computer and Information Science
Kokoomateoksen nimi: Applied Cognitive Computing and Artificial Intelligence
Vuosikerta: 2933
Aloitussivu: 220
Lopetussivu: 234
ISBN: 978-3-032-22204-6
eISBN: 978-3-032-22205-3
ISSN: 1865-0929
eISSN: 1865-0937
DOI: https://doi.org/10.1007/978-3-032-22205-3_16
Julkaisun avoimuus kirjaamishetkellä: Ei avoimesti saatavilla
Julkaisukanavan avoimuus : Osittain avoin julkaisukanava
Verkko-osoite: https://doi.org/10.1007/978-3-032-22205-3_16
Loop vulnerabilities are one major risky construct in software development. They can easily lead to infinite loops or executions, exhaust resources, or introduce logical errors that degrade performance and compromise security. The problem are often undetected by traditional static analyzers because such tools rely on syntactic patterns, which makes them struggle to detect semantic flaws. Consequently, Large Language Models (LLMs) offer new potential for vulnerability detection because of their ability to understand code contextually. Moreover, local LLMs unlike commercial ones like ChatGPT or Gemini addresses issues such as privacy, latency, and dependency concerns by facilitating efficient offline analysis. Consequently, this study proposes a prompt-based framework that utilize local LLMs for the detection of loop vulnerabilities within Python 3.7+ code. The framework targets three categories of loop-related issues, such as control and logic errors, security risks inside loops, and resource management inefficiencies. A generalized and structured prompt-based framework was designed and tested with two locally deployed LLMs (LLaMA 3.2; 3B and Phi 3.5; 4B) by guiding their behavior via iterative prompting. The designed prompt-based framework included key safeguarding features such as language-specific awareness, code-aware grounding, version sensitivity, and hallucination prevention. The LLM results were validated against a manually established baseline truth, and the results indicate that Phi outperforms LLaMA in precision, recall, and F1-score. The findings emphasize the importance of designing effective prompts for local LLMs to perform secure and accurate code vulnerability analysis.