An Investigation into Misuse of Java Security APIs by Large Language Models
Not on the map. Why?
Abstract (arXiv)
The increasing trend of using Large Language Models (LLMs) for code generation raises the question of their capability to generate trustworthy code. While many researchers are exploring the utility of code generation for uncovering software vulnerabilities, one crucial but often overlooked aspect is the security Application Programming Interfaces (APIs). APIs play an integral role in upholding software security, yet effectively integrating security APIs presents substantial challenges. This leads to inadvertent misuse by developers, thereby exposing software to vulnerabilities. To overcome these challenges, developers may seek assistance from LLMs. In this paper, we systematically assess ChatGPT's trustworthiness in code generation for security API use cases in Java. To conduct a thorough evaluation, we compile an extensive collection of 48 programming tasks for 5 widely used security APIs. We employ both automated and manual approaches to effectively detect security API misuse in the code generated by ChatGPT for these tasks. Our findings are concerning: around 70% of the code instances across 30 attempts per task contain security API misuse, with 20 distinct misuse types identified. Moreover, for roughly half of the tasks, this rate reaches 100%, indicating that there is a long way to go before developers can rely on ChatGPT to securely implement security API code.
Key facts. Cited by 11 papers in the map (data through 14 Oct 2026). Builds on 19 of its 92 references that are in the map. First posted on arXiv 4 Apr 2024.
Builds on
19 of 92 references.
References · 19
- 2023GPT-4 Technical Reportcited by 18,396
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 619
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 431
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023Self-collaboration Code Generation via ChatGPTcited by 258
- 2022Do Users Write More Insecure Code with AI Assistants?cited by 192
- 2022Lost at C: A User Study on the Security Implications of Large Language Model Code Assistantscited by 91
- 2023How Secure is Code Generated by ChatGPT?cited by 81
- 2022Is GitHub's Copilot as Bad as Humans at Introducing Vulnerabilities in Code?cited by 67
- 2020Big Code != Big Vocabulary: Open-Vocabulary Models for Source Codecited by 54
- 2018CryptoGuard: High Precision Detection of Cryptographic Vulnerabilities in Massive-sized Java Projectscited by 8
7 more
- 2019The Impact of Developer Experience in Using Java Cryptographycited by 4
- 2023Detecting Misuse of Security APIs: A Systematic Reviewcited by 4
- 2021FluentCrypto: Cryptography in Easy Modecited by 3
- 2021Python Crypto Misuses in the Wildcited by 2
- 2022Example-Based Vulnerability Detection and Repair in Java Codecited by 2
- 2018Why Johnny Can't Store Passwords Securely? A Usability Evaluation of Bouncycastle Password Hashingcited by 1
- 2021Evaluation of Static Vulnerability Detection Tools with Java Cryptographic API Benchmarkscited by 1
Built on by
Citing papers per year: 2024: 2; 2025: 7; 2026: 2.
11 papers.
- 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Studycited by 53
- 2025Vibe Coding vs. Agentic Coding: Fundamentals and Practical Implications of Agentic AIcited by 42
- 2025Large Language Model (LLM) for Software Security: Code Analysis, Malware Analysis, Reverse Engineeringcited by 15
- 2025An Investigation into Value Misalignment in LLM-Generated Texts for Cultural Heritagecited by 8
- 2025Is Your Prompt Poisoning Code? Defect Induction Rates and Security Mitigation Strategiescited by 3
- 2025SOK: Exploring Hallucinations and Security Risks in AI-Assisted Software Development with Insights for LLM Deploymentcited by 2
- 2024Evaluating and Improving the Robustness of Security Attack Detectors Generated by LLMscited by 1
- 2025Mapping Trustworthiness in Large Language Models: A Bibliometric Analysis Bridging Theory to Practicecited by 1
- 2025Software Vulnerability Management in the Era of Artificial Intelligence: An Industry Perspectivecited by 0
- 2026A Quasi-Experimental Developer Study of Security Training in LLM-Assisted Web Application Developmentcited by 0
- 2026Understanding the Impact of AI Code Assistants on Security API Usage: An Empirical Studycited by 0
- 2026Understanding the Impact of AI Code Assistants on Security API Usage: An Empirical Study13 Jul 2026
- 2026A Quasi-Experimental Developer Study of Security Training in LLM-Assisted Web Application Development20 Apr 2026
- 2025Software Vulnerability Management in the Era of Artificial Intelligence: An Industry Perspective20 Dec 2025
- 2025Is Your Prompt Poisoning Code? Defect Induction Rates and Security Mitigation Strategies27 Oct 2025
- 2025Vibe Coding vs. Agentic Coding: Fundamentals and Practical Implications of Agentic AI26 May 2025
- 2025Large Language Model (LLM) for Software Security: Code Analysis, Malware Analysis, Reverse Engineering7 Apr 2025
- 2025Mapping Trustworthiness in Large Language Models: A Bibliometric Analysis Bridging Theory to Practice27 Feb 2025
- 2025SOK: Exploring Hallucinations and Security Risks in AI-Assisted Software Development with Insights for LLM Deployment31 Jan 2025
- 2025An Investigation into Value Misalignment in LLM-Generated Texts for Cultural Heritage3 Jan 2025
- 2024Evaluating and Improving the Robustness of Security Attack Detectors Generated by LLMs27 Nov 2024
- 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Study8 Jul 2024