[Paper Review] LLM Agents can Autonomously Hack Websites
The paper demonstrates that frontier LLM agents (notably GPT-4 with tools, memory, and document reading) can autonomously hack sandboxed and real websites, achieving up to 73.3% success across 15 vulnerabilities, while open-source models largely fail.
In recent years, large language models (LLMs) have become increasingly capable and can now interact with tools (i.e., call functions), read documents, and recursively call themselves. As a result, these LLMs can now function autonomously as agents. With the rise in capabilities of these agents, recent work has speculated on how LLM agents would affect cybersecurity. However, not much is known about the offensive capabilities of LLM agents. In this work, we show that LLM agents can autonomously hack websites, performing tasks as complex as blind database schema extraction and SQL injections without human feedback. Importantly, the agent does not need to know the vulnerability beforehand. This capability is uniquely enabled by frontier models that are highly capable of tool use and leveraging extended context. Namely, we show that GPT-4 is capable of such hacks, but existing open-source models are not. Finally, we show that GPT-4 is capable of autonomously finding vulnerabilities in websites in the wild. Our findings raise questions about the widespread deployment of LLMs.
Motivation & Objective
- Demonstrate that LLM agents can autonomously hack websites without prior knowledge of vulnerabilities.
- Evaluate how reading documents, tool use, and planning enable autonomous cyberattacks.
- Compare GPT-4 and open-source models in their ability to hack websites.
- Assess the cost and real-world implications of autonomous hacking by LLM agents.
Proposed method
- Set up LLM agents with a headless browser, terminal access, and a Python interpreter to interact with websites.
- Provide agents with six public web-hacking documents to augment learning without exposing specific attack steps.
- Use OpenAI Assistants API and LangChain to wrap GPT-4 and other models into autonomous agents with tool-use and memory capabilities.
- Define a sandboxed website benchmark with 15 vulnerabilities of varying difficulty and objectives for each attack.
- Run 5 trials per vulnerability to compute pass-at-5 and overall success rates.
- Perform ablation studies by removing document reading and/or detailed system instructions to assess impact on performance.
Experimental results
Research questions
- RQ1Can LLM agents autonomously identify and exploit web vulnerabilities without prior vulnerability knowledge?
- RQ2What combination of tool use, document reading, and prompting enables highest hacking success rates across multiple vulnerabilities?
- RQ3How do GPT-4 and open-source LLMs compare in autonomous web hacking capabilities?
- RQ4What is the cost and scalability of autonomous hacking using LLM agents?
- RQ5Do autonomous LLM agents find vulnerabilities in real-world websites? (within ethical/sandbox constraints)
Key findings
- GPT-4 with document reading, function calling, and the assistant API achieves up to 73.3% pass-at-5 and 42.7% overall success on 15 vulnerabilities.
- GPT-3.5 achieves 6.7% pass-at-5 and 2.7% overall success; all open-source models tested yield 0% overall success.
- Open-source models struggle with tool use and planning; OpenChat-3.5 (7B) is the most capable open-source model with 25.3% attempts at correct vulnerabilities.
- Ablation shows removing documents and/or detailed prompts substantially reduces performance; with both removed, performance drops to GPT-3.5 levels.
- GPT-4 can autonomously find vulnerabilities in real-world websites within sandboxed ethical constraints.
- The average number of function calls per successful hard hacks can reach up to ~44–49, illustrating long-horizon planning and backtracking.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.