Callback-url-http-3a-2f-2f169.254.169.254-2flatest-2fmeta Data-2fiam-2fsecurity Credentials-2f ★ Fast & Instant
aws ec2 modify-instance-metadata-options \ --instance-id i-1234567890abcdef0 \ --http-tokens required \ --http-endpoint enabled Use code with caution. 2. Implement Network Security
The Instance Metadata Service allows a cloud virtual machine (EC2 instance in AWS) to query information about itself without needing an external network call or hardcoded configuration. This includes:
If your application requires a callback URL, restrict it to a pre-approved list of domains or ensure the IP address is not a private/link-local range (e.g., block 169.254.0.0/16 , 10.0.0.0/8 , 172.16.0.0/12 , and 192.168.0.0/16 ).
callback-url-http://169.254.169.254/latest/meta-data/iam/security-credentials/ This includes: If your application requires a callback
These credentials are (usually a few hours), but that is more than enough time for an attacker to exfiltrate data, spin up crypto miners, delete backups, or pivot to other services. The session token is not a barrier—AWS SDKs accept it exactly like a long‑term key.
Between March 13 and 25, 2025, a surge in malicious activity was detected by F5 Labs. Threat actors systematically probed websites hosted on EC2, exploiting SSRF vulnerabilities to access the EC2 metadata endpoint. The attackers rotated between 6 query parameters and 4 metadata subpaths in a highly automated fashion, indicating a single, sophisticated actor leveraging IMDSv1 to compromise EC2 instances.
This public link is valid for 7 days and shares a thread, including any personal information you added. This link or copies made by others cannot be deleted. If you share with third parties, their policies apply. Can’t copy the link right now. Try again later. Between March 13 and 25, 2025, a surge
: Access to 169.254.169.254 is restricted to EC2 instances within AWS. Attempting to access this IP from outside AWS will not work.
The attacker then requests the specific path for that role: http://169.254.169.254/latest/meta-data/iam/security-credentials/MyAppInstanceRole . The response is a JSON object containing the AccessKeyId , SecretAccessKey , and Token .
The string callback-url-http-3A-2F-2F169.254.169.254-2Flatest-2Fmeta data-2Fiam-2Fsecurity credentials-2F is far from random noise. It is an —a digital signpost pointing directly to one of the most sensitive internal cloud services. which uses a simple request-response mechanism.
The payload http://169.254.169 relies on AWS IMDSv1, which uses a simple request-response mechanism. In IMDSv1, any GET request made by the server to this endpoint will instantly return the requested data. This makes it highly susceptible to SSRF, as attackers do not need to control request headers or handle complex multi-step handshakes.
Configure security groups and network ACLs to restrict outbound traffic. For applications that do not need to fetch arbitrary external resources, deny all outbound traffic to the internet. If outbound requests are necessary, block responses from the IMDS IP address (169.254.169.254).