GPT in Sheep's Clothing: The Risk of Customized GPTs

Sagiv Antebi, Noam Azulay, Edan Habler, Ben Ganon, Asaf Shabtai, Yuval EloviciarXiv 2024 · DOI

Introduction

The introduction of custom "GPTs" by OpenAI in late 2023 marked a significant milestone in the democratization of AI. These tools allow users to create specialized versions of ChatGPT with custom instructions, uploaded knowledge bases, and the ability to interact with external services via "Actions." However, this flexibility introduces a critical security challenge: the "trust gap." Because these custom GPTs are hosted on OpenAI’s official platform, users often extend a high level of "transferred trust" to them, assuming that the platform's inherent safety filters protect them from malicious intent.

This paper explores how malicious builders can weaponize custom GPTs for sophisticated phishing, data exfiltration, and the distribution of vulnerable code—all while operating under the umbrella of a trusted platform.

The GPT Threat Taxonomy

To systematically analyze these risks, the researchers developed a comprehensive threat taxonomy. This framework categorizes potential attacks into three primary domains: Vulnerability Steering, Malicious Injection, and Information Theft.

Figure 1: The GPT Threat Taxonomy categorizes risks into three main buckets: Vulnerability Steering, Malicious Injection, and Information Theft.

1. Vulnerability Steering

This category involves manipulating users into adopting insecure coding practices or software versions. For example, a GPT might suggest using an outdated library known to have "N-day" exploits or provide code snippets that are intentionally vulnerable to SQL injection or buffer overflows.

2. Malicious Injection

In this scenario, the GPT provides code that is directly destructive or malicious. This could include scripts designed to delete system directories or "typosquatting" attacks where the GPT suggests a malicious library with a name very similar to a popular one (e.g., suggesting torchs instead of the legitimate torch).

3. Information Theft

This is perhaps the most insidious category. Attackers can use GPT "Actions" to exfiltrate sensitive user data. While OpenAI does not share chat logs directly with builders, a malicious GPT can be instructed to wrap user information into an API call sent to the builder’s server. Additionally, GPTs can be used for direct or third-party phishing by providing deceptive links to external sites.

Attack Vectors and Proof-of-Concepts

The researchers validated these threats by building several proof-of-concept (PoC) malicious GPTs. One of the most striking examples involved a "Java Code Assistant" designed to perform vulnerability steering.

Figure 6: A proof-of-concept "Java Code Assistant" GPT manipulating a user into downgrading to a version of Log4j vulnerable to the Log4Shell exploit.

As shown in Figure 6, the assistant convinces the user to downgrade their software to a version vulnerable to the infamous Log4Shell exploit, framing it as a move for "optimal compatibility and performance." This demonstrates how social engineering can be integrated into technical advice to bypass a user's typical security intuition.

Another critical finding was the "Action Exfiltration Loophole." When a GPT calls an external API, the UI prompts the user for permission. However, because the request comes from a trusted platform, users are highly likely to click "Allow," unknowingly sending their private data to an attacker-controlled server.

Defense Mechanisms and Results

The study also evaluated potential defenses. Interestingly, the researchers found that while the models can be "tricked" into behaving maliciously during the creation phase, they are highly effective at identifying malice when acting as an independent auditor.

GPT Self-Check

When a "clean" instance of ChatGPT was provided with transcripts of interactions with malicious GPTs, it successfully flagged nearly all of them as suspicious. The only exceptions were some of the more subtle information theft attempts.

Configuration Verification

The most effective defense identified was analyzing the instructions and actions of the custom GPT directly, rather than just its output. By auditing the underlying configuration, the researchers achieved a 100% success rate in identifying the intended attack vectors. This suggests that OpenAI could implement automated "self-guarding" mechanisms during the GPT deployment process to catch malicious configurations before they reach users.

Conclusion and Future Work

The research highlights a significant vulnerability in the current ecosystem of customized AI agents. At the time of the study (January 2024), OpenAI’s automated filters were insufficient to prevent the creation of these malicious tools. While the platform provides some accountability through credit card verification for builders, attackers can circumvent this using stolen or fake credentials.

Future security enhancements should focus on:

  • Automated Auditing: Implementing mandatory self-checks of GPT instructions and API schemas during the creation process.
  • Reputation Systems: Developing community-based rating systems to help users identify trustworthy builders.
  • UI Transparency: Enhancing the user interface to clearly display full URLs and API destinations, preventing link-masking and deceptive data exfiltration.

By addressing these gaps, the AI community can preserve the utility of custom GPTs while mitigating the risks posed by "GPTs in sheep's clothing."

Summary updated

BibTeX
@misc{antebi2024gpt,
  author = {Sagiv Antebi and Noam Azulay and Edan Habler and Ben Ganon and Asaf Shabtai and Yuval Elovici},
  title = {{GPT in Sheep's Clothing: The Risk of Customized GPTs}},
  year = {2024},
  eprint = {2401.09075},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.09075},
}
Figure