Start with Identity
Concept

Instance Metadata Service (IMDS)

The instance metadata service (IMDS) is an HTTP endpoint reachable only from inside a cloud virtual machine, at 169.254.169.254 on AWS EC2, that returns data about the instance, including temporary credentials for the IAM role attached to it.

On AWS, IMDSv1 answers a plain GET request, so a server-side request forgery (SSRF) flaw that makes an application fetch an attacker-chosen URL can hand over the role's credentials. IMDSv2 is session-oriented: the caller must first obtain a token with a PUT request (valid for up to six hours) and send it as a header on every request, PUT requests carrying an X-Forwarded-For header are rejected, and each instance can be set to refuse IMDSv1 entirely. AI agents are a new source of SSRF: in October 2026 Zenity Labs showed a prompt making an Amazon Bedrock AgentCore agent's HTTP tool fetch its execution role credentials from IMDS, and the default role could reach other agents' conversations, memory and secrets. Require IMDSv2, and scope every instance or agent role on the assumption that anyone who can make the workload issue a request holds its credentials.

See also: workload identity, least privilege, prompt injection, MLflow SSRF reaches cloud metadata

Last reviewed By SWI Community TeamSuggest a correctionHow we research