The Capital One Cloud Breach
In 2019, Capital One suffered one of the largest financial cloud breaches in history: 100 million credit card applications, 140,000 Social Security numbers, and 80,000 bank account numbers were stolen.
The intrusion was accomplished through **Server-Side Request Forgery (SSRF)** against a misconfigured open-source Web Application Firewall (ModSecurity) running on an Amazon EC2 instance.
The Link-Local Magic IP: 169.254.169.254
In Amazon Web Services, every EC2 virtual machine can communicate with an internal, non-routable IP address: ```text http://169.254.169.254/ ```
This is the **Instance Metadata Service (IMDS)**. When an EC2 instance needs to know its own IP, hostname, or IAM role credentials, it sends a simple HTTP GET request to this address.
Because the WAF had an SSRF flaw that fetched URLs on behalf of users, the attacker commanded the WAF to request: ```text http://169.254.169.254/latest/meta-data/iam/security-credentials/ ```
The internal server answered with temporary AWS security credentials (`AccessKeyId`, `SecretAccessKey`, `Token`).
The S3 Sync Exfiltration
The WAF's IAM role had been over-privileged with full read access to all corporate S3 storage buckets. The attacker copied the temporary credentials onto her home laptop and ran:
aws s3 sync s3://capitalone-credit-cards .Within hours, 700 S3 buckets containing 100 million credit applications were exfiltrated.
How IMDSv2 Neutralized SSRF
AWS introduced **IMDSv2** specifically to eradicate this entire class of vulnerability. IMDSv2 requires a `PUT` request with a custom header (`X-aws-ec2-metadata-token-ttl-seconds`) to establish a temporary session token before reading metadata. Because SSRF vulnerabilities rarely support custom HTTP headers, IMDSv2 stops metadata extraction in its tracks.