arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.14459cs.SEcs.AI
收藏

Web开发中的大语言模型:评估LLM生成的PHP代码以揭示漏洞与局限性

LLMs in Web Development: Evaluating LLM-Generated PHP Code Unveiling Vulnerabilities and Limitations

University of Oslo(奥斯陆大学)

Rebeka Tóth, Tamas Bisztray, László Erdodi

AI总结:

本研究通过混合检测方法评估2500个GPT-4生成的PHP网站的安全性,发现大量高危漏洞,公开相关数据集并强调生成式AI用于软件开发需严格安全测试。

摘要:

本研究评估大语言模型生成的Web应用代码的安全性,分析了2500个由GPT-4生成的PHP网站。这些网站被部署在Docker容器中,采用Burp Suite主动扫描、静态分析结合人工审查的混合方法进行漏洞检测。本研究重点识别GPT-4生成的PHP代码中的不安全文件上传、SQL注入、存储型XSS和反射型XSS漏洞,分析揭示了这类代码在真实场景中部署的潜在安全风险与影响。总体而言,分析共发现2440个存在漏洞的参数。根据Burp扫描结果,11.56%的网站可被直接攻破。结合静态扫描结果,26%的网站至少存在一个可通过Web交互利用的漏洞。某些编码场景(如文件上传功能)的不安全率高达78%,凸显了软件安全面临的重大风险。为支持后续研究,我们已公开所有样本的源代码及详细漏洞记录。本研究强调,若在软件开发中使用生成式AI技术,必须开展全面的测试与评估。

英文摘要:

This study evaluates the security of web application code generated by Large Language Models, analyzing 2,500 GPT-4 generated PHP websites. These were deployed in Docker containers and tested for vulnerabilities using a hybrid approach of Burp Suite active scanning, static analysis, and manual review. Our investigation focuses on identifying Insecure File Upload, SQL Injection, Stored XSS, and Reflected XSS in GPT-4 generated PHP code. This analysis highlights potential security risks and the implications of deploying such code in real-world scenarios. Overall, our analysis found 2,440 vulnerable parameters. According to Burp's Scan, 11.56% of the sites can be straight out compromised. Adding static scan results, 26% had at least one vulnerability that can be exploited through web interaction. Certain coding scenarios, like file upload functionality, are insecure 78% of the time, underscoring significant risks to software safety and security. To support further research, we have made the source codes and a detailed vulnerability record for each sample publicly available. This study emphasizes the crucial need for thorough testing and evaluation if generative AI technologies are used in software development.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑