ex_awsのIMDSv2トークン取得でリダイレクトが追われ、SSRFの脆弱性
Summary
ex_awsのIMDSv2セッショントークン取得処理が、HTTPのリダイレクトを追従するため、攻撃者が任意のホストから返された応答をトークンとして受け入れてしまう脆弱性です。影響を受けるのは2.3.0から2.8.0より前のex_awsで、CVSS v4は7.6です。修正版は公開されているので、2.8.0以降へ更新してください。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
ex_awsのIMDSv2セッショントークン取得処理が、HTTPのリダイレクトを追従するため、攻撃者が任意のホストから返された応答をトークンとして受け入れてしまう脆弱性です。影響を受けるのは2.3.0から2.8.0より前のex_awsで、CVSS v4は7.6です。修正版は公開されているので、2.8.0以降へ更新してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| ex-awsex_aws |
≥ 4d7923c16f613cc2bade2ed325d444bba0bc7234, < 9fcc3605c7a0ecf8e205a72c50de3ced72befed0→ 9fcc3605c7a0ecf8e205a72c50de3ced72befed0 |
9fcc3605c7a0ecf8e205a72c50de3ced72befed0 |
| Hexex_aws |
≥ 2.3.0, < 2.8.0→ 2.8.0 |
2.8.0 |
Original description The description as published by the source.
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.
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory nvd.nist.gov
- advisory github.com
- package hex.pm
- package github.com
- web github.com
- web cna.erlef.org
- web osv.dev
- web github.com
- web github.com
- web github.com
- web github.com
- web repo.hex.pm