imdsv2.devEC2 metadata, from the docs

169.254.169.254: what the metadata address is, and how each cloud guards it

169.254.169.254 is the link-local address, from the 169.254/16 block that RFC 3927 sets aside, where virtual machines on AWS, Azure, Google Cloud and Oracle Cloud reach their metadata service. AWS and Azure call it the Instance Metadata Service (IMDS). It hands out identity, network settings and, on AWS, the instance role's temporary credentials, and answers only from inside the machine. Azure and Google refuse any request without their header.

Published December 1, 2026 · Updated December 2, 2026. Paths, headers and limits read from AWS, Microsoft, Google and Oracle documentation on December 1, 2026; AWS's error codes and PowerShell calls re-read December 2, 2026.

What does each cloud require to read 169.254.169.254?

A header on every request, except AWS with IMDSv1 still allowed, which answers a bare GET (find the instances that still allow IMDSv1). Each cloud also turns away requests that look relayed by a proxy.

CloudHeader it requiresPathRelayed requestsIPv6 address
AWSX-aws-ec2-metadata-token, once IMDSv2 is required/latest/meta-data/No token for a PUT with X-Forwarded-Forfd00:ec2::254 (Nitro, IPv6 subnet)
AzureMetadata: true/metadata/instance?api-version=2025-04-07Must not carry X-Forwarded-ForNot listed
Google CloudMetadata-Flavor: Google/computeMetadata/v1/X-Forwarded-For rejectedfd20:ce::254 (IPv6-only VMs)
Oracle CloudAuthorization: Bearer Oracle/opc/v2/Forwarded, X-Forwarded-For, X-Forwarded-Host rejectedfd00:c1::a9fe:a9fe (IPv6-only VNICs)

From each cloud's metadata documentation, read December 1, 2026. Oracle's rules are for its v2 endpoints.

What is the EC2 metadata URL, and what does the AWS endpoint return?

The EC2 metadata path is /latest/meta-data/ at 169.254.169.254, or at [fd00:ec2::254] on a Nitro-based instance in a subnet that supports IPv6. With IMDSv2, get a token first and send it with the request (how IMDSv2 differs from IMDSv1):

TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" \
  -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
curl -H "X-aws-ec2-metadata-token: $TOKEN" \
  http://169.254.169.254/latest/meta-data/

On Windows, AWS's PowerShell example makes the same two calls with Invoke-RestMethod:

[string]$token = Invoke-RestMethod -Method PUT `
  -Headers @{"X-aws-ec2-metadata-token-ttl-seconds" = "21600"} `
  -Uri http://169.254.169.254/latest/api/token
Invoke-RestMethod -Method GET `
  -Headers @{"X-aws-ec2-metadata-token" = $token} `
  -Uri http://169.254.169.254/latest/dynamic/instance-identity/

The listing it returns names categories such as ami-id, instance-id, instance-type, local-ipv4, placement/ and iam/; under iam/security-credentials/ are temporary credentials for the instance's IAM role; EC2 makes new ones available at least five minutes before the old ones expire. Requests aren't billed, but link-local services share a limit of 1,024 packets per second per instance, counted together with Route 53 Resolver DNS queries, Amazon Time Service NTP requests and Windows licensing requests.

What do errors from the AWS metadata endpoint mean?

Most often a 401: the token is missing, wrong or expired, so get a new one. A 403 means the request isn't allowed or IMDS is turned off on that instance. A 505 means the client spoke an HTTP version IMDS doesn't take. AWS lists these codes for requests made with a token, the only kind an instance answers once IMDSv2 is required.

CodeAWS's meaningWhat to do
400The PUT request is not validCheck the TTL header: 1 to 21,600 seconds
401The GET uses an invalid tokenRequest a new token
403Not allowed, or IMDS is turned offCheck --http-endpoint and any proxy header
404No such resourceCheck the path, such as an IAM role that isn't attached
405HTTP method not allowedUse PUT for the token, GET for data
500, 503Server error, or the request couldn't be completedRetry
505HTTP version not supportedUse HTTP/1.0 or HTTP/1.1

Meanings from AWS's “Access instance metadata for an EC2 instance”, read December 2, 2026.

How do you query 169.254.169.254 on Azure?

Send the Metadata: true header and an api-version, and skip any proxy:

curl -s -H Metadata:true --noproxy "*" \
  "http://169.254.169.254/metadata/instance?api-version=2025-04-07"

Microsoft says traffic between the VM and the metadata service never leaves the host. Requests are limited to 5 a second per VM, with a 429 response above that; the managed identity category allows 20 a second and 5 at once.

And on Google Cloud and Oracle Cloud?

Google recommends the name metadata.google.internal, which serves the same data as the IP address, with the Metadata-Flavor: Google header; the older X-Google-Metadata-Request header is deprecated, and HTTPS endpoints are in Preview.

curl "http://metadata.google.internal/computeMetadata/v1/instance/image" \
  -H "Metadata-Flavor: Google"

Oracle Cloud's v2 endpoints, under /opc/v2, require Authorization: Bearer Oracle. Its legacy v1 endpoints, /opc/v1 and /openstack, keep answering until you set areLegacyImdsEndpointsDisabled to true on the instance, and Oracle warns to check first that the image supports v2.

Why do attackers aim at 169.254.169.254?

Because a server that fetches URLs on someone else's behalf, through an SSRF bug or an open proxy, can be pointed at this address, and on AWS the answer can include role credentials. The required headers and AWS's token exist so that a plain relayed GET gets nothing: AWS chose an opening PUT because most open web application firewalls don't pass one.

On AWS, two settings narrow who can reach it. A PUT response hop limit of 1, the default, keeps the token inside the instance, so a container one hop away can't get one (when to use 2). And --http-endpoint disabled turns the service off: no code on the instance can read metadata at all. To close the plain-GET path, switch IMDSv1 off.

How was this page checked?

Every path, header and limit was read from the cloud's own documentation on December 1, 2026. Errors: support@winding.ai.

  1. RFC 3927, Dynamic Configuration of IPv4 Link-Local Addresses (IETF)
  2. Access instance metadata for an EC2 instance, Configure the Instance Metadata Service options and Retrieve security credentials from instance metadata (AWS)
  3. Add defense in depth against open firewalls, reverse proxies, and SSRF vulnerabilities, AWS Security Blog, November 19, 2019
  4. Azure Instance Metadata Service for virtual machines (Microsoft)
  5. View and query VM metadata (Google Cloud)
  6. Getting Instance Metadata (Oracle Cloud Infrastructure)