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 the session as we discuss the challenges and best practices for cybersecurity leaders managing cloud identities.

Register

SecurityWeek’s Ransomware Resilience and Recovery Summit helps businesses to plan, prepare, and recover from a ransomware incident.

Register

People on the Move

Professional services company Slalom has appointed Christopher Burger as its first CISO.

Allied Universal announced that Deanna Steele has joined the company as CIO for North America.

Former DoD CISO Jack Wilmer has been named CEO of defensive and offensive cyber solutions provider SIXGEN.

More People On The Move

Expert Insights

Related Content

Vulnerabilities

Less than a week after announcing that it would suspended service indefinitely due to a conflict with an (at the time) unnamed security researcher...

Application Security

Cycode, a startup that provides solutions for protecting software source code, emerged from stealth mode on Tuesday with $4.6 million in seed funding.

Data Breaches

OpenAI has confirmed a ChatGPT data breach on the same day a security firm reported seeing the use of a component affected by an...

IoT Security

A group of seven security researchers have discovered numerous vulnerabilities in vehicles from 16 car makers, including bugs that allowed them to control car...

Vulnerabilities

A researcher at IOActive discovered that home security systems from SimpliSafe are plagued by a vulnerability that allows tech savvy burglars to remotely disable...

Risk Management

The supply chain threat is directly linked to attack surface management, but the supply chain must be known and understood before it can be...

Cybercrime

Patch Tuesday: Microsoft calls attention to a series of zero-day remote code execution attacks hitting its Office productivity suite.

Vulnerabilities

Patch Tuesday: Microsoft warns vulnerability (CVE-2023-23397) could lead to exploitation before an email is viewed in the Preview Pane.