Toutes les vulnérabilités
CRITICALInfra

INFRA-CAPITALONE-2019

Cloud · AWS · AWS EC2 / S3 (misconfigured WAF and IAM role)

Résumé

A misconfigured ModSecurity web application firewall on an AWS EC2 instance was abused via server-side request forgery to reach the EC2 Instance Metadata Service at 169.254.169.254 and retrieve the temporary IAM credentials of the WAF's role. Because that role was over-privileged, the attacker used the stolen credentials to exfiltrate data from Capital One's S3 buckets. Roughly 100 million US individuals and 6 million Canadians were exposed, including about 140,000 Social Security numbers and 80,000 linked bank account numbers. Attacker Paige Thompson, a former AWS engineer, was arrested July 29, 2019 and later convicted. The incident directly motivated AWS's release of IMDSv2.

Comment l’éviter dans votre code

  • Enforce IMDSv2 (require session tokens, set the hop limit to 1) so an SSRF cannot read instance role credentials.
  • Scope EC2 instance IAM roles to least privilege; never grant broad S3 list/get across all buckets.
  • Block SSRF at the app and egress layers: validate/allowlist outbound URLs and deny access to 169.254.169.254.
  • Enable S3 Block Public Access and encrypt sensitive data; alert on large or unusual S3 reads.
  • Monitor CloudTrail/GuardDuty for instance credentials used from outside the instance or for anomalous API calls.

Références

Vulnérabilités liées

Tout Infra →