mlsanityData to 14 Oct 2026

An Investigation into Misuse of Java Security APIs by Large Language Models

arXiv 2404.03823 ↗First posted 4 Apr 2024cs.CR cs.CL cs.CYcited by 11

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

  1. 2023GPT-4 Technical Reportcited by 18,396
  2. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
  3. 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 619
  4. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 431
  5. 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
  6. 2023Self-collaboration Code Generation via ChatGPTcited by 258
  7. 2022Do Users Write More Insecure Code with AI Assistants?cited by 192
  8. 2022Lost at C: A User Study on the Security Implications of Large Language Model Code Assistantscited by 91
  9. 2023How Secure is Code Generated by ChatGPT?cited by 81
  10. 2022Is GitHub's Copilot as Bad as Humans at Introducing Vulnerabilities in Code?cited by 67
  11. 2020Big Code != Big Vocabulary: Open-Vocabulary Models for Source Codecited by 54
  12. 2018CryptoGuard: High Precision Detection of Cryptographic Vulnerabilities in Massive-sized Java Projectscited by 8
7 more
  1. 2019The Impact of Developer Experience in Using Java Cryptographycited by 4
  2. 2023Detecting Misuse of Security APIs: A Systematic Reviewcited by 4
  3. 2021FluentCrypto: Cryptography in Easy Modecited by 3
  4. 2021Python Crypto Misuses in the Wildcited by 2
  5. 2022Example-Based Vulnerability Detection and Repair in Java Codecited by 2
  6. 2018Why Johnny Can't Store Passwords Securely? A Usability Evaluation of Bouncycastle Password Hashingcited by 1
  7. 2021Evaluation of Static Vulnerability Detection Tools with Java Cryptographic API Benchmarkscited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 2; 2025: 7; 2026: 2.

11 papers.