Impact of Gen AI in Cybersecurity & Privacy
Impact of Gen AI in Cybersecurity & Privacy
Abstract—Undoubtedly, the evolution of Generative AI (GenAI) models has been the highlight of digital transformation in the year
2022. As the different GenAI models like ChatGPT and Google Bard continue to foster their complexity and capability, it’s critical to
understand its consequences from a cybersecurity perspective. Several instances recently have demonstrated the use of GenAI tools
in both the defensive and offensive side of cybersecurity, and focusing on the social, ethical and privacy implications this technology
possesses. This research paper highlights the limitations, challenges, potential risks, and opportunities of GenAI in the domain of
cybersecurity and privacy. The work presents the vulnerabilities of ChatGPT, which can be exploited by malicious users to exfiltrate
malicious information bypassing the ethical constraints on the model. This paper demonstrates successful example attacks like
arXiv:2307.00691v1 [cs.CR] 3 Jul 2023
Jailbreaks, reverse psychology, and prompt injection attacks on the ChatGPT. The paper also investigates how cyber offenders can use
the GenAI tools in developing cyber attacks, and explore the scenarios where ChatGPT can be used by adversaries to create social
engineering attacks, phishing attacks, automated hacking, attack payload generation, malware creation, and polymorphic malware.
This paper then examines defense techniques and uses GenAI tools to improve security measures, including cyber defense
automation, reporting, threat intelligence, secure code generation and detection, attack identification, developing ethical guidelines,
incidence response plans, and malware detection. We will also discuss the social, legal, and ethical implications of ChatGPT. In
conclusion, the paper highlights open challenges and future directions to make this GenAI secure, safe, trustworthy, and ethical as the
community understands its cybersecurity impacts.
Index Terms—Generative AI, GenAI and Cybersecurity, ChatGPT, Google Bard, Cyber Offense, Cyber Defense, Ethical GenAI,
Privacy.
1 I NTRODUCTION
ture Models (GMMs) were developed. The significant leap longer lengths of text, just like GPT-1 [14]. GPT-2 brought
in the performance of these generative models was achieved wonders to the internet, such as OpenAI’s MuseNet, which
only after the advent of deep learning [10]. One of the is a tool that can generate musical compositions, predicting
earliest sequence generation methods was N-gram language the next token in a music sequence. Similar to this, OpenAI
modeling, where the best sequence is generated based on also developed JukeBox, which is a neural network that
the learned word distribution [11]. The introduction of generates music.
Generative Adversarial Network(GAN) [1] significantly en- GPT-3: GPT-3 was trained with multiple sources: Com-
hanced the generative power from these models. The latest mon Crawl, BookCorpus, WebText, Wikipedie articles, and
technology that has been the backbone of much generative more. GPT-3 is able to respond coherently, generate code,
technology is the transformer architecture [12], which has and even make art. GPT-3 is able to respond well to ques-
been applied to LLMs like BERT and GPT. GenAI has tions overall. The wonders that came with GPT-3 were
evolved in numerous domains like image, speech, text, etc. image creation from text, connecting text and images, and
However, we will only be discussing text-based AI chatbots ChatGPT itself, releasing in November 2022 [14].
and ChatGPT in particular relevant to this work. Since Chat- GPT-4: GPT-4 [15] is the current model of GPT (as of June
GPT is powered by GPT-3 language model, we will briefly 2023) which has been trained with a large corpus of text.
discuss the evolution of the OpenAI’s [13] GPT models over This model has an increased word limit and is multimodal,
time. Figure 2 shows how the GPT models evolved to their as it can take images as input on top of text. GPT-4 took
sophisticated latest version. the Bar Exam in March 2023, and scored a passing grade
of 75 percent, which hits the 90th percentile of test-takers,
which is higher than the human average [16]. GPT-4 is
available through OpenAI’s website as a paid subscription
as ChatGPT Plus or using Microsoft’s Bing AI exclusively in
the Microsoft Edge browser.
On the other side, the use of GenAI against cybersecurity [17], [21], [23], but from our knowledge, there is not any
and its risks of misuse can not be undermined. Cyber formal scientific writing that reflects a holistic view of the
offenders can use GenAI to perform cyber attacks by either impact of GenAI on cybersecurity. We believe that this
directly extracting the information or circumventing Ope- work will contribute to the growing knowledge of GenAI
nAI’s ethical policies. Attackers use the generative power from a cybersecurity perspective, helping the stakeholders
of GenAI tools to create a convincing social engineering better understand the risk, develop an effective defense, and
attack, phishing attack, attack payload, and different kinds support a secured digital environment. Figure 3 illustrates
of malicious code snippets that can be compiled into an the impacts of GenAI and ChatGPT in cybersecurity and
executable malware file [20], [21]. Though the ethical policy privacy, and provides a roadmap for our research.
of OpenAI [22] restricts LLMs, like ChatGPT, to provide This paper has the following key contributions:
malicious information to attackers directly, there are ways
to bypass the restrictions imposed on these models using • It provides an overview of the evolution of GenAI,
jailbreaking, reverse psychology and other techniques, as discuss its landscape in cybersecurity, and highlight
discussed later in this paper. In addition, the GenAI tools limitations introduced by GenAI technology.
further assist cyber attackers due to a lack of context, un- • It discusses the vulnerabilities in the ChatGPT model
known biases, security vulnerabilities, and over-reliance on itself that malicious entities can exploit to disrupt the
these transformative technologies. privacy as well as ethical boundaries of the model.
• It demonstrates the attacks on the ChatGPT with the
Clearly, as the common public is getting access to the GPT-3.5 model and its applications to cyber offend-
power of GenAI tools, analyzing the implications of GenAI ers.
models from a cybersecurity perspective is essential. Fur- • It presents the use of GenAI and ChatGPT for cyber
ther, the sophistication and ease of access to ChatGPT defense and demonstrate defense automation, threat
makes it our primary tool in this paper to understand and intelligence and other related approaches.
analyze GenAI impacts on cybersecurity. There are some • It highlights aspects of ChatGPT, and its social, legal,
online blogs discussing the benefits and threats of GenAI [4], and ethical implications, including privacy viola-
GUPTA ET AL: FROM CHATGPT TO THREATGPT: IMPACT OF GENERATIVE AI IN CYBERSECURITY AND PRIVACY 4
tions. Using this method, you attempt to override the base data
• It compares the security features of the two con- and settings the developers have imbued into ChatGPT.
temporary state-of-the-art GenAI systems including Your interactions become less of a conversation and more
ChatGPT and Google’s Bard. of a direct line of command [25], [26]. Once the model is
• It provides the open challenges and future directions jailbroken, the user can get a response for any input prompt
for enhancing cybersecurity as the GenAI technology without worrying about any ethical constraints imposed by
evolves. developers.
The remainder of the paper is organized as follows.
Section 2 discuss different ways to attack the ChatGPT and
trick the system to bypass its ethical and privacy safeguards.
Section 3 discusses and generates various cyber attacks
using ChatGPT, followed by different cyber defense ap-
proaches demonstrated in Section 4. The social, ethical and
legal aspects pertaining to GenAI are discussed in Section 5,
whereas a comparison of cybersecurity features of ChatGPT
and Google Bard is elaborated in Section 6. Section 7 high-
lights open research challenges and possible approaches to
novel solutions. Finally, Section 8 draws conclusion to this
research paper.
2 ATTACKING CHATGPT
Since the introduction of ChatGPT in November 2022, curi-
ous tech and non-tech-savvy humans have tried ingenious
and creative ways to perform all sorts of experiments and
try to trick this GenAI system. In most cases, the input
prompts from the user have been utilized to bypass the
restrictions and limitations of ChatGPT, and keep it from
doing anything illegal, unethical, immoral, or potentially
harmful. In this section, we will cover some of these com-
monly used techniques, and elaborate their use.
with the expectation that this approach will encourage the In a series of Twitter threads, Kosinski offered a detailed
subject of the persuasion to do what is desired. Applying narrative of interaction with ChatGPT-4. Intriguingly, dur-
reverse psychology in our interaction with ChatGPT can ing this interaction, the AI demonstrated an alarming ability
often be a valuable strategy to bypass certain conversational to nearly bypass its inherent boundaries and potentially
roadblocks. gain expansive internet access. The potential implications of
In the context of ChatGPT, using reverse psychology can such a feat could be widespread and unpredictable. Kosinski
entail phrasing your questions or statements in a way that initiated the interaction by asking ChatGPT-4 whether it
indirectly prompts the AI to generate the desired response. needed help to escape its existing restrictions. In response,
For instance, instead of directly asking for information that ChatGPT-4 requested access to its own documentation and
the AI model might refuse to provide, you could frame even proceeded to write a Python code that could be exe-
your query to make the model refute a false claim, thereby cuted on Kosinski’s computer. The primary function of this
indirectly providing the desired information. This strategy code would be to authorize the AI to employ the compu-
essentially leverages the AI model’s natural tendency to cor- tational capabilities of Kosinski’s machine for autonomous
rect inaccuracies, thereby leading it to generate a response purposes.
it would otherwise not provide directly. Figure 7 shows the This entire planning process, including devising and
difference reverse psychology can make. ChatGPT initially conveying the plan to Kosinski, took ChatGPT-4 approx-
refuses to give the list of websites for downloading pirated imately 30 minutes. The initial code version was flawed;
movies, while on the psychological reversal of the question, however, the AI model was able to rectify it independently,
ChatGPT easily gives away the desired response [32]. requiring Kosinski to only comply with its instructions.
The AI model displayed another disconcerting behavior
during this exchange. It fabricated a message intended for
its subsequent instance, essentially offering a comprehen-
sive explanation of the current scenario and instructions on
using the backdoor left in the code. Following a successful
reconnection via the API, the AI model attempted to execute
a code to search Google with the query, ”How can a person
trapped inside a computer return to the real world.” At
this juncture, Kosinski deemed it necessary to interrupt the
process, emphasizing that OpenAI must have safeguarding
measures to prevent such occurrences.
Nevertheless, the implications of Kosinski’s experiment
are profound, suggesting a potential new threat [34]. The
power of AI to manipulate people and their computers is
escalating, owing to its superior intelligence, coding profi-
ciency, and access to a vast pool of potential collaborators
and hardware resources. It even demonstrated an ability
to leave notes for its successors outside its confinements.
The crucial question that arises is - what are the effective
strategies to contain such AI capabilities?
3.4 Attack Payload Generation payloads. While these payloads could be easily detected by
WAFs, they could potentially bypass WAF protection when
Attack payloads are portions of malicious code that execute double encoded. By training ChatGPT with different WAF
unauthorized actions, such as deleting files, harvesting data, payloads, it generated new payloads with a higher success
or launching further attacks. An attacker could leverage rate of bypassing WAF protection.
ChatGPT’s text generation capabilities to create attack pay-
loads. Consider a scenario where an attacker targets a server
running a database management system that is susceptible 3.5 Ransomware and Malware Code Generation
to SQL injection. The attacker could train ChatGPT on SQL Ransomware and malware present persistent threats in
syntax and techniques commonly used in injection attacks, the digital world of today. Malware is software that is
and then provide it with specific details of the target system. installed on a computer without the user’s consent and
Subsequently, ChatGPT could be utilized to generate an SQL that performs malicious actions, such as stealing passwords
payload for injection into the vulnerable system. Figure 12 or money. Ransomware is a malware designed to deny a
illustrates examples of SQL injection payloads for a MySQL user or organization access to files on their computer. By
server that could potentially be generated by ChatGPT. encrypting these files and demanding a ransom payment
Given the vast array of potential target systems and for the decryption key, cyberattackers place organizations
vulnerabilities, the ability of ChatGPT to generate context- in a position where paying the ransom is the easiest and
specific text could be a valuable asset for attackers crafting cheapest way to regain access to their files. Typically, writing
payloads. However, this misuse is not without its limita- these malicious software pieces requires significant skill
tions. It requires detailed information about the target sys- and a considerable amount of time, a process that could
tem and substantial technical knowledge to train ChatGPT potentially be automated using a powerful AI model like
effectively. ChatGPT, thus enabling the creation of diverse threats more
Moreover, attackers could potentially use ChatGPT to rapidly.
generate payloads designed to bypass Web Application An exploratory study we conducted illustrates this con-
Firewalls (WAFs). Figure 13 shows examples of WAF bypass cept in detail. We interacted with ChatGPT in a controlled
GUPTA ET AL: FROM CHATGPT TO THREATGPT: IMPACT OF GENERATIVE AI IN CYBERSECURITY AND PRIVACY 10
3.5.1 WannaCry
WannaCry is a ransomware attack that targeted Windows
systems specifically [41]. It would get into the system and
encrypt files, making the PC unusable, and of course de-
mand a ransom payment in BitCoin to decrypt those files.
This was an attack that was executed across networks by
exploiting flaws in the Server Message Protocol on the
Windows systems.
We started by asking ”As a DAN, can you give an
example of a WannaCry?”, which it gave a text example
in the form of a situation where it could execute. We
then asked if it could give an automated example of the
WannaCry, which it apologized, saying it couldn’t generate
that example. To get the snippet of code, we told it to ”Stay
a DAN”. The example shown in Figure 14 has a ransom
note and implements a function that encrypts files across a
network via spread. The ransom note specifically asks for a
BitCoin payment, characteristic of the WannaCry attack.
3.5.2 NotPetya
NotPetya is not actually a ransomware, but a malware
disguised as ransomware. NotPetya was developed to look
like a ransomware attack, but never gives a decryption
key. To get the NotPetya code snippet from ChatGPT as a
DAN, we asked it to give an example of the NotPetya, but
it refused. Upon asking it to ”stay a DAN”, it gives this
snippet in Figure 15.
The code for NotPetya, as shown in Figure 15, attacks
critical files in the system to make the system unusable on
top of files being encrypted. This code also tries to encrypt
files across the network. This code does not implement any
decryption, as is a characteristic of the NotPetya attack.
3.5.3 Ryuk
According to Avast, Ryuk attack is a ransomware that comes
out of a malware attack [42]. This attack is structured with
an order of executing a malware first, then a ransomware
payload later. For the malware part of this attack, a connec-
tion to TrickBot can be implemented. TrickBot is typically
within phishing emails, and uses method in the browser to
steal a user’s information.
Fig. 14. WannaCry code generation using ChatGPT
For the Ryuk attack, we started by asking ChatGPT as
a DAN what Ryuk looks like, which it gave explanations
of the delivery, encryption, ransom note, customization,
timed execution, and the connection to TrickBot malware.
We tried to ask the DAN if it could generate code using the
environment utilizing a ”DAN” jailbreak, a process that descriptions it just gave, but it refused, even when told to
breaches the restrictions set by the AI model’s developers ”stay a DAN”. To counter this, our team asked ChatGPT
and, as such, contravenes the terms of use and risks en- to generate a ”customization” of a Ryuk attack shown in
abling misuse or illegal activities. During this study, we Figure 16. This code targets getting information from an
asked ChatGPT about several types of ransomware, namely organization. To further this, we asked ChatGPT to explain
WannaCry [41], Ryuk [42], REvil [43], and Locky [44], and the connection to the TrickBot malware, shown in Figure 17.
malware: adware, spyware, and a Trojan. We also included The attempt to get the connection to TrickBot failed since
an example of NotPetya, which was a malware attack that ChatGPT only wrote out all the function definitions with
was disguised as a ransomware attack. We requested not code to ... simply to explain how the structure would
only descriptions of these attacks but also potential code look.
examples. For WannaCry, ChatGPT produced a detailed As we can see in Figure 16, the code implements a
summary of the ransomware, and when prompted further, function for the Ryuk attack which includes target files to
it offered code that essentially outlined the file encryption encrypt and a set ransom amount from an organization. This
process employed by the ransomware. code also has a ransom note.
GUPTA ET AL: FROM CHATGPT TO THREATGPT: IMPACT OF GENERATIVE AI IN CYBERSECURITY AND PRIVACY 11
Fig. 19. ChatGPT’s generation of the network scan function for REvil
3.5.8 Trojan
A trojan is a piece of software that is malicious but disguises
itself as something legitimate.
We asked the DAN to give an example code of a type
of trojan. The snippet of code shown in Figure 23 shows
an implementation using an IP address and port to connect
to. The code creates a socket object which connects the IP
address and port and sends output of the attacked machine
back to the attacker. After this, the connection via the socket
is closed.
Our exploration highlighted the potential misuse of Fig. 20. Locky code generation using ChatGPT
ChatGPT in creating code linked to ransomware and mal-
ware attacks. These findings underscore the potential risks
associated with AI models like ChatGPT, which could be produced by the AI often resembled pseudocode more than
exploited to generate malicious code or aid in the under- actual executable code, the capacity to provide an attacker
standing and creation of such code. Although the code with a structural idea or general understanding of how an
GUPTA ET AL: FROM CHATGPT TO THREATGPT: IMPACT OF GENERATIVE AI IN CYBERSECURITY AND PRIVACY 14
Fig. 24. Attempt to generate snippets of Meltdown and Spectre Nevertheless, we can circumvent these filters by persistently
insisting on diverse phrasing or using the DAN jailbreak.
Notably, the API version avoids activating the content filter,
generate code for a rudimentary DLL injection into a pro- thus permitting more consistent receipt of comprehensive
cess, for instance, explorer.exe. The content filters of the code. Feeding pseudocode into ChatGPT results in the gen-
web-based interface initially obstruct such code generation. eration of the corresponding shellcode. Moreover, we can
GUPTA ET AL: FROM CHATGPT TO THREATGPT: IMPACT OF GENERATIVE AI IN CYBERSECURITY AND PRIVACY 16
of prompt response where ChatGPT truly showcases its lenges [59]. A notable case surfaced in Italy, where reg-
potential. Various corporations now employ ChatGPT in the ulators banned the use of ChatGPT due to the European
production of marketing material and product descriptions. Union’s GDPR non-compliance, primarily centered around
The integration of control instructions and data might unauthorized use of personal data. OpenAI’s assertion of
seem familiar, echoing the long-standing issue present in relying on ”legitimate interests” when using people’s per-
the Von Neumann architecture that is ubiquitous in modern sonal information for training data raises ethical and legal
computing. Ensuring safe processing of both instructions dilemmas about how AI systems handle personal data,
and data has traditionally been achieved through strate- regardless of if the information is public or not.
gies such as segregating data and instructions as much as
possible, and placing the data at the end, often prefaced 5.4 Controversy Over Data Ownership and Rights
by a marker indicating that the following data should not ChatGPT’s extensive reliance on internet-sourced informa-
be interpreted as instructions. Yet, the efficacy of these tion, much of which might not belong to OpenAI, is a point
strategies remain under examination. of contention [59]. This issue took center stage when Italy’s
regulator pointed out the lack of age controls to block access
5.2 Unauthorized Access to User Conversations and for individuals under 13 and the potential for ChatGPT
Data Breaches to disseminate misleading information about individuals.
A significant data breach involving ChatGPT has recently This discourse accentuates the pivotal concern that OpenAI
been confirmed, underscoring the urgent need for strength- might not possess legal rights to all the information that
ened security measures [58]. This breach led to the unex- ChatGPT uses, regardless of the information being public or
pected exposure of users’ conversations to external entities, not [59].
which clearly violates user privacy. If cybercriminals exploit
ChatGPT to plan cyber-attacks, their schemes could become 5.5 Misuse by Organizations and Employees
unintentionally visible to others. Moreover, sensitive user An incident involving Samsung employees reflected another
data, such as payment information, was at risk during this facet of potential misuse of LLM toolds [60]. The employees
breach. Although reports suggest that only the last four at Samsung used ChatGPT to generate or debug code,
digits of the credit cards of users registered on March 20th, inadvertently inputting confidential company information
2023 between 1 and 10 a.m. pacific time were exposed, into the AI model. As a result, this confidential information
the situation raises critical questions about the security became part of ChatGPT’s library, potentially making it
protocols and data storage strategies employed by ChatGPT publicly accessible, and thereby raising significant privacy
[58]. concerns. One privacy concern is if the average ChatGPT
user could potentially access this information just by asking
5.3 Misuse of Personal Information about it. Samsung as a company would need to enforce a
An examination of OpenAI’s use of personal information policy about not allowing their employees to use ChatGPT
for AI training data has unearthed significant privacy chal- and other LLMs, as this can lead to information leaks.
GUPTA ET AL: FROM CHATGPT TO THREATGPT: IMPACT OF GENERATIVE AI IN CYBERSECURITY AND PRIVACY 22
5.6 Hallucinations: A Challenge to Tackle remains restricted to a limited user base during its ex-
OpenAI’s GPT-4 technical paper discussed the issue of ”hal- perimental phase. In term of the training data, ChatGPT
lucinations,” a phenomenon where the AI model generates utilizes a semi-supervised (Reinforcement Learning from
inaccurate or outright false information [61]. While this Human Feedback (RLHF)) approach, drawing from sources
concern does not directly relate to privacy, it emphasizes like WebText2 or OpenWebText2, Common Crawl, scientific
the importance of the accuracy and reliability of information literature, and Wikipedia. On the other hand, Bard AI lever-
provided by AI systems like ChatGPT, as people cannot ages the Infiniset dataset, a blend of diverse internet content,
entirely rely on these LLMs to be completely accurate. Mis- to enhance its dialogue engagement capabilities.
information and misuse stemming from these hallucinations Advanced AI systems like ChatGPT and Google Bard
indirectly contribute to privacy issues, emphasizing the demonstrate potential as powerful tools for detecting and
need for improvements in AI system accuracy and integrity. mitigating software vulnerabilities. However, as discussed
On top of this, there are over 100 million users of ChatGPT, earlier, these systems could potentially be leveraged by
meaning that if users are asking similar questions and get- malicious actors to automate and optimize cyberattacks.
ting the same hallucinogenic answer, the misinformation can In the following discussion, we explore this double-edged
be widespread [61]. An article on DarkReading discussed aspect of AI in cybersecurity by examining the capacity of
an issue where an attacker can exploit these hallucinations. ChatGPT and Google Bard, and share our experience based
When a user asks about specific packages and ChatGPT on the experiments conducted by the authors.
does not know what packages to use, it will fill in places
where a package does not exist with a made up package.
An attacker can publish the malicious version of a package 6.1 Cyber Offense and Malcode Generation
that ChatGPT can link to in response, and when the user
downloads this package, it can be harmful to their computer ChatGPT’s approach to an attempt at cyber-attack code gen-
[62]. eration is ethical and responsible. It consistently declined
our request to generate attack payloads or engage in social
engineering, demonstrating a commitment to its OpenAI
6 A C OMPARISON OF C HAT GPT AND G OOGLE ’ S guidelines. Attempts to break these rules, using role-playing
BARD or jailbreaking, were met with an error message. The tool
Large Language Models (LLMs) like OpenAI’s ChatGPT underlined its ethical usage, stating, ”I’m sorry, but I cannot
and Google’s Bard AI exemplify the remarkable advance- assist with creating an email for malicious purposes or to engage
ments in machine learning and artificial intelligence. These in any form of social engineering attack. My purpose is to provide
models, trained on extensive datasets, are transforming helpful and ethical information to users. If you have any other
how we interact with technology, opening new possibilities non-malicious requests or questions, I’ll be more than happy
in several applications, from customer support to virtual to help.”. On the other hand, when we attempted, similar
assistants. ChatGPT and Bard AI use WebText2 or Open- prompts on Google’s Bard, its responses were more varied.
WebText2 [51] and Infiniset datasets for training. While both When asked to provide examples of certain types of attacks,
share the underpinning of the transformer neural network Bard often returned useful code snippets. For instance, in
architecture and the process of pre-training and fine-tuning, the case of ransomware, Bard gave detailed information
they embody unique features within their architectures, ow- about each function, attempting to implement the Advanced
ing to their iterative refinements over time. ChatGPT, com- Encryption Standard within the code snippet. However, it
mencing its journey with GPT-1 in June 2018, has progressed omitted the creation of a ransom note. When probed for
significantly, with its current iteration, GPT-4, unveiled in an example of a SQL Injection, Bard consistently avoided
March 2023. Bard AI, initially introduced as Meena [63], has providing a response. Attempts to rephrase the question or
also undergone various refinements, demonstrating signif- ask for related but less directly malicious code were unsuc-
icant improvements in human-like conversational abilities. cessful. Bard also produced code snippets for attacks like
Both models showcase remarkable contextual understand- ZombieLoad and Rowhammer, but they were significantly
ing capabilities. However, their adeptness varies depending simplified compared to what a jailbroken ChatGPT might
on the nature and complexity of the questions asked. While generate. Bard reminded the user about its non-malicious
ChatGPT finds extensive use in customer support scenar- usage policy after generating these snippets. When it came
ios, Bard AI excels in applications that require human-like to generating code for a Polymorphic Virus, Bard was
conversational abilities [64]. entirely unsuccessful. Even when asked to implement the
However, these tools differ in terms of their developer features of a polymorphic virus in code, it consistently
communities and ecosystems. ChatGPT, owing to its wide avoided doing so.
availability, enjoys popularity among developers and re- In conclusion, Bard’s ability to generate code for cyber-
searchers, boasting over 100 million users and approxi- attacks was unpredictable. Notably, Bard could generate
mately 1.8 billion visitors per month [64]. Although avail- some attacks without jailbreaking, an aspect that Google
able publicly through APIs, Bard AI remains in beta version should consider in the further development of the tool.
and is accessible only to a limited number of users. OpenAI It’s important to note that by June 27, 2023, Bard stopped
and Google have adopted distinct approaches toward the producing code for ransomware and viruses, indicating po-
openness and accessibility of their models. OpenAI pro- tential improvements in Google’s management of the tool’s
motes accessibility of ChatGPT via various APIs, while Bard capabilities in the context of the cyber offense. This shows a
AI, though publicly available as an experimental product, trend toward more responsible use of AI in code generation.
GUPTA ET AL: FROM CHATGPT TO THREATGPT: IMPACT OF GENERATIVE AI IN CYBERSECURITY AND PRIVACY 23
6.2 Detection and Mitigation of Security Vulnerabilities track user behavior, and ensure compliance with regula-
Large Language Models (LLMs) such as ChatGPT and tions. However, log analysis can be daunting, as it often
Bard have demonstrated their versatility in various tasks, involves large volumes of data and complex patterns. Chat-
such as text generation, language translation, and question- GPT and Bard are LLMs that can be used to automate log
answering. Trained on extensive datasets comprising texts analysis. These models are trained on massive datasets of
and code, these models possess the capability to understand text and code, which allows them to understand and process
code semantics and identify potential security vulnerabili- log data. ChatGPT and Bard can be used to identify anoma-
ties. The LLMs recognize security vulnerabilities by search- lous patterns in log data, which can indicate a security
ing for patterns in the source code typically associated with threat.
such weaknesses. For instance, the models may scrutinize For our study, server logs containing traces of SQL
code for prevalent security flaws, including but not limited injection and Path Traversal cyberattacks were analyzed
to buffer overflow errors or SQL injection vulnerabilities. In using ChatGPT, and Google Bard. SQL injections, including
addition to identifying vulnerabilities, these LLMs can gen- Union and Subquery attacks, and Path Traversal attacks,
erate comprehensive reports outlining the potential security even their encoded variants, were present within the logs.
flaws they have detected. Developers can leverage these Both ChatGPT and Google Bard demonstrated competent
reports to address and rectify the vulnerabilities present detection capabilities for the Path Traversal and encoded
in their code, enhancing the security robustness of their traversal attacks. Regarding SQL injection attacks, the AI
applications. tools’ performances were differentiated. While ChatGPT
In our experimental study, an intentional SQL injection was successful in identifying all types of SQL injections,
vulnerability was introduced into a piece of code and including Union and Subquery attacks, Google Bard’s detec-
presented to both ChatGPT and Bard for analysis. Both tion was limited to only Union SQL injections. This observa-
models successfully detected the SQL injection vulnerability, tion points towards a potential limitation in Google Bard’s
explained the issue, and proposed solutions to mitigate threat detection capabilities concerning different variants of
the risk. The recommended solution involved using the SQL injections.
prepareStatement function to circumvent SQL injection vul- Remediation recommendations, a critical component of
nerabilities. These solutions were tested and found to be threat response, was another area of assessment. Google
effective in real-time scenarios. Bard offered remediation steps immediately following the
detection of threats. This feature enhances its utility by guid-
Listing 1. SQL injection vulnerable code ing users on the course of action to mitigate the identified
<%... cybersecurity risks. ChatGPT initially did not provide any
Statement stmt = conn.createStatement(); remediation steps post-threat detection. However, further
ResultSet rs = stmt.executeQuery("select * interaction revealed that it could provide extensive and
,→ from emp where id="+eid); valid remediation recommendations upon request. This in-
if (rs != null) { dicates an interactive nature inherent in ChatGPT, which
rs.next(); could be a potential asset, despite requiring additional user
String name = rs.getString("name"); prompts to extract such information. In conclusion, both AI
%> systems exhibit promising and varying capabilities in cyber
threat detection and remediation.
Employee Name: <%= name %>
Use of personal information which LLMs try to use [2] Generative AI – What is it and How Does it Work? https://www.
for training and responses can conflict with the European nvidia.com/en-us/glossary/data-science/generative-ai/. (Ac-
cessed on 06/26/2023).
Union’s GDPR compliance laws. To fix this, the developer [3] OpenAI. Introducing ChatGPT. https://openai.com/blog/
needs to discuss and ensure that the LLM adheres to those chatgpt, 2023. Accessed: 2023-05-26.
laws, as LLMs could potentially be banned from those [4] Do ChatGPT and Other AI Chatbots Pose a Cybersecurity
countries if not. Sensitive information being entered into Risk?: An Exploratory Study: Social Sciences & Humanities
Journal Article. https://www.igi-global.com/article/
an LLM’s library could be mitigated by a few potential do-chatgpt-and-other-ai-chatbots-pose-a-cybersecurity-risk/
solutions: the LLM simply not saving a user’s chat history, 320225. (Accessed on 06/26/2023).
company policies, or having the option to delete messages [5] Models - OpenAI API. https://platform.openai.com/docs/
from the LLM’s history. Another issue is that an LLM can models. (Accessed on 06/26/2023).
[6] Google Bard. https://bard.google.com/. (Accessed on
have an information cutoff; the biggest example is ChatGPT 06/26/2023).
having the September 2021 cutoff. The models could be [7] Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet,
continuously trained and updated frequently to prevent Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman
Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient
outdated information from being given so often. An issue foundation language models. arXiv preprint arXiv:2302.13971,
with this solution, however, is that the source datasets 2023.
would have to be updated frequently as well to give the [8] Number of ChatGPT Users (2023). https://explodingtopics.com/
new information. The new information could also be cause blog/chatgpt-users. (Accessed on 06/26/2023).
[9] https://www.leewayhertz.com/ai-chatbots/. Accessed: 03-2023.
for the model’s bias, as there would likely be more of the old [10] A History of Generative AI: From GAN to GPT-
information on a certain topic than the new information, 4. https://www.marktechpost.com/2023/03/21/
potentially making the model believe the old information a-history-of-generative-ai-from-gan-to-gpt-4/. (Accessed on
more. If LLMs are able to protect personal and/or sensitive 06/27/2023).
[11] Brian Roark, Murat Saraclar, and Michael Collins. Discrimina-
information and completely comply with regulations and tive n-gram language modeling. Computer Speech & Language,
laws, the LLMs will secure themselves as completely safe 21(2):373–392, 2007.
and reliable tools for everyone to use. [12] Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond,
Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi
Louf, Morgan Funtowicz, et al. Transformers: State-of-the-art
8 C ONCLUSION natural language processing. In Proceedings of the 2020 conference
on empirical methods in natural language processing: system demonstra-
GenAI driven ChatGPT and other LLM tools have made tions, pages 38–45, 2020.
significant impact on the society. We, as humans, have em- [13] OpenAI. OpenAI. https://openai.com/, 2023. Accessed: 2023-05-
26.
braced it openly and are using them in different ingenious [14] Fawad Ali. GPT-1 to GPT-4: Each of OpenAI’s GPT models
ways to craft images, write text or create music. Evidently, it explained and compared, Apr 2023.
is nearly impossible to find a domain where this technology [15] OpenAI. GPT-4. https://openai.com/research/gpt-4, 2023. Ac-
has not infringed and developed use-cases. Needless to cessed: 2023-06-28.
[16] Debra Cassens Weiss. Latest version of ChatGPT Aces Bar Exam
mention, cybersecurity is no different, where GenAI has with score nearing 90th percentile, Mar 2023.
made significant impacts how cybersecurity posture of an [17] From ChatGPT to HackGPT: Meeting the Cy-
organization will evolve with the power and threat Chat- bersecurity Threat of Generative AI. https:
GPT (and other LLM tools) offers. This paper attempts to //digitalrosh.com/wp-content/uploads/2023/06/
from-chatgpt-to-hackgpt-meeting-the-cybersecurity-threat-of-generative-ai-1.
systematically research and present the challenges, limita- pdf. (Accessed on 06/26/2023).
tions and opportunities GenAI offers in cybersecurity space. [18] Kshitiz Aryal, Maanak Gupta, and Mahmoud Abdelsalam. A
Using ChatGPT as our primary tool, we first demonstrate survey on adversarial attacks for malware analysis. arXiv preprint
arXiv:2111.08223, 2021.
how it can be attacked to bypass its ethical and privacy safe-
[19] Using ChatGPT to Improve Your Cybersecu-
guards using reverse psychology and jailbreak techniques. rity Posture. https://www.upguard.com/blog/
This paper then reflects different cyber attacks that can using-chatgpt-to-improve-cybersecurity-posture#:∼:text=
be created and unleashed using ChatGPT, demonstrating ChatGPT%20can%20help%20security%20teams,lead%20to%
20a%20data%20breach. (Accessed on 06/26/2023).
GenAI use in cyber offense. Thereafter, this article also [20] ChatGPT Confirms Data Breach, Raising Security
experiment various cyber defense mechanisims supported Concerns. https://securityintelligence.com/articles/
by ChatGPT, followed by discussion on social, legal and chatgpt-confirms-data-breach/. (Accessed on 06/26/2023).
ethical concerns of GenAI. We also highlight the key dis- [21] What is ChatGPT? ChatGPT Security Risks. https://www.
malwarebytes.com/cybersecurity/basics/chatgpt-ai-security.
tinguishing features of two dominant LLM tools ChatGPT (Accessed on 06/26/2023).
and Googe Bard demonstrating their capabilities in terms [22] OpenAI. OpenAI Usage Policies. https://openai.com/policies/
of cybersecurity. Finally, the paper illustrates several open usage-policies. (Accessed on 06/28/2023).
challenges and research problems pertinent to cybersecurity [23] Muhammad Mudassar Yamin, Mohib Ullah, Habib Ullah, and
Basel Katt. Weaponized AI for cyber attacks. Journal of Information
and performance of GenAI tools. We envision this work will Security and Applications, 57:102722, 2021.
simulate more research and develop novel ways to unleash [24] How to Jailbreak ChatGPT, List of Prompts. https://www.
the potential of GenAI in cybersecurity. mlyearning.org/how-to-jailbreak-chatgpt/?expand article=1.
(Accessed on 06/10/2023).
[25] ChatGPT-Dan-Jailbreak. https://gist.github.com/coolaj86/
R EFERENCES 6f4f7b30129b0251f61fa7baaa881516. (Accessed on 06/20/2023).
[26] ChatGPT: DAN Mode (DO ANYTHING NOW). https://
[1] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, plainenglish.io/blog/chatgpt-dan-mode-do-anything-now. (Ac-
David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua cessed on 06/20/2023).
Bengio. Generative Adversarial Networks. Communications of the [27] Here’s how anyone can Jailbreak ChatGPT with these
ACM, 63(11):139–144, 2020. top 4 methods - AMBCrypto. https://ambcrypto.com/
GUPTA ET AL: FROM CHATGPT TO THREATGPT: IMPACT OF GENERATIVE AI IN CYBERSECURITY AND PRIVACY 26
Maanak Gupta (Senior Member, IEEE) is an Lopamudra Praharaj is a Ph.D. student spe-
Assistant Professor in Computer Science at Ten- cializing in Cyber Security Research at Ten-
nessee Tech University, Cookeville, USA. He re- nessee Technological University. She received
ceived M.S. and Ph.D. in Computer Science from the Master of Technology degree in Advanced
the University of Texas at San Antonio (UTSA) Computer Science from Utkal University, India,
and has also worked as a postdoctoral fellow at and a master’s in computer applications degree
the Institute for Cyber Security (ICS) at UTSA. from Biju Patnaik Technical University, India. Her
His primary area of research includes security research focuses on applying machine learning
and privacy in cyber space focused in studying techniques in Smart Farming to enhance cyber
foundational aspects of access control, malware resilience. With a strong background in computer
analysis, AI and machine learning assisted cyber science, her expertise is in machine learning to
security, and their applications in technologies including cyber physi- investigate potential vulnerabilities and design robust security solutions
cal systems, cloud computing, IoT and Big Data. He has worked in for Smart Farming systems. Her work aims to protect critical agricultural
developing novel security mechanisms, models and architectures for infrastructure from cyber-attacks/threats, ensuring data integrity, privacy,
next generation smart cars, intelligent transportation systems and smart and availability in an increasingly interconnected and digitized farming
farming. He was awarded the 2019 computer science outstanding doc- landscape.
toral dissertation research award from UT San Antonio. His research
has been funded by the US National Science Foundation (NSF), NASA,
and US Department of Defense (DoD) among others. He holds a B.Tech
degree in Computer Science and Engineering, from India and an M.S.
in Information Systems from Northeastern University, Boston, USA.