Research Article

An Empirical Study of Security Risks for the Web Code Generation by ChatGPT

Mingrui Hu*
School of Computer Engineering, Zhanjiang University of Science and Technology, No. 1 Xuezhi Road, Mazhang District, Zhanjiang City, Guangdong, China

* Corresponding author: [email protected]

Abstract

Large language models (LLMs) have demonstrated remarkable capabilities in code generation and semantic understanding, enabling ordinary users to generate their own software systems using natural language instructions. This study takes website systems as a case to investigate a user-centered paradigm for code generation and its evaluation. First, users submit their requirements to the LLM via a web interface, prompting the model to automatically generate website project code. Then, through a set of prompt engineering methods and quantitative evaluation techniques developed for this study, we conduct a multi-dimensional assessment of the quality and security of the generated website systems using different types of LLMs and varying system function weights. A hybrid evaluation strategy is proposed to integrate and optimize assessment results across different LLMs. Evaluation dimensions include the degree to which user requirements are satisfied, completeness of website functionality, potential security risks, and code reliability. This research introduces evaluation criteria such as automated review models, functional coverage, and static vulnerability analysis to explore the feasibility, advantages, and limitations of using LLMs as both code generators and reviewers. The findings contribute to our understanding of the practical value of multi-agent LLM collaboration in software development and reveal major current challenges such as functional hallucination, incomplete implementation, and overly optimistic evaluation mechanisms.

Keywords: LLM; Code Generation; PHP; Web Vulnerability; Software Development
Published: October 2, 2025
DOI: 10.54254/2755-2721/2025.AST27451
Volume: ACE Vol.197
pp. 23-33
Download PDF

References

  1. Jiang, J., Wang, F., Shen, J., Kim, S., & Kim, S. (2024). A survey on large language models for code generation. arXiv preprint arXiv: 2406.00515.
  2. Liu, J., Xia, C. S., Wang, Y., & Zhang, L. (2023). Is your code generated by ChatGPT really correct? Rigorous evaluation of large language models for code generation. In Advances in Neural Information Processing Systems.
  3. Abbassi, A. A., Da Silva, L., Nikanjam, A., & Khomh, F. (2025). Unveiling inefficiencies in LLM-generated code: Toward a comprehensive taxonomy. arXiv preprint arXiv: 2503.06327.
  4. Gu, Q. (2023). LLM-based code generation method for Golang compiler testing. In Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (pp. 2201–2203).
  5. Yin, X., Ni, C., Li, X., Chen, L., Ma, G., & Yang, X. (2025). Enhancing LLM’s ability to generate more repository-aware unit tests through precise contextual information injection. arXiv preprint arXiv: 2501.07425.
  6. Joel, S., Wu, J. J. W., & Fard, F. H. (2024). A survey on LLM-based code generation for low-resource and domain-specific programming languages. arXiv preprint arXiv: 2410.03981.
  7. Anonymous. (2025, July). Anthropic AI breakthrough vibe coding revolution 2025? Business Insider.
  8. Anonymous. (2025, July 11). AI coding tools made some engineers less productive. Business Insider.
  9. Wikipedia contributors. (2025, June 12). Slopsquatting. Wikipedia, The Free Encyclopedia. Retrieved from https: //en.wikipedia.org/wiki/Slopsquatting
  10. Wikipedia contributors. (2022, January 15). Hallucination (artificial intelligence). Wikipedia, The Free Encyclopedia. Retrieved from https: //en.wikipedia.org/wiki/Hallucination_(artificial_intelligence)