Skip to content
Review Open access

Security Analysis of LLM-Generated Web API Backends

2026 · IEEE Access · Vol 14, pp. 134866-134882 · 0 citations · 53 references

TL;DR

A security assessment on 75 FastAPI backends generated by three contemporary LLMs revealed a disconnect between functional correctness and secure logic, which is interpreted as a review-risk pattern, which is called the human-in-the-loop paradox.

Abstract

The adoption of Large Language Models (LLMs) is changing how code is written, but the security implications of using LLMs to generate complete web API backends remain insufficiently characterized. Prior studies have assessed the security of LLM-generated code by detecting vulnerabilities in isolated code snippets; however, these assessments are too narrow to surface vulnerabilities that emerge in multi-endpoint backend services. To address this gap, we performed a security assessment on 75 FastAPI backends generated by three contemporary LLMs (Gemini 2.5 Pro, GPT 5.2, and DeepSeek V3.2). We designed a benchmark comprising the following five code generation categories: Authentication, Role-Based Access Control, File Uploads, Payment Processing, and Webhook Handling. Automated analysis of the generated APIs with Static Application Security Testing (SAST) tools, whose raw alerts we manually triaged to remove false positives, mainly revealed configuration problems, while Dynamic Application Security Testing (DAST) tools helped uncover runtime fragility such as application crashes on malformed input. Automated analysis was augmented with a manual assessment phase, which revealed vulnerabilities such as mass assignment and server-side request forgery. We also observed a disconnect between functional correctness and secure logic. In our trials, DeepSeek V3.2 produced the most vulnerable code despite the highest build success rate. Gemini 2.5 Pro had the highest startup-failure rate and produced shorter implementations, which coincided with fewer observed runtime findings among the APIs that started. GPT-5.2 fell between the two, characterized by near-correct security controls that took the right form but lacked the intended effect. We interpret this disconnect as a review-risk pattern, which we call the human-in-the-loop paradox: syntactically correct and well-structured LLM-generated code can still contain architectural vulnerabilities that are not revealed by surface-level inspection. The takeaway is that LLM-generated code warrants the same treatment as untrusted input from an external system.

Read PDF

Similar papers

#artificial intelligence Preprint Sep 2026

Exploring Automated Vulnerability Identification in JavaScript Code Using Large Language Models

Results indicate that LLMs provide a practical approach for automated vulnerability identification in JavaScript code, particularly when combined with task-aligned supervision, though they should complement rather than replace existing security analysis workflows due to limited recall and uneven performance across vuln...

Manit Kaushik, Ishir Bhardwaj, Pranav Gupta et al. · 0 citations
Preprint Sep 2026

C-to-Rust Fallacy: Automatic Refactoring != Memory Security

Rust has emerged as the leading system programming language, offering strong memory and type safety guarantees without compromising performance. This positions it as a compelling alternative to traditional languages like C and C++, which are susceptible to memory security bugs. However, manually transforming C to Rust...

Hung-Mao Chen, Xu He, Bo Lu et al. · 0 citations
Conference Open access 2026

LLM-Powered Automated Attacks

The increasing integration of large language models (LLMs) into systems introduces new attack surfaces that extend beyond traditional software vulnerabilities. While LLMs are commonly protected by prompt-level security mechanisms, recent researches show that these controls can be bypassed through carefully crafted inpu...

Tamás Girászi, Natália Papp, Norbert Oláh et al. · 0 citations
#software testing Open access Sep 2026

LLM-Assisted Porting of Security-Critical C Libraries to Idiomatic Rust: A Multi-Model Empirical Study

Differential fuzzing reveals complementary bugs in the manual and LLM porting of security-critical C libraries to idiomatic Rust and translates these findings into concrete practical guidance for teams planning a similar migration.

Marco Parrillo, Marco Grassi, Luigi Laura · 0 citations
#artificial intelligence Preprint Oct 2026

Beware EviLLM: Enabling Vulnerability Injection via Large Language Models

Advances in large language models (LLMs) have enabled AI-driven code generation from natural language specifications, introducing new attack surfaces for injecting vulnerabilities into software. Prior work has studied this problem only in benign settings where vulnerabilities are introduced inadvertently, or under unco...

Zeezoo Ryu, S. Chung, M. F. Karim et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.