Skip to content
Vol. 1 · Ed. 2026
CyberGlossary
Entry № 079

AWS IMDSv1 Attack

What is AWS IMDSv1 Attack?

AWS IMDSv1 AttackTheft of EC2 instance role credentials by sending unauthenticated GET requests to the legacy IMDSv1 endpoint, typically via SSRF.


AWS Instance Metadata Service version 1 (IMDSv1) responds to any HTTP GET request made from the EC2 instance to http://169.254.169.254, including those forwarded by a vulnerable application via SSRF. Attackers retrieve the path /latest/meta-data/iam/security-credentials/<role>/ to obtain a temporary AccessKeyId, SecretAccessKey, and SessionToken that can be used from anywhere with AWS APIs. IMDSv2 mitigates the attack by requiring a PUT request to fetch a session token, restricting the hop limit, and blocking responses to off-instance callers. Best practice is to enforce IMDSv2 cluster-wide via launch templates and instance defaults, and to monitor IAM CloudTrail for unexpected role usage.

Examples

  1. 01

    An SSRF in a web app causes curl http://169.254.169.254/latest/meta-data/iam/security-credentials/myrole/ to leak credentials.

  2. 02

    An attacker reuses leaked temporary credentials from an external machine to list S3 buckets.

Frequently asked questions

What is AWS IMDSv1 Attack?

Theft of EC2 instance role credentials by sending unauthenticated GET requests to the legacy IMDSv1 endpoint, typically via SSRF. It belongs to the Cloud Security category of cybersecurity.

What does AWS IMDSv1 Attack mean?

Theft of EC2 instance role credentials by sending unauthenticated GET requests to the legacy IMDSv1 endpoint, typically via SSRF.

How does AWS IMDSv1 Attack work?

AWS Instance Metadata Service version 1 (IMDSv1) responds to any HTTP GET request made from the EC2 instance to http://169.254.169.254, including those forwarded by a vulnerable application via SSRF. Attackers retrieve the path /latest/meta-data/iam/security-credentials/<role>/ to obtain a temporary AccessKeyId, SecretAccessKey, and SessionToken that can be used from anywhere with AWS APIs. IMDSv2 mitigates the attack by requiring a PUT request to fetch a session token, restricting the hop limit, and blocking responses to off-instance callers. Best practice is to enforce IMDSv2 cluster-wide via launch templates and instance defaults, and to monitor IAM CloudTrail for unexpected role usage.

How do you defend against AWS IMDSv1 Attack?

Defences for AWS IMDSv1 Attack typically combine technical controls and operational practices, as detailed in the full definition above.

What are other names for AWS IMDSv1 Attack?

Common alternative names include: IMDSv1 credential theft, EC2 metadata attack.

Related terms