FlawOpen

flawopen.com/SSRF/Cloud metadata and SSRF

How Can SSRF Reach Cloud Metadata, and When Are Credentials at Risk?

Reference page
ELI5

Think of the metadata service as a locked service counter inside a cloud machine. SSRF can turn your application into a courier to that counter, but what it can retrieve depends on the provider's request rules, instance settings, and the application's network path. A reachable endpoint does not automatically mean credentials are exposed.

Why the metadata endpoint is dangerous

AWS EC2, Azure, and Google Compute Engine document instance metadata services reachable from supported VM environments; 169.254.169.254 is a common link-local address, but request formats and controls differ. Metadata may include sensitive instance details, and AWS can return temporary role credentials when the instance profile and request path permit it. SSRF matters when an attacker can influence a server-side request that reaches this service. Reachability alone does not establish that credentials are retrievable: required headers or tokens, HTTP method constraints, proxy behavior, network placement, and instance configuration affect the result.

Real-world relevance

The security impact is a chain, not an automatic outcome: an input influences a server-side request; the request reaches a metadata service; the service accepts that request under its provider-specific controls; and the returned data grants useful access. The final blast radius depends on the workload identity's permissions. Break the chain with fixed destination choices, strict egress controls, provider metadata protections, and narrowly scoped workload identities.

FAQ

Do all cloud providers use the same address?

No. Address, headers, methods, token requirements, and available data vary. AWS IMDSv2 requires a session token for metadata retrieval when HttpTokens is set to required; Azure requires the Metadata: true header; Google documents the Metadata-Flavor: Google header. These provider checks can mitigate some SSRF paths, but they are not a substitute for preventing user-controlled destinations and blocking unnecessary egress. Verify the exact VM and container configuration in the provider's documentation.

References

See also Server-Side Request Forgery (SSRF, CWE-918): How It Works and How to Prevent It in Every Language — flawopen.com AI PR Bots: Prevent Prompt Injection SSRF Node.js fetch() SSRF: Safe URL Fetching