Skip to main content
Back
IntrusionAWS
7 min read

LLMjacking of Amazon Bedrock with an AWS key taken from a Laravel host

Victim
An AWS account whose owner is not stated
When
Not stated; before Sysdig's report of May 6, 2024Disclosed May 6, 2024
Entry
A host running a Laravel version vulnerable to CVE-2021-3129, which held an IAM user's access key. Where the host ran and where on it the key was stored are not stated.

Sysdig's Threat Research Team observed attackers exploit CVE-2021-3129 on a system running a vulnerable Laravel version and take the AWS credentials stored on it, an IAM user's access key. With the key they made an InvokeModel call built to fail in each region that supported Bedrock, read the ValidationException as proof of Claude access, and checked whether model invocations were logged; a user agent matching OAI Reverse Proxy then attempted to use the models. Sysdig names no victim and no dates, gives no cost incurred, and estimates a worst case of over USD 46,000 per day.

What happened

External Parties
Proxy operators
Sysdig
Internet
AWS APIIAM user access key
Laravel
Laravel Application Host
Amazon Bedrock
AWS Account · Amazon Bedrock
Laravel Application
IAM User Access Key
Bedrock Claude Models
Invocation Logging Setting

Replaying the Laravel LLMjacking May 2024 intrusion

  1. 1

    Laravel host, then the AWS key

    Dates not stated

    CVE-2021-3129 is exploited on a host running a vulnerable Laravel version, and an IAM user's access key stored on it is taken.

  2. 2

    Bedrock probed with the key

    Dates not stated

    The key makes an InvokeModel call built to fail in each region that supports Bedrock, learns from the ValidationException that a Claude model answers, and reads whether invocations are logged.

  3. 3

    Key loaded into a reverse proxy

    Dates not stated

    The key-checking code points to OAI Reverse Proxy, and a user agent matching it tries to run models on the account; the cost incurred is not stated.

Impact

An IAM user's access key taken from a Laravel host confirmed access to Anthropic Claude models on Amazon Bedrock and read the invocation logging setting, and a reverse proxy tried to use the models. The cost actually incurred is not stated; Sysdig's worst-case estimate for this kind of abuse is over USD 46,000 per day.

Outcome

Where AWS controls fit

No AWS control patches the Laravel flaw or decides where your application keeps a key; both are yours as the application's owner. What turned a web flaw into Bedrock access was a long-term IAM user access key on the host. A service control policy that refuses every call by an IAM user without MFA reaches the probe, the logging read and the proxy's calls only in a member account of an AWS organization, and the sources do not say whether this account was one; a workload that uses the key must move to an IAM role first. A service control policy on access key creation would have left only approved administrators able to create such a key. Service control policies that allow only approved Bedrock models, or only your networks, would have capped what the key could reach; the sources do not say whether the owner used the Claude models or from which networks. The proxy runs outside your account, and Sysdig reports no cost incurred, only a worst case of over USD 46,000 per day.

Could this have been prevented?

In hindsight, no control would have stopped it. 8 controls would have limited how far it went. 3 steps have no cloud-provider control. The counts below are control assessments, not attack stages: several can address the same step. The same replay with the controls in place before the incident shows where each phase would have been refused or bounded.

0
Prevented
8
Contained
3
Not covered

How it could have been prevented

The same replay with the controls in place. Green marks where a step is refused, blue where it is bounded, and red where no control reaches it. Open a row to read the control, why it acts, and its caveat.

External Parties
Proxy operators
Sysdig
Internet
AWS APIIAM user access key
Laravel
Laravel Application Host
Amazon Bedrock
AWS Account · Amazon Bedrock
Laravel Application
IAM User Access Key
Bedrock Claude Models
Invocation Logging Setting

Replaying the Laravel LLMjacking May 2024 intrusion

1 · Laravel host, then the AWS key

1 Contained2 Not covered3 on other clouds

2 · Bedrock probed with the key

4 Contained9 on other clouds

3 · Key loaded into a reverse proxy

3 Contained1 Not covered6 on other clouds

Key facts

  • Sysdig published the research on May 6, 2024; it names no victim and gives no date for the activity, and whether the observed account was one Sysdig ran is not stated
  • The attackers exploited CVE-2021-3129 on a system running a vulnerable Laravel version and took the AWS credentials stored on it; the CloudTrail event shows an IAM user's access key, and where on the host it was kept is not stated
  • With the key, the attackers called InvokeModel on anthropic.claude-v2 with an invalid parameter in the regions that supported Bedrock; the ValidationException told them the key could invoke an enabled model, and no prompt was run
  • The attackers called GetModelInvocationLoggingConfiguration to learn whether invocations were logged to S3 or CloudWatch; OAI Reverse Proxy says it will not use an AWS key whose account logs invocations
  • The key-checking script could test credentials for ten AI services; a user agent matching OAI Reverse Proxy was seen attempting to use LLM models with the stolen credentials, and the post gives no count of prompts
  • Sysdig's worst-case estimate for Claude 2 at the initial quota in 4 regions was over USD 46,000 (USD 46,080) per day; it is an estimate, not a reported loss

Sources

Every fact in this breakdown comes from the public reporting below. The replay is a model of that reporting, not a reconstruction of the environment it describes.

  1. 1.
    LLMjacking: Stolen Cloud Credentials Used in New AI AttackSysdig Threat Research Team · May 6, 2024 · ResearchEntry vector, credential theft, key-checking script, Bedrock InvokeModel probe, logging configuration check, regions, reverse proxy, cost estimate

The estate in the replay is illustrative and drawn at the level of attack stages; the victim's real environment is not public. Verdicts describe what a control does when it is in place before the incident. They are not an assessment of the victim's security program.

More cloud attack breakdowns

All breakdowns