Request-url-http-3a-2f-2f169.254.169.254-2flatest-2fmeta Data-2fiam-2fsecurity Credentials-2f Updated
http://169.254.169.254/latest/meta-data/iam/security-credentials/MyRole
SSRF attacks generally rely on simple HTTP GET requests. Because IMDSv2 requires a PUT request to initiate a session, traditional SSRF vulnerabilities cannot easily obtain the credentials. Configure your EC2 instances to enforce IMDSv2. Disable IMDSv1 entirely for new and existing instances.
Breaking In: Fetching EC2 IAM Credentials. With SSRF confirmed, my next goal was to access the EC2 instance metadata service to lo... Mostafa Hussein Cloud Instance Metadata Services (IMDS) - LinkedIn
The attack vector described by this keyword explicitly targets . IMDSv1 relies on simple, unauthenticated HTTP GET requests, making it highly susceptible to SSRF. http://169
The endpoint /latest/meta-data/iam/security-credentials/ acts as a gateway to the machine's active identity.
Block requests attempting to resolve to private, local, or loopback IP ranges (such as 127.0.0.1 and 169.254.169.254 ). 4. Restrict Container Access (Bridge Networking)
http://169.254.169 is a link-local address for AWS EC2 instance metadata commonly exploited in Server-Side Request Forgery (SSRF) attacks to steal temporary IAM credentials. Attackers use this path to retrieve IAM role names and subsequently obtain access keys, secret keys, and session tokens, posing a significant risk to cloud infrastructure. Security professionals recommend enforcing IMDSv2, applying the principle of least privilege, and utilizing WAF rules to prevent unauthorized access. For more details, visit Hacking Articles Cloud Instance Metadata Services (IMDS) - SANS Institute Disable IMDSv1 entirely for new and existing instances
: With these temporary credentials, the instance can securely access AWS resources as permitted by the IAM role.
If your EC2 instance does not require access to any IAM role or other metadata, you should consider disabling the IMDS endpoint entirely. This can be done by setting the http_endpoint option to disabled in the instance's metadata options. This is the most secure configuration for instances that do not need the service.
The use of temporary security credentials fetched from http://169.254.169.254/latest/meta-data/iam/security-credentials/ has significant security implications: Mostafa Hussein Cloud Instance Metadata Services (IMDS) -
To keep your cloud environment secure, follow these three steps:
: A user-facing feature (like a profile picture uploader via URL, a PDF generator, or a web hook tester) asks for a URL.