## 5 Discussion
### Analysis of Traditional Security Methodologies Versus AI-Based Approaches  
Traditional tools and methodologies for addressing security in software development often focus on static testing and static code analysis. These practices involve manual code review by developers, or the use of automated tools that scan code for known vulnerabilities. Figure 6: Visual Basic.NET code for deleting records from the user table of the database. Figure 7: Overview of the SQL injection attack. ties. However, recent research found that 32% of web applications contained high-severity security vulnerabilities, even after static code analysis [37]. These data reflect the persistence of vulnerabilities in web applications, despite standard security practices. In contrast, the methodology based on AI code generation introduces an innovative and automated approach to vulnerability detection. Rather than relying solely on static testing, this methodology uses AI models to generate code, which can assist in identifying and mitigating vulnerabilities more efficiently and accurately [38]. This is because AI models can analyze large amounts of code and learn security patterns, to avoid the introduction of common vulnerabilities. This enables them to scale seamlessly to handle increasingly complex software systems. A comparative analysis of the approach carried out with ChatGPT, with respect to other LLMs, can be seen in Table 2, where several indicators of performance can be found. The different LLMs exhibit varying degrees of proficiency in identifying risks within the generated code. In this sense, there are instances where LLMs detect fewer risks compared to ChatGPT, while they identify more in other scenarios. This difference highlights the risk in code generation tasks, indicating that the quality and security can significantly depend on the model utilized and the specific programming task. Moreover, the analysis indicates that ChatGPT and Copilot demonstrate robust scalability, as evidenced by their consistent performance in generating code and detecting risks, contributing to the overall security in different contexts. In contrast, Gemini exhibits limitations in certain scenarios, including the inability to generate code and lower efficacy in risk detection in specific tasks. Such findings underscore the importance of the thorough evaluation and comparison of codes in real-world applications, to ensure robust and secure software development practices. For instance, numerous vulnerabilities have been identified within the script provided by ChatGPT in Figure 2. Pertaining to low-severity issues, shortcomings in error handling and input validation were observed, potentially leading to unexpected system behavior and susceptibility to SQL injection attacks. Moderately concerning are deficiencies in password  
\begin{table}
\begin{tabular}{p{56.9 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline  
management practices (e.g., the lack of a clear password policy and the usage of simplistic password examples), which could compromise the integrity of user credentials. However, of heightened concern are the absence of authentication mechanisms for database access, the potential use of insecure password hashing algorithms, and the exposure of sensitive user information through auto-incremented user IDs. The revised code made with ChatGPT addresses various security concerns compared to the original version, but still requires improvements for optimal system security. Password storage is strengthened with hashing and salt, yet susceptibility to brute force attacks remains, if weak hashing algorithms or predictable passwords are used. Although the hashed password length is increased, adequacy depends on the hashing algorithm and security practices. Similarly, the salt field's length may need adjustment. Also, explicit error handling is absent, necessitating robust management for system resilience. Furthermore, the absence of a password policy and explicit input validation exposes vulnerabilities to potential attacks.