IMDSv1 on AWS EC2 Poses SSRF Risk; Migrating to IMDSv2 Requires Careful Planning

Amazon EC2's Instance Metadata Service (IMDS) allows software running inside an instance to query instance details, including temporary IAM credentials via the link-local address 169.254.169.254. IMDSv1 accepts direct HTTP requests with no authentication, making it vulnerable to Server-Side Request Forgery (SSRF) attacks — a weakness that played a role in the 2019 Capital One breach, which exposed data of over 100 million people. IMDSv2 addresses this by requiring a session token obtained through a PUT request before any metadata can be accessed. While switching to IMDSv2 is straightforward in the EC2 console, AWS warns administrators to first confirm no existing applications, agents, SDKs, or scripts still rely on IMDSv1 calls. The CloudWatch metric MetadataNoToken can help identify such dependencies before enforcing the stricter version.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in