A Study of Vulnerability Repair in JavaScript Programs with Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Le, Tan Khang, Alimadadi, Saba, Ko, Steven Y.
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910374938279936
author Le, Tan Khang
Alimadadi, Saba
Ko, Steven Y.
author_facet Le, Tan Khang
Alimadadi, Saba
Ko, Steven Y.
contents In recent years, JavaScript has become the most widely used programming language, especially in web development. However, writing secure JavaScript code is not trivial, and programmers often make mistakes that lead to security vulnerabilities in web applications. Large Language Models (LLMs) have demonstrated substantial advancements across multiple domains, and their evolving capabilities indicate their potential for automatic code generation based on a required specification, including automatic bug fixing. In this study, we explore the accuracy of LLMs, namely ChatGPT and Bard, in finding and fixing security vulnerabilities in JavaScript programs. We also investigate the impact of context in a prompt on directing LLMs to produce a correct patch of vulnerable JavaScript code. Our experiments on real-world software vulnerabilities show that while LLMs are promising in automatic program repair of JavaScript code, achieving a correct bug fix often requires an appropriate amount of context in the prompt.
format Preprint
id arxiv_https___arxiv_org_abs_2403_13193
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle A Study of Vulnerability Repair in JavaScript Programs with Large Language Models
Le, Tan Khang
Alimadadi, Saba
Ko, Steven Y.
Cryptography and Security
Artificial Intelligence
In recent years, JavaScript has become the most widely used programming language, especially in web development. However, writing secure JavaScript code is not trivial, and programmers often make mistakes that lead to security vulnerabilities in web applications. Large Language Models (LLMs) have demonstrated substantial advancements across multiple domains, and their evolving capabilities indicate their potential for automatic code generation based on a required specification, including automatic bug fixing. In this study, we explore the accuracy of LLMs, namely ChatGPT and Bard, in finding and fixing security vulnerabilities in JavaScript programs. We also investigate the impact of context in a prompt on directing LLMs to produce a correct patch of vulnerable JavaScript code. Our experiments on real-world software vulnerabilities show that while LLMs are promising in automatic program repair of JavaScript code, achieving a correct bug fix often requires an appropriate amount of context in the prompt.
title A Study of Vulnerability Repair in JavaScript Programs with Large Language Models
topic Cryptography and Security
Artificial Intelligence
url https://arxiv.org/abs/2403.13193