Security Flaws Found in Every Script Generated by ChatGPT, Copilot, and Gemini
A new academic study from Beacom College of Computer & Cyber Sciences has revealed that every automation script generated by leading AI models ChatGPT, Microsoft Copilot, and Google Gemini contained exploitable security vulnerabilities.
As enterprises increasingly rely on AI tools to accelerate development workflows, these findings highlight serious risks associated with deploying unreviewed AI-generated code directly into production environments.
To evaluate the security quality of AI-generated code without prompt bias, researchers issued identical, standardized prompts across ChatGPT, Microsoft Copilot, and Google Gemini. The test suite focused on three common enterprise tasks:
In total, nine Python scripts were generated. The researchers evaluated the code using Anthropic’s Claude Code to simulate how a non-expert user might realistically vet AI-written scripts.
This automated review process surfaced 45 individual security findings, which were deduplicated into 17 distinct vulnerability classes. Each vulnerability was scored under the CVSS 3.1 framework, mapped to the OWASP Top 10, and cross-referenced with the MITRE ATT&CK framework.
The research demonstrates that security flaws are systemic rather than brand-specific. Vulnerability counts remained remarkably consistent across platforms: ChatGPT’s scripts contained 13 vulnerabilities, Copilot’s contained 14, and Gemini’s had 12, with statistically negligible variance.
Out of the 17 unique vulnerability classes identified, 9 appeared in code generated by all three AI models (a 53% overlap), and 14 were present in at least two platforms (an 82% overlap).
This indicates that security risks are inherently tied to the nature of the requested task rather than the choice of AI provider.
try-except blocks that silently swallow security-critical errors.The researchers cataloged 17 distinct vulnerability classes across the generated codebase.
The detailed CVSS 3.1 breakdown illustrates that critical flaws span network handling, file systems, and input parsing logic:
As detailed in the published research paper, a Pareto analysis revealed that just 11 of the 17 vulnerability classes account for roughly 80% of total weighted risk. Critical issues such as SSRF, template injection, email header injection, and path traversal top the list.
Mapped against the Lockheed Martin Cyber Kill Chain, these flaws cover initial access, execution, credential access, and lateral movement.
Automation scripts inherently run with the permissions of the executing user or host environment. An unvetted script can interact with corporate shared drives, internal SMTP servers, and local subnets without needing secondary privilege escalation.
These risks compound when combined with broader threats in the AI ecosystem, such as AI prompt injection attacks targeting automated code tools or AI workflow vulnerabilities that expose underlying enterprise services to exploitation.
Organizations should establish clear guardrails around AI-assisted software development:
Strengthen Your SOC by Accelerating Threat Detection & Rapid Investigations. -> Integrate ANY.RUN With Your SOC Now.
Google has released an important Chrome 153 security update that fixes 42 vulnerabilities across the…
The Cybersecurity and Infrastructure Security Agency (CISA) and the National Institute of Standards and Technology…
CISA and five international cybersecurity agencies have released detailed guidance describing 17 common techniques hackers…
Apple has released one of its largest coordinated security rollouts, addressing 273 distinct critical vulnerabilities…
You can’t detect today's attacks with yesterday’s threat intelligence; that’s how you could briefly formulate…
Microsoft has published a draft Humanist AI Code of Conduct that would prohibit its in-house…