The Weirdest Important IP Address on the Internet

If you've spent time reading cloud security writeups, you've probably run into the number 169.254.169.254 enough times that it looks less like an IP address and more like a magic incantation. It shows up in breach postmortems, bug bounty reports, and CTF writeups with suspicious regularity. Here's what it actually is, why it exists, and why a server that fetches URLs on someone else's behalf is riskier than it sounds.
It's not really an IP address on your network
169.254.0.0/16 is a link-local address block, reserved for addresses a machine assigns itself when it can't get one any other way — the same range Windows famously self-assigns via APIPA when DHCP fails. It's meant to never be routed off the local segment.
Cloud providers repurposed one specific address in that block, 169.254.169.254, as the instance metadata endpoint: a plain HTTP server reachable only from inside a running VM, with no external routing, that answers questions like "what region am I in," "what's my instance ID," and, critically, "what temporary credentials does my attached IAM role currently have."
That last one is what turns a boring internal convenience into one of the most consistently exploited misconfigurations in cloud security.
Why the metadata endpoint has credentials on it at all
AWS's answer to "how does my EC2 instance authenticate to S3 without a hardcoded access key sitting in a config file" is IAM instance roles: attach a role to the instance, and the instance's own software fetches short-lived, auto-rotating credentials for that role from http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name>. No secret is baked into the image, no key hits disk in a durable form, and if the instance is terminated the credentials just expire. On paper, it's a genuinely good design — it replaced an era where "hardcoded AWS key committed to a git repo" was one of the most common ways companies got breached.
Google Cloud and Azure have their own equivalents at the same address, with their own path structures, doing the same job.
Where it goes wrong: SSRF
The problem isn't the metadata endpoint. It's that a huge number of applications have some feature that fetches a URL on the server's behalf — an image importer, a webhook validator, a "test this API endpoint" button, a PDF-from-URL renderer, an RSS reader — and if that feature will fetch any URL you give it, including http://169.254.169.254/..., you've just handed an outside attacker the ability to ask your server's cloud provider for its own temporary credentials, using your server as the middleman.
This class of bug is called Server-Side Request Forgery (SSRF), and the metadata endpoint is its most famous target because the payoff is so large: not a single leaked record, but the actual IAM credentials of the machine, which can often be escalated into far broader account access depending on what that role is allowed to do. It was the entry point in the 2019 Capital One breach, where a misconfigured web application firewall let an attacker reach the metadata endpoint of an AWS-hosted server and pull credentials later used to access over 100 million customer records.
What actually stops it
A few things, layered, since no single one is bulletproof alone:
- Don't let user input reach a URL fetcher unchecked. If a feature has to accept a URL from a user, resolve the hostname yourself and reject it if any resolved address is private, loopback, link-local, or otherwise non-routable — before making the request, not after.
- Check at request time, not just at input time. A hostname can resolve to a safe address when it's first validated and a completely different one moments later (DNS rebinding). Validate as close to the actual connection as you can.
- Don't follow redirects blindly. A URL can pass validation and then redirect straight to the metadata endpoint on the second hop.
- Use IMDSv2 (AWS) or the equivalent hardened metadata API. AWS's newer metadata protocol requires a session token fetched via a
PUTrequest first, which most naive SSRF payloads (a simpleGET) can't complete — it doesn't fix SSRF, but it closes off the easiest version of this specific attack. - Scope the IAM role down. If the worst case of a leaked credential is "read access to one specific bucket" instead of "administrator," the blast radius of every future mistake shrinks with it.
Why this matters if you're building a mocking or proxying tool
Any tool that makes outbound HTTP requests on a user's behalf — API mocking platforms with a "record from a live API" feature very much included — is a potential SSRF vector by design, because the whole point of the feature is "fetch whatever URL the user configured." When we built Record & Replay for MockBase, this was the first thing we had to get right: the target URL is resolved and checked against private, loopback, and link-local ranges on every single proxied request, not just once when you save the URL, and redirects from the target are never followed. The full detail is in our security page.
It's a good example of a general rule worth internalizing: any time your server's job is "go fetch this URL for the user," that server has effectively become a foothold on the inside of your network, from the outside. Treat it that way.
Xerat02
Building MockBase.
More from the blog

Mocking Stripe's Webhooks Without Stripe
A naive webhook mock will always fail your own signature check — Stripe, Twilio, and GitHub each sign their payloads, and a mock that doesn't know the algorithm can only test half the problem.

Cookie-Based vs Token-Based Authentication: Where the Credential Actually Lives
Both approaches end with "prove who you are on every request," which makes them sound interchangeable — the real difference is who's responsible for attaching the credential, and that one detail decides which attack each approach is actually exposed to.