Computer ScienceOriginal ResearchPublished December 3, 2026 · 25 views8 downloadsDOI 10.66308/air.e23845482

Hidden security risks of AI-generated code in frontend applications: a risk-oriented analysis

Senior Angular Frontend Developer, Saint Petersburg, Russia
* Corresponding author: Margarita Yakovleva, margarita.iiakovleva@gmail.com
Received November 2, 2026Accepted December 1, 2026
AI-generated codefrontend securityverificationJavaScriptDOM XSSAPI
Download PDF
Cover: Hidden security risks of AI-generated code in frontend applications: a risk-oriented analysis

Abstract

The increasing use of generative artificial intelligence (AI) in frontend development necessitates security verification of the generated code. This study aims to develop an approach that links frontend code areas, security properties, their status under standard checks, and methods of additional verification. The study is based on an analysis of scientific publications and OWASP documentation, as well as a secondary analysis of publicly available empirical data. Five non-mutually exclusive areas were identified: rendering and the DOM; URLs and navigation; forms and user input; client-side state and browser storage; and API interactions. Security properties and corresponding verification methods were defined for each area. Three verification statuses are proposed: “checked,” “not checked,” and “unknown.” In SecurityEval, manual inspection detected the targeted security weaknesses in 73.85% of cases, compared with 18.46% for CodeQL and 10.77% for Bandit. In the study by Spracklen et al., the average rate of nonexistent package generation for JavaScript was 21.3%, whereas a later replication by Churilov using a different cohort of models reported rates of 2.62–3.78% (preprint). The priority of additional verification is proposed to be determined by the potential consequences of violating a security property, without introducing a numerical risk index. The approach enables verification methods to be selected according to the specific security property being assessed.

Keywords: AI-generated code, frontend security, verification, JavaScript, DOM XSS, API

Cite asMargarita Yakovleva (2026). Hidden security risks of AI-generated code in frontend applications: a risk-oriented analysis. American Impact Review. https://doi.org/10.66308/air.e23845482Copy