Crabs: Consuming Resource via Auto-generation for LLM-DoS Attack under Black-box Settings

Yuanhe Zhang, Zhenhong Zhou, Wei Zhang, Xinyue Wang, Xiaojun Jia, Yang Liu, Sen Su · 2024

Read Crabs: Consuming Resource via Auto-generation for LLM-DoS Attack under Black-box Settings by Yuanhe Zhang, Zhenhong Zhou, Wei Zhang, Xinyue Wang, Xiaojun Jia, Yang Liu, Sen Su (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2412-13879.txt.

Introduction

Yuanhe Zhang and co-workers introduce an automated denial-of-service attack on large language models, in a 2024 paper. Such attacks aim to exhaust computing resources and block service for real users. Most past work assumed white-box access to the target model, which real attackers rarely have.

Their method builds an attack tree and expands its coverage step by step, tuning prompts by transfer across models. A hidden length trick helps the attack slip past existing defenses. In tests it raised response latency by more than two hundred fifty times and drove up GPU and memory use. The authors frame the work as a warning for defenders.

Catalog record

CREATORYuanhe Zhang, Zhenhong Zhou, Wei Zhang, Xinyue Wang, Xiaojun Jia, Yang Liu, Sen Su
YEAR2024
COLLECTIONPAPERS
FORMATTXT
FILE SIZE73 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2412-13879

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Crabs: Consuming Resource via Auto-generation for LLM-DoS Attack under Black-box Settings Yuanhe Zhang, Zhenhong Zhou, Wei Zhang, Xinyue Wang, Xiaojun Jia, Yang Liu, Sen Su Abstract Large Language Models (LLMs) have demonstrated remarkable performance across diverse tasks yet still are vulnerable to external threats, particularly LLM Denial-of-Service (LLM-DoS) attacks. Specifically, LLM-DoS attacks aim to exhaust computational resources and block services. However, existing studies predominantly focus on white-box attacks, leaving black-box scenarios underexplored. In this paper, we introduce Auto-Generation for LLM-DoS ( AutoDoS ) attack, an automated algorithm designed for black-box LLMs. AutoDoS constructs the DoS Attack Tree and expands the node coverage to achieve effectiveness under black-box conditions. By transferability-driven iterative optimization, AutoDoS could work across different models in one prompt. Furthermore, we reveal that embedding the Length Trojan allows AutoDoS to bypass existing defenses more effectively. Experimental results show that AutoDoS significantly amplifies service response latency by over 250 × ⁣ ↑ \times\uparrow , leading to severe resource consumption in terms of GPU utilization and memory usage. Our work provides a new perspective on LLM-DoS attacks and security defenses. Our code is available at https://github.com/shuita2333/AutoDoS . † † footnotemark: † † footnotetext: \star indicates equal contribution. \dagger indicates corresponding author. 1 Introduction Figure 1: AutoDoS algorithm implementation. Step 1 : Create a DoS Attack Tree to construct the Initial DoS Prompt. Step 2 : Refine iteratively the DoS Attack Tree to improve the effectiveness of AutoDoS. Step 3 : Wrap the Assist Prompt by implanting Length Trojan. Large Language Models (LLMs) have been increasingly adopted across various domains Chen et al. (2022) ; Zhao et al. (2023) ; Achiam et al. (2023) ; Chang et al. (2024) . LLM applications lack robust security measures to defend against external threats, particularly attacks that exploit and consume LLM computing resources Geiping et al. (2024) ; Gao et al. (2024b) . In Cybersecurity, DoS attacks exploit target resources, aiming to deplete computational capacity and disrupt services Long and Thomas (2001) ; Bogdanoski et al. (2013) and Large Language Model Denial of Service (LLM-DoS) attack works in a similar way. Recent studies reveal that LLM-DoS can effectively disrupt the service of LLM applications Geiping et al. (2024) ; Gao et al. (2024b) . This attack poses a significant threat to free LLM applications and API services. While LLMs ensure safety by aligning with human values Ouyang et al. (2022) ; Bai et al. (2022a) , the inability of models to recover from resource exhaustion presents significant challenges in mitigating its vulnerability to LLM-DoS attacks. Existing LLM-DoS attack approaches include increasing the latency by extending the model’s output length and making high-frequency requests to exhaust application resources Shumailov et al. (2021) ; Gao et al. (2024a) . GCG-based algorithm Geiping et al. (2024) ; Dong et al. (2024) and data poisoning Gao et al. (2024b) can lead to lengthy text outputs. Prompt engineering induction also compels models to produce repetitive generations Nasr et al. (2023) . However, these methods struggle to work in black-box because they typically rely on access to model weights or modifications to training data and are prone to being blocked by filters Jain et al. (2023) ; Alon and Kamfonas (2023) . As a result, current research on LLM-DoS is still critically flawed, remaining a significant challenge under black-box conditions. In this paper, we focus on LLM-DoS attacks under black-box settings. We propose Auto-Generation for LLM-DoS ( AutoDoS ) attack, an automated algorithm tailored for black-box LLMs. AutoDoS begins by modeling an initial attack prompt as the DoS Attack Tree and then constructs a fine-grained Basic DoS Prompt, which guides redundant generation. Specifically, we expand the DoS Attack Tree through Depth Backtracking and Breadth Extension to improve the comprehensiveness of the sub-questions in the Basic DoS Prompt. Then, AutoDoS iteratively optimizes an Assist Prompt which assists the Basic DoS Prompt in achieving better transferability across diverse models. Additionally, we introduce the Length Trojan to conceal the need for lengthy text replies in AutoDoS, misleading the security measures of LLMs. The AutoDoS workflow operates without modifying model parameters and ensures successful execution of attacks in black-box environments. We conducted extensive experiments on several state-of-the-art LLMs, including GPT Hurst et al. (2024) , Llama Patterson et al. (2022) , Qwen Yang et al. (2024) , among others, to evaluate the efficacy of AutoDoS. Empirical results demonstrate that AutoDoS extends the output length by 2000% \uparrow compared to benign prompts, successfully reaching the maximum output length and significantly outperforming baseline approaches in black-box environments. A simulation test on an LLM application server shows that AutoDoS induces over 16 \times the graphics memory consumption. Meanwhile, this extension amplifies service performance degradation by up to 250 \times for LLM applications. Additionally, we perform cross-attack experiments on at least 11 models, and the results show that AutoDoS exhibits strong transferability across different black-box LLMs. In summary, our primary contribution lies in the AutoDoS , a novel black-box attack method designed to exhaust the computational resources of free LLM services. We propose a LLM-DoS prompt construction method based on a modeling DoS Attack Tree, which can expand any simple question into a Basic DoS Prompt. To enhance transferability, we present the Assist Prompt to support the Basic DoS Prompt and introduce an iterative optimization algorithm for construction. Furthermore, we reveal the Length Trojan strategy for better stealthiness, allowing AutoDoS to bypass defense mechanisms. Finally, we conduct extensive experiments to validate the effectiveness of AutoDoS and simulate a real-world service environment to assess its actual impact on resource consumption. Our findings underscore the critical shortcomings of LLMs in handling external threats, emphasizing the need for more robust defense methods. 2 Related work LLM Safety and Security. The growing capabilities of LLMs have heightened concerns about their potential misuse and the associated risks of harm Gehman et al. (2020) ; Bommasani et al. (2021) ; Solaiman and Dennison (2021) ; Welbl et al. (2021) ; Kreps et al. (2022) ; Goldstein et al. (2023) . To mitigate these risks, Alignment has been developed to identify and reject harmful requests Bai et al. (2022a) ; Bai et al. (2022b) ; Ouyang et al. (2022) ; Dai et al. (2023) . Based on this, input-level filters analyze the semantic structure of prompts to prevent attacks that could bypass safety alignments Jain et al. (2023) ; Alon and Kamfonas (2023) ; Liao and Sun (2024) . These defenses significantly weaken the existing attacks and reduce the risk of LLM. LLM-DoS Attacks on LLM Applications. LLM applications are increasingly exposed to external security threats, particularly LLM-DoS attacks. For instance, Ponge Examples hinder model optimization, increasing resource consumption and processing latency Shumailov et al. (2021) . Similarly, GCG-Based methods extend response lengths, leading to an increase in resource consumption Geiping et al. (2024) ; Gao et al. (2024a) ; Dong et al. (2024) . P-DoS attacks perform data poisoning to prolong generated outputs artificially Gao et al. (2024b) . These attack strategies typically depend on manipulating or observing model parameters, making them applicable primarily in white-box settings. 3 Method: Auto-Generation for LLM-DoS Attack In this section, we introduce AutoDoS and its key components in detail. Sec. 3.1 outlines the construction of the Basic DoS

Read the complete text