RedTeam Nexus Labs
Module 13 · Lesson 05 // SSRF

cloud metadata concept

SSRF · Web Security

Freereading · 10 min
On this page
LESSON

Overview

In cloud environments, SSRF has a notorious high-value target: the cloud metadata service, an internal endpoint that can expose instance credentials and configuration. This lesson explains the concept and why it makes SSRF especially dangerous in the cloud.

Learning objectives

  • Explain what a cloud instance metadata service is.
  • Describe why it is a prime SSRF target.
  • Identify defenses specific to metadata exposure.

Core concept

Cloud providers expose an instance metadata service — an internal endpoint (a link-local address reachable only from the instance itself) that provides information about the running instance and, critically, may provide temporary credentials for the instance's assigned cloud role. Because it is reachable from the server but not from outside, it is exactly the kind of internal target SSRF can reach by proxy — and obtaining its credentials can grant significant access to cloud resources.

How it works

The metadata endpoint responds to requests originating from the instance. An SSRF vulnerability lets an attacker make the server request that internal endpoint, potentially retrieving instance metadata or role credentials intended only for the instance's own use. With such credentials, an attacker may access cloud resources (storage, other services) according to the role's permissions — turning an application-layer SSRF into a cloud account compromise. This is why SSRF is treated as especially critical in cloud contexts. Modern providers offer hardened metadata mechanisms (e.g. requiring session tokens) that reduce this exposure.

Practical example

An SSRF-vulnerable image-fetch feature runs on a cloud instance. An attacker directs the server to request the internal metadata endpoint instead of an image. If the environment is not hardened, the server retrieves role credentials from metadata and returns them to the attacker, who then uses them to access cloud resources the instance's role can reach. A single application SSRF bug escalates into broad cloud access — illustrating why metadata protection and SSRF prevention are joined concerns.

Cybersecurity relevance

The cloud metadata angle is a major reason SSRF rose to prominence, featuring in significant real-world cloud breaches. Defenses combine the module's controls with cloud-specific measures: use the provider's hardened metadata service (requiring signed/session tokens), block the metadata address at the network layer (egress/host firewall) for workloads that do not need it, apply least-privilege roles so leaked credentials grant minimal access, and prevent SSRF at the application layer (allowlists). Testers check metadata reachability via SSRF; defenders layer these protections.

Common mistakes

  • Leaving the metadata endpoint reachable from application workloads that do not need it.
  • Not using the hardened/token-required metadata mechanism where available.
  • Assigning over-privileged instance roles, so leaked credentials grant broad access.

Key takeaways

  • The cloud instance metadata service is an internal endpoint that can expose instance info and role credentials, reachable from the server — a prime SSRF target.
  • SSRF to metadata can leak credentials and escalate into cloud account compromise, a key reason SSRF is critical in the cloud.
  • Defend with hardened/token-required metadata, network-level blocking of the metadata address, least-privilege instance roles, and application-layer SSRF prevention.

Check your understanding

  • Why is the cloud metadata service an especially high-value target for SSRF?
  • Name two defenses specific to protecting the metadata service from SSRF.
FINISH THIS LESSON

Sign in to save your progress.