Denial of wallet
| Class | Availability and abuse |
|---|---|
| Also known as | DoW; LLMjacking when the target is a cloud-hosted AI model |
| OWASP | LLM10:2025 Unbounded Consumption; API4:2023 Unrestricted Resource Consumption |
| MITRE ATT&CK | T1496.004 Resource Hijacking: Cloud Service Hijacking |
| Typical severity | High |
| Affects | Accounts billed per request: AI model APIs, cloud platforms, email and SMS gateways, and application routes that call them |
AI model APIs, cloud platforms, and email and SMS gateways bill the account a request is made with, whoever makes it. In a denial of wallet (DoW) attack, someone else sends those requests and the account owner pays for the consumption. The way in is a leaked API key for an AI model or a cloud account, or a public route in an application that calls a paid service for anyone who sends a request.
Description
A large language model provider bills by the token, so long prompts and long answers cost more than short ones. Stolen access to AWS SES, AWS SNS, SendGrid or Twilio goes into spam sent on the victim's bill. Stolen access to cloud-hosted AI models is resold, a practice called LLMjacking. The attacker may first switch the service on in the victim's cloud account. Preventive controls do little here, because every request uses the service as designed.1
The spending also uses up the account's quotas, and once the provider's limit is reached the owner's own application can no longer call the model.2 An API that has no spending limit at its third-party provider, or a badly set one, has no ceiling on what an attacker can spend.3
Mechanism
Obtaining a key
Keys reach attackers in the ways described in Exposed credentials in source code repositories, Client-side code exposure and Abuse of leaked API keys: committed to a repository, shipped in browser JavaScript or a mobile build, or read from a compromised server. In the LLMjacking campaign Sysdig documented in May 2024, the attackers took cloud credentials from a server running a vulnerable version of the Laravel framework (CVE-2021-3129) and tested them against ten cloud AI services.2
To learn whether a stolen AWS key could call Claude models on Amazon Bedrock, they sent an InvokeModel request with an invalid token limit of -1. A ValidationException in reply meant the key had access; AccessDenied meant it had not. Their reverse proxy software, which let them sell model access without handing over the keys, refuses keys whose prompts are logged, so they also read the account's logging settings.2
Keys that gain access later
Google Cloud uses one key format, starting with AIza, both for keys placed in public web pages, such as Maps and Firebase keys, and for keys that authenticate paid calls. Truffle Security reported in February 2026 that switching on the Gemini API (the Generative Language API) in a project gives the existing keys of that project access to Gemini, unless a restriction limits them to other APIs. In the November 2025 Common Crawl archive of public web pages, the researchers found 2,863 live keys that Gemini accepted.4
Rate of spending
The ceiling is the provider's throughput limit. Sysdig worked out a worst case for Claude 2 on Bedrock: at a quota of 500,000 tokens a minute, an average of $0.016 per 1,000 tokens and four regions, the victim pays $46,080 a day.2
Notable incidents
On 3 March 2026 The Register reported on a three-developer company in Mexico whose Google Cloud API key was used by unknown people on 11 and 12 February 2026. In about 48 hours the key ran up $82,314.44, mostly on Gemini 3 Pro Image and Gemini 3 Pro Text; the company's usual spend was $180 a month. The developer deleted the key and opened a support case; by his account, Google cited its shared responsibility model and said the charges had to be paid.5
Detection
The first sign is often a paid service such as AWS SES, SNS or the OpenAI API being switched on, or called from an unusual region or by an unusual identity.1 On AWS, CloudTrail records each Bedrock InvokeModel call but not the prompt or the reply. Model invocation logging, sent to CloudWatch or S3, records both, with token counts. A run of ValidationException errors on InvokeModel can show someone testing a key.2
Prevention
Spending limits that stop traffic
A Google Cloud alerts-only budget sends email and leaves usage running.6 A spend cap budget pauses new usage of one service in one project once estimated costs pass 100% of the monthly amount, and the Gemini API is an eligible service. Enforcement is not instant, and the overage is billed.7 OpenAI separates spend alerts, which only notify, from hard spend limits, after which requests fail with HTTP 429 and the code project_spend_limit_exceeded or organization_spend_limit_exceeded. To set a hard limit on a project:8
- Open Project settings, then Limits.
- In Spend, select Edit spend limit and enter the Monthly spend limit.
- Turn on Enforce a hard limit and select Save.
Where a provider has no spending limit, set a billing alert in its place.3
Restricted keys
In the Google Cloud console, open the Credentials page, select the key, choose Restrict key under API restrictions, tick only the APIs the key is for and select Save. Add an application restriction as well, which limits the key to named websites, IP addresses or apps.9 A key found in public code is replaced, oldest keys first,4 by the steps in Responding to a leaked API key.
Limits on the application's own routes
A route that passes user input to a paid model lets anyone spend the key without seeing it. Give each user a rate limit and a quota, cap the input size, and put timeouts and throttling on expensive operations.10 At the least, the route checks the login, applies a rate limit per account and checks the input size before it calls the model:
// Before calling the model: refuse oversized input
const MAX_CHARS = 4000;
if (typeof prompt !== "string" || prompt.length > MAX_CHARS) {
return new Response("Input too long", { status: 413 });
}Prompt for a coding agent
Find every route, server action and function in this project that calls a paid API (AI model, email, SMS or anything billed per request). Make sure each one checks that the caller is logged in, applies a rate limit per account, rejects input above a fixed size before the paid call, and sets a timeout. Make sure no secret key for these services is in browser code, a mobile build or a variable that the framework copies into the browser. List each file you changed, and every key that should be restricted or given a spending limit at the provider.
In SecFlash
On the Security page, SecFlash reports a route that calls a paid service without a login check as SF-SEC-725, and a Google or Firebase key in the app's config files, whose restriction needs checking, as SF-SEC-729. On the Exposure page it reports API calls with no rate limit (SF-EXP-208), a secret key in public JavaScript (SF-EXP-301) or in a mobile build (SF-EXP-612), and a public key in a mobile build (SF-EXP-613).
See also
- Abuse of leaked API keys
- Exposed credentials in source code repositories
- Client-side code exposure
- Responding to a leaked API key
- Rate limiting
- Denial-of-service attack
- Cryptojacking
- Category: Availability and abuse
References
- a b "Resource Hijacking: Cloud Service Hijacking, T1496.004". MITRE ATT&CK. Version 1.0, last modified 15 April 2025.
- a b c d e Brucato, Alessandro (6 May 2024). "LLMjacking: Stolen Cloud Credentials Used in New AI Attack". Sysdig.
- a b OWASP (2023). "API4:2023 Unrestricted Resource Consumption". OWASP API Security Top 10.
- a b Leon, Joe (25 February 2026). "Google API Keys Weren't Secrets. But then Gemini Changed the Rules.". Truffle Security.
- back Lyons, Jessica (3 March 2026). "Dev stunned by $82K Gemini bill after unknown API key thief goes to town". The Register.
- back Google Cloud. "Create, edit, or delete budgets and budget alerts". Cloud Billing documentation.
- back Google Cloud. "Manage spend cap budgets". Cloud Billing documentation.
- back OpenAI. "Spend limits". OpenAI API documentation.
- back Google Cloud. "Manage API keys". Authentication documentation.
- back OWASP GenAI Security Project (2025). "LLM10:2025 Unbounded Consumption". OWASP Top 10 for LLM Applications.
External links
- Resource Hijacking, T1496, MITRE ATT&CK