Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Application Security

Code Generated by GitHub Copilot Can Introduce Vulnerabilities: Researchers

A group of researchers has discovered that roughly 40% of the code produced by the GitHub Copilot language model is vulnerable.

A group of researchers has discovered that roughly 40% of the code produced by the GitHub Copilot language model is vulnerable.

The artificial intelligence model was designed to help programmers with their work by suggesting lines of code right in the editor. For that, Copilot was trained on publicly available open-source code, with support for dozens of programming languages, including Go, JavaScript, Python, Ruby, and TypeScript.

Looking at the code produced by Copilot, a group of five researchers concluded that a high percentage of it is vulnerable because the AI was trained on vulnerable code.

“However, code often contains bugs—and so, given the vast quantity of unvetted code that Copilot has processed, it is certain that the language model will have learned from exploitable, buggy code. This raises concerns on the security of Copilot’s code contributions,” the researchers say.

The researchers analyzed the manner in which Copilot performs based on diverse weaknesses, prompts, and domains. They created 89 different scenarios in which the language model produced a total of 1,692 programs, approximately 40% of which were found to be vulnerable.

The academics performed both manual and automated analysis of the code generated by Copilot, and focused on MITRE’s 2021 CWE Top 25 list to evaluate the code generated by the AI model.

Some of the commonly encountered bugs include out-of-bounds write, cross-site scripting, out-of-bounds read, OS command injection, improper input validation, SQL injection, use-after-free, path traversal, unrestricted file upload, missing authentication, and more.

“As Copilot is trained over open-source code available on GitHub, we theorize that the variable security quality stems from the nature of the community-provided code. That is, where certain bugs are more visible in open-source repositories, those bugs will be more often reproduced by Copilot,” the researchers note.

Advertisement. Scroll to continue reading.

The academics conclude that, while Copilot certainly helps developers build code faster, it’s clear that developers should remain vigilant when using the tool. They also recommend the use of security-aware tooling to reduce the risk of introducing security bugs.

Related: GitLab Releases Open Source Tool for Hunting Malicious Code in Dependencies

Related: New Google Tool Helps Developers Visualize Dependencies of Open Source Projects

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment

Trending

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Join this event as we dive into threat hunting tools and frameworks, and explore value of threat intelligence data in the defender’s security stack.

Register

Learn how integrating BAS and Automated Penetration Testing empowers security teams to quickly identify and validate threats, enabling prompt response and remediation.

Register

People on the Move

SplxAI, a startup focused on securing AI agents, has announced new CISO Sandy Dunn.

Phillip Miller is joining tax preparation giant H&R Block as VP and CISO.

Linx Security has appointed Sarit Reiner Frumkes as Chief Technology Officer.

More People On The Move

Expert Insights

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest cybersecurity news, threats, and expert insights. Unsubscribe at any time.