IMDSv2 metadata token request follows HTTP redirects in ex_aws
NIST has not reviewed this entry yet, so scores and affected versions may be missing or may change.
Server-Side Request Forgery (SSRF) vulnerability in ex_aws (instance metadata token provider). This vulnerability is associated with program files lib/ex_aws/instance_meta_token_provider.ex and program routines ExAws.InstanceMetaTokenProvider.request_token/1 and ExAws.InstanceMetaTokenProvider.get/1. ex_aws requests its IMDSv2 session token from the link-local metadata endpoint (http://169.254.169.254/latest/api/token) with HTTP redirect following enabled. Because the token request follows 3xx redirects and does not restrict the redirect target to the link-local range, an attacker who can influence the response to the metadata request (for example an on-segment neighbor spoofing the link-local address) can answer with a redirect to an arbitrary host. The library follows the redirect and accepts the arbitrary host's response body as the IMDSv2 session token, caching it and sending it as the x-aws-ec2-metadata-token header on every subsequent metadata and credential request. This issue affects ex_aws: from 2.3.0 before 2.8.0.
Server-Side Request Forgery CWE-918
An attacker can make the server send requests for them, for example to reach internal systems that are not meant to be public.
The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
Weakness data: MITRE Common Weakness Enumeration.
New to this? Read how to keep your software updated.
The products and versions NIST lists as vulnerable, 2 products in all. If what you run is not listed it is probably not affected, but ask your provider if you are unsure.
| Product | Type | Vulnerable versions | Fixed in |
|---|---|---|---|
| Ex-aws Ex_aws | Software | from 2.3.0, before 2.8.0 | 2.8.0 |
| Ex-aws Ex_aws | Software | from 4d7923c16f613cc2bade2ed325d444bba0bc7234, before 9fcc3605c7a0ecf8e205a72c50de3ced72befed0 | 9fcc3605c7a0ecf8e205a72c50de3ced72befed0 |
The 7.6 severity score (high) from the company that reported it, broken into what it means in practice. Red means it makes the flaw easier or worse.
| How it is reached | Nearby network | The attacker has to be on the same local network (office Wi-Fi or the same hosting network). |
| How hard it is | High | Hard to carry out. It depends on conditions the attacker cannot control. |
| Setup needed on the target | Present | The target has to be set up in a particular way. |
| Login needed | None | The attacker does not need an account or password. |
| Someone has to act | None | Nobody has to click or open anything. It can happen on its own. |
| Data exposed | High | Total loss of confidentiality: the attacker can read all the data the program can reach. |
| Data changed | High | The attacker can change or delete anything the program can reach. |
| Service disrupted | None | The service keeps running. |
NIST lists 5 sources for this flaw, none tagged as a vendor patch.