Cloud Metadata Service Attacks
You'll learn how attackers exploit SSRF vulnerabilities to steal cloud credentials and configuration data from internal metadata endpoints.
When applications run in cloud environments like AWS, Azure, or Google Cloud Platform (GCP), they can access special internal endpoints that provide information about the instance itself—things like security credentials, configuration data, and network details. These metadata services are designed to be accessible only from within the cloud instance, but SSRF vulnerabilities can break that boundary.
How Cloud Metadata Services Work
Cloud providers expose metadata through predictable internal IP addresses:
- AWS:
http://169.254.169.254/latest/meta-data/ - Azure:
http://169.254.169.254/metadata/instance - GCP:
http://metadata.google.internal/computeMetadata/v1/
These endpoints require no authentication because the cloud provider assumes only the instance itself can reach them. Think of it like having a private notepad inside your house—you don't lock it because you assume strangers can't get inside. But SSRF is like giving a burglar a remote-controlled robot that can enter your home and read that notepad.
The Attack in Action
When you find an SSRF vulnerability (like a vulnerable URL fetcher), you can force the application to make requests to these metadata endpoints. For example, in AWS, accessing /latest/meta-data/iam/security-credentials/role-name returns temporary AWS access keys, allowing the attacker to access AWS resources as that role.
Azure and GCP have similar endpoints that expose instance identity tokens, service account keys, and configuration details—all without requiring passwords.
Key Takeaway: Cloud metadata services are treasure troves for attackers with SSRF access; always restrict outbound requests and implement IMDSv2 (AWS) or equivalent protections to require authentication headers that SSRF attacks can't easily forge.