SSRF reads instance credentials

On-call incidentHard40 minAmazon style

Your task

A bug-bounty researcher demonstrates that your image-import feature (POST /api/import?url=) will fetch any URL the user supplies, including http://169.254.169.254/latest/meta-data/iam/security-credentials/, and returns the response body, meaning anyone can read the EC2 instance role's temporary credentials. Your CloudTrail shows API calls in the last 12 hours from those instance credentials originating from IPs outside AWS. The instance role can read two S3 buckets and a Secrets Manager secret. You're the on-call security engineer. Triage and respond.

It covers

  • Ssrf
  • Metadata endpoint
  • Cloud credentials