# Black Hat 2021: How isolated is your AWS cloud environment?

AWS CloudTrail, Config and Serverless Repository could be tricked into acting on attacker accounts, letting attackers read or write other customers' S3 buckets.

- Payout: Research
- Severity: high
- Program: AWS
- Write-up by: Wiz Research
- Disclosed: 2021-08-04
- Write-up quality: 7/10
- Original: https://www.wiz.io/blog/black-hat-2021-aws-cross-account-vulnerabilities-how-isolated-is-your-cloud-environment
- Library page: https://bugbountylibrary.com/r/blog%3Awiz-io-blog-black-hat-2021-aws-cross-account-vulnerabilities-how-isolated-is-your-cloud-environment
- Tags: area:cloud domain:cloud impact:data-leak impact:integrity kind:research platform:threat-intel sev:high tech:aws tech:s3 technique:recon vuln:access-control vuln:misconfiguration

**Target:** AWS resource policies / S3 buckets (CloudTrail, AWS Config, Serverless Repository)
**Root cause:** AWS services can be tricked into performing actions on an attacker's behalf, and the target bucket trusts the service without conditions; default resource policies never limit who can use the service to access a customer's S3 buckets.
**Steps:**
1. Map all AWS services allowing cross-account access.
2. Attacker configures CloudTrail on their own account to write logs into a target bucket in the victim account.
3. CloudTrail collects logs and writes into the customer bucket, acting on the attacker's behalf.
4. The bucket allows access because CloudTrail is trusted by the bucket.
5. For Serverless Repository, exploit the service to read from other customers' private S3 buckets.
**How found:** Team assumed cloud accounts are isolated and mapped every AWS service permitting cross-account access, then tested whether any could be manipulated to act on another customer's resources.
**Exploitation:** Attacker points a trusted AWS service (CloudTrail, AWS Config, Serverless Repository) at a victim's S3 bucket; the bucket's default resource policy trusts the service unconditionally, so the service performs read/write on the attacker's behalf, enabling data exfiltration without a trace.
**Escalation:** Serverless Repository variant allowed reading private S3 buckets even in isolated accounts not connected to the internet.
**Insight:** Enumerate services that customers grant cross-account trust to via resource policies; if the policy trusts the service principal without conditions on who invokes it, the service becomes a confused deputy for any other account.

