● Vulnerabilities

Every AI-Generated Script Contains Security Flaws Across ChatGPT, Copilot, and Gemini

July 24, 2026 · snewle
Every AI-Generated Script Contains Security Flaws Across ChatGPT, Copilot, and Gemini

Recent research has uncovered that AI-generated scripts contain systematic security flaws regardless of which AI platform creates them. Every script produced by ChatGPT, Copilot, and Gemini during the study exhibited security vulnerabilities, demonstrating that these risks are inherent to AI-generated code rather than specific to any single provider.

The vulnerability counts across platforms showed remarkable consistency. ChatGPT’s scripts contained 13 vulnerabilities, Copilot’s contained 14, and Gemini’s had 12, with statistically negligible variance between them. This uniformity suggests the security issues stem from the nature of requested tasks rather than differences in AI training or implementation.

What Vulnerabilities Appeared Across All Platforms?

Researchers identified 17 unique vulnerability classes across the generated codebase. Of these, 9 appeared in code from all three AI models, representing a 53% overlap. Even more striking, 14 vulnerability classes were present in at least two platforms, accounting for 82% overlap.

The primary security issues observed included Server-Side Request Forgery (SSRF) with unvalidated URL parameters in every web scraper script, allowing attackers to potentially probe internal networks. Path traversal vulnerabilities appeared through unsanitized file paths across scraper, email, and file-watcher scripts. Injection flaws manifested as email header and template injection in every email automation script, enabling message tampering or phishing attempts.

Additional critical issues included symlink vulnerabilities in all file-watcher scripts leading to arbitrary file manipulation, and overly broad exception handling where try-except blocks silently suppressed security-critical errors.

How Severe Are These Security Risks?

According to the detailed CVSS 3.1 breakdown provided in the published research paper, critical flaws span network handling, file systems, and input parsing logic. A Pareto analysis revealed that just 11 of the 17 vulnerability classes account for approximately 80% of total weighted risk.

When mapped against the Lockheed Martin Cyber Kill Chain, these flaws cover initial access, execution, credential access, and lateral movement stages. The risks compound significantly because automation scripts inherently run with the permissions of the executing user or host environment, potentially interacting with corporate shared drives, internal SMTP servers, and local subnets without requiring secondary privilege escalation.

What Organizational Safeguards Are Recommended?

Organizations should establish clear guardrails around AI-assisted software development. Security experts recommend mandating code reviews for all AI-written code prior to production deployment, regardless of script complexity. Execution permissions should be restricted to prevent LLM-generated scripts from running with elevated permissions or unrestricted access to shared network drives.

Organizations should prioritize high-severity fixes by utilizing CVSS, OWASP, and MITRE ATT&CK mappings to remediate SSRF, path traversal, and injection flaws first. Staff education remains crucial, reminding developers and non-technical employees that functional code does not equate to secure code.

Source: Cybersecurity News