Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is an IMDS Attack?

An IMDS attack abuses the cloud instance metadata service at 169.254.169.254 to steal the credentials attached to a virtual machine, usually through a server-side request forgery flaw.

Illustration for the cybersecurity term IMDS Attack
Home / Blog / Cybersecurity Terms / What Is an IMDS Attack?
17 November 2026

What Is an IMDS Attack?

What Is an IMDS Attack?

Every cloud virtual machine can ask a local service for information about itself. That service, the instance metadata service, answers at the link-local address 169.254.169.254 and returns the instance identifier, its network configuration, any user data script it was launched with and—critically—temporary credentials for the role attached to the instance. An IMDS attack is any technique that gets an attacker’s request delivered to that endpoint so the response comes back to them.

Why It Is Such an Attractive Target

The endpoint has no authentication. It cannot have any, because its whole purpose is to answer a workload that has not yet obtained a credential. Access control is therefore positional: anything that can make an HTTP request from the instance gets an answer. The credentials returned belong to the role the instance runs as, which in many estates is far broader than the application needs.

A successful request yields temporary access keys and a session token valid for hours. From there the attacker enumerates the account, reads storage, and looks for a route to a more privileged role—the sequence described in our entry on cloud credential leakage.

The Routes In

Capital One, 2019

The clearest public example remains the Capital One breach. A misconfigured web application firewall allowed a server-side request forgery, which was used to query the metadata service and retrieve credentials for an over-permissioned role. Those credentials permitted listing and copying data from S3, and information relating to roughly 106 million people in the United States and Canada was taken. The attacker was convicted in June 2022, and the incident produced regulatory penalties running to many millions.

Three failures compounded: an exploitable application flaw, an instance role with far more access than the workload needed, and metadata access that required nothing but an outbound request. Fix any one and the chain breaks; fix all three and the path disappears.

Closing the Path

  1. Require session-oriented metadata access. On AWS, enforce IMDSv2, which demands a PUT request with a token header that simple request forgery cannot produce—see IMDSv2. Azure requires a Metadata: true header and Google requires Metadata-Flavor: Google, which blocks the most naive variants.
  2. Scope the instance role tightly. Assume the credential will be stolen one day and grant only what the workload genuinely uses, with least privilege and condition keys.
  3. Block the address where it is not needed. Container workloads that do not need instance credentials should not be able to reach the link-local address at all; in Kubernetes, use a network policy or the provider’s metadata concealment option and give pods their own identities instead.
  4. Fix the forgery. Validate and allowlist outbound destinations in any feature that fetches a user-supplied URL, resolve the hostname and check the resulting address, and refuse redirects to private ranges.
  5. Detect the use. Alert when an instance role credential is used from an address outside the cloud provider’s ranges. That single detection catches most real-world exploitation, because the attacker almost always uses the keys from their own infrastructure.

Testing for It

Any application feature that accepts a URL is worth testing specifically, including the obscure ones—avatar import, callback registration, document conversion, and anything that renders HTML server-side. Check decimal and hexadecimal encodings of the address, alternative hostnames that resolve to it, and redirect chains, because naive blocklists catch the literal string and nothing else.

At Privia Security, we test these paths in client applications and cloud environments through our web application security services.

FAQ – Frequently Asked Questions

What Is the 169.254.169.254 Address?

It is a link-local address used by all major cloud providers to expose the instance metadata service to the virtual machine running on that host. It is not routable on the internet and exists only from inside the instance. It returns configuration data, user data scripts, and temporary credentials for any role attached to the instance, which is what makes it valuable to an attacker.

How Does SSRF Lead to Cloud Credential Theft?

A server-side request forgery flaw lets an attacker choose a URL that the server fetches on their behalf. Pointing it at the metadata endpoint makes the server request its own credentials and return them in the response. No authentication is involved, because the service answers anything originating from the instance. The attacker then uses the temporary keys against the cloud API from their own machine.

Should Containers Be Able to Reach the Metadata Service?

Usually not. A pod that can reach the node’s metadata endpoint inherits the node’s cloud identity, which is typically broader than any single workload needs. Block the link-local address with a network policy or the provider’s metadata concealment feature, and give each workload its own identity through IAM roles for service accounts, workload identity, or an equivalent mechanism.

How Would I Detect Stolen Instance Credentials in Use?

Alert when credentials issued to an instance role are used from a source address outside your cloud provider’s published ranges. Legitimate use comes from the instance itself, so external use is a strong indicator of theft. AWS GuardDuty raises this as a specific finding type, and the equivalent detections exist in Microsoft Defender for Cloud and Google Security Command Centre.

Related Terms

You May Be Interested In These

What Is Proxy Log Analysis?

Cybersecurity Terms

17 November 2026

What Is Proxy Log Analysis?

Read More
What Is a Banking Trojan?

Cybersecurity Terms

17 November 2026

What Is a Banking Trojan?

Read More
What Is Web Application Penetration Testing?

Cybersecurity Terms

17 November 2026

What Is Web Application Penetration Testing?

Read More