The Second EC2 Metadata Address Your Egress Policy May Miss

EC2's Instance Metadata Service is commonly described by its IPv4 address, 169.254.169.254. That is not the only address an instance can use. AWS documentation lists an IPv6 endpoint at [fd00:ec2::254] for instances with the IPv6 endpoint enabled. A network policy that blocks only the familiar IPv4 destination can leave the same class of request reachable over IPv6.

The metadata service is local to the instance, so a review cannot be limited to internet egress or a perimeter firewall. AWS recommends dropping packets destined for the IMDS address at the network appliance, and its guidance names both destinations: the IPv4 address and, when enabled, the IPv6 address. The same review needs to reach host firewalls, proxy configurations, workload policies, and any application that can initiate outbound requests.

Verify the endpoint state

For each EC2 instance or launch template, record whether the IPv6 IMDS endpoint is enabled. Check the instance metadata options, the subnet's IPv6 state, and the firewall policy applied to the host. Do not infer the endpoint's status from the presence of an IPv6 address alone. The service has explicit configuration that can differ between old and new instances.

Then test the effective path from the workload itself. A container, build job, or serverless-like task may inherit a network namespace, proxy, or egress gateway that differs from the administrator shell's route. A request that fails in one context can still succeed in another.

IMDSv2 changes the request, not the destination inventory

IMDSv2 adds a session-token flow and should be enforced where it is supported. That reduces the chance that a simple request-forgery primitive can retrieve credentials. It does not make an application that can legitimately fetch a token safe, and it does not remove the need to know which workloads can reach the endpoint.

An application with a broad URL-fetch feature can still be used to ask the metadata service for data if that feature can reach the local endpoint and carry out the token exchange. The stronger control is to remove network reach from workloads that do not need it and to require an explicit broker or identity mechanism for those that do.

Add IPv6 to the control set

Use a policy that covers both protocol families and both addresses when the service is enabled. At the host level, test an outbound connection to http://[fd00:ec2::254]/latest/meta-data/ from a workload that should be denied. At the network level, verify that the appliance, proxy, or service mesh blocks the same destination. At the application level, review URL fetchers, webhook clients, document converters, and plugin runtimes for a path to link-local addresses.

Logging is part of the control. Record the process, network namespace, destination, and result for metadata requests when the platform exposes them. A denied request is useful evidence that the policy is active. A successful request from a workload that should not have identity access is a finding even when the response contains only harmless metadata.

Limits

This is a network and identity boundary, not a substitute for secure application design. An instance with a role may still have permissions far beyond what a single workload needs. Use scoped roles, short-lived credentials, workload identity, and a deliberate break-glass process. The IPv6 endpoint is one more destination to include in that model, not a new vulnerability by itself.

References