CCyberwiki

LLMjacking

LLMjacking
ClassAvailability and abuse, Secrets
MITRE ATT&CKT1496.004 Cloud Service Hijacking
First describedMay 2024, Sysdig Threat Research
Typical severityHigh
AffectsAPI keys and cloud credentials that can call hosted models: OpenAI, Anthropic, AWS Bedrock, Azure OpenAI, Google Vertex AI and others

A hosted language model answers anyone who presents a valid key and sends the bill to the account that owns it. LLMjacking is the use of a stolen API key or cloud credential to run such a model on someone else's account.1 Sysdig's researchers gave the attack its name in May 2024, after watching stolen cloud credentials being tested against ten AI services so that the access could be sold on while the account owner paid.2 It is a form of Denial of wallet and of Abuse of leaked API keys in which what the attacker takes is model time.

Finding and testing keys

The keys come from the leaks described in Exposed credentials in source code repositories and Client-side code exposure. In that first case the attackers broke into a server running a Laravel version vulnerable to CVE-2021-3129 and copied the cloud credentials stored on it.2 Later research added keys left in software packages in public repositories3, and Microsoft found a group using customer credentials scraped from public websites.4

Stolen keys are checked in bulk before anyone uses them. The script recovered from the attack tried each credential against AI21 Labs, Anthropic, AWS Bedrock, Azure, ElevenLabs, MakerSuite, Mistral, OpenAI, OpenRouter and Vertex AI, and ran no real prompts: it asked only what each key could reach and what quota it had.2

On AWS the probe was a call to InvokeModel with max_tokens_to_sample set to -1, an invalid value. A ValidationException in reply told the attacker the key could reach the model and the model was switched on; AccessDenied would have meant no access. The attackers then read the account's logging settings with GetModelInvocationLoggingConfiguration, because prompts and answers do not appear in CloudTrail and are recorded only when model invocation logging is set up.2 By September 2024 attackers were also switching on models the account had not enabled, and some deleted the logging settings instead of avoiding keys that had them, a form of Disabled and deleted logs.1

Proxies and resale

A pool of stolen keys is sold through a Reverse proxy. The open source OAI Reverse Proxy holds the keys and passes buyers' requests on to the providers, so buyers get model access without seeing a credential. It refuses AWS keys that have prompt logging on.2 Chat front ends such as SillyTavern take a proxy address instead of a provider key.1

By February 2025 researchers had found more than 20 such proxies, with links passed around on Discord, 4chan and Rentry pages. One sold 30 days of access for $30. Another held 55 DeepSeek keys. DeepSeek-R1 was released on 20 January 2025 and added to a forked proxy the next day.3

About 95 percent of the prompts captured in mid-2024 were role-play. Other buyers wanted a model their provider had banned them from, or lived in a country under sanctions, such as a Russian user reaching Claude through stolen AWS credentials.1

Cost to the owner

Models are billed per token, so the bill follows the attacker's volume. Sysdig put the worst case for Claude 2 at $46,080 a day, from 500,000 tokens a minute at the quota limit in four Regions.2 With Claude 3 Opus the estimate rose above $100,000 a day. Of more than 85,000 attacker requests to Bedrock observed, 61,000 came in a three-hour window on 11 July 2024.1 The $30 proxy above had passed 2.2 billion tokens in 4.5 days, an estimated cost of almost $50,000.3

The quota is shared: once the attacker reaches the limit, the owner's own application gets refused as well.2

Storm-2139

In December 2024 Microsoft sued ten unnamed defendants in the Eastern District of Virginia over abuse of the Azure OpenAI Service.5 The group had logged in with exposed customer credentials scraped from public websites, changed what the services would produce, and resold access with instructions for generating harmful content.4 An amended complaint in February 2025 named four developers, in Iran, the United Kingdom, Hong Kong and Vietnam, at the centre of a network Microsoft tracks as Storm-2139. Creators built the tools, providers modified and sold them, and end users generated content that included non-consensual intimate images of celebrities.5

Signs in the logs

The abuse is ordinary API traffic on a valid key, so it shows up as unusual use: calls from unauthorized Regions or under identities that do not fit the account.6 On AWS the following CloudTrail events from the source bedrock.amazonaws.com marked the attacks described in 2024.21

Table 1. Bedrock events seen in LLMjacking
EventWhat it showed
InvokeModel with error ValidationExceptionA key being tested with an invalid parameter
GetModelInvocationLoggingConfigurationA check whether prompts are being recorded
ListFoundationModels, GetFoundationModelAvailabilityA list of the models the account can reach
PutFoundationModelEntitlement, PutUseCaseForModelAccessModels being switched on
DeleteModelInvocationLoggingConfigurationPrompt logging being turned off
InvokeModel, InvokeModelStream, Converse, ConverseStreamPrompts being run

Converse does not write an InvokeModel entry, so an alert on InvokeModel alone misses it.1 Model invocation logging is off by default; it is turned on under Settings, Model invocation logging in the Bedrock console and records each request and response to CloudWatch Logs or S3.7

Reducing exposure

An AI provider key belongs on a server. A key in browser or mobile code can be copied by any visitor, so requests go through the application's own backend, which holds the key.8 At OpenAI a project key can carry an expiry date, an administrator can enforce a maximum key lifetime, and an IP allowlist rejects requests from other addresses even when the key is valid.8 Temporary credentials, described in Short-lived credentials and OIDC federation, take the place of long-lived access keys.3

An OpenAI spend limit with hard enforcement blocks requests past the limit; a spend alert alone does not stop traffic.8 The settings per provider are in Spending limits and budget alerts. On AWS, access to many Bedrock models is on by default, and the first call to a third-party model starts its subscription automatically; model access can be blocked with a service control policy or an IAM policy.9 A key that has leaked is replaced at once, following Responding to a leaked API key.

In SecFlash

SecFlash reports an AI or cloud key in the repository as SF-SEC-702, or in an agent config file as SF-SEC-718, on the Security page, and a key served in public JavaScript as SF-EXP-301 on the Exposure page. A readable .env file is SF-EXP-307. A server route that calls a paid AI service with no login check is SF-SEC-725, and a Google or Firebase key in the app's config files, which reaches paid AI APIs when unrestricted, is SF-SEC-729, both on the Security page.

See also

References

  1. a b c d e f g Sysdig Threat Research Team (18 September 2024). "The Growing Dangers of LLMjacking: Evolving Tactics and Evading Sanctions". Sysdig.
  2. a b c d e f g h Brucato, Alessandro (6 May 2024). "LLMjacking: Stolen Cloud Credentials Used in New AI Attack". Sysdig Threat Research.
  3. a b c d Sysdig Threat Research Team (7 February 2025). "LLMjacking targets DeepSeek". Sysdig.
  4. a b Masada, Steven (10 January 2025). "Taking legal action to protect the public from abusive AI-generated content". Microsoft On the Issues.
  5. a b Microsoft (27 February 2025). "Disrupting a global cybercrime network abusing generative AI". Microsoft On the Issues.
  6. back MITRE (created 25 September 2024, modified 15 April 2025). "Resource Hijacking: Cloud Service Hijacking, T1496.004". MITRE ATT&CK.
  7. back Amazon Web Services. "Monitor model invocation using CloudWatch Logs and Amazon S3". Amazon Bedrock User Guide.
  8. a b c OpenAI. "Best practices for API key safety". OpenAI Help Center.
  9. back Amazon Web Services. "Access Amazon Bedrock foundation models". Amazon Bedrock User Guide.