Skip to main content
Back
IntrusionAWS
2 min read

Stolen Lambda role credentials linked to phishing through Amazon SES

Victim
An unnamed organization's AWS account
When
May 20, 2022Disclosed Dec 8, 2022
Entry
Credentials for an AWS Lambda execution role were used outside the function. Unit 42 did not establish how the actor first reached it.

On May 20, 2022, an outside caller used credentials belonging to an unnamed organization’s Lambda function. AWS returned the caller identity and refused two IAM policy-list requests. Unit 42 linked the same credentials to phishing through Amazon SES. The organization had no active SES use before the incident, according to Unit 42.

What happened

Internet
AWS STSLambda role session
AWS account
Amazon SES

Replaying the Lambda and SES May 2022 intrusion

  1. 1

    Caller identity

    May 20, 2022

    AWS returned the role’s identity to an outside caller. Its IAM permissions refused the policy-list requests that followed.

  2. 2

    Mail service access

    May 20, 2022

    The account had no active SES use before the incident. Unit 42 attributed the phishing to use of the Lambda credentials and reported unexpected costs.

Impact

Unit 42 reported that phishing through Amazon SES left the account owner with unexpected costs. It gave no amount or recipient count.

Could this have been prevented?

Keep mail permissions out of functions that do not send mail

If your Lambda function needs no Amazon SES access, attach a permissions boundary to its execution role that explicitly denies SES and permits its legitimate work. Other workloads can still use mail. An alternative for the same mail activity is an AWS Organizations service control policy that denies SES across a member account that can operate without it.

Incident control assessments

2
Prevented
0
Contained
1
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.

Internet
AWS STSLambda role session
AWS account
Amazon SES

Replaying the Lambda and SES May 2022 intrusion

1 · Caller identity

1 Not covered

2 · Mail service access

2 Prevented

Key facts

  • Unit 42 traced the requests to an address outside the function’s environment.
  • AWS denied both IAM policy-list requests. Most broader discovery requests and an attempt to create an IAM user also failed.
  • Unit 42 reported unexpected costs for the account owner and risk to other organizations. It gave no recipient outcome.
  • The last reported event concerned deletion of the SES identity. Unit 42 published the case on December 8, 2022.

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.
    Compromised Cloud Compute Credentials: Case Studies From the WildPalo Alto Networks Unit 42 · Dec 8, 2022 · ResearchAWS case only: Lambda role, external requests, permission denials, SES abuse and unexpected costs
  2. 2.
    GetCallerIdentityAmazon Web Services · undated · Vendor reportAWS states that caller identity is available even under an explicit deny
  3. 3.
    Service control policies (SCPs)Amazon Web Services · undated · Vendor reportOrganization member-account scope, explicit denies and exceptions
  4. 4.
    Identity and access management in Amazon SESAmazon Web Services · undated · Vendor reportSES authorization and the distinction between identity management and sending
  5. 5.
    Permissions boundaries for IAM entitiesAmazon Web Services · undated · Vendor reportThe effective role permissions, direct role-session grants and precedence of an explicit deny

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