CVE-2026-63582: S3 bucket name controls the host of presigned URLs in ex_aws_s3

Published Nov 24, 2026
·
Updated

Summary

Externally Controlled Reference to a Resource in Another Sphere vulnerability in ex-aws exawss3 allows an attacker who controls an S3 bucket name to make presigned URLs and presigned POST forms point at a host of their choice.

With virtualhost: true, s3accelerate: true or bucketashost: true, ExAws.S3.presignedurl/5 and ExAws.S3.presignedpost/4 build the URL from the bucket name without checking it. A bucket such as attacker.example/x? turns the URL into https://attacker.example/x?.s3.amazonaws.com..., and the signature is computed for that host. Clients given the URL upload their files to, or download content from, the attacker's host, and every such URL discloses the access key id. With bucketashost: true any valid hostname works as the bucket name.

This issue affects exawss3: from 2.0.0 before 2.6.0.

Details

1. URL construction. The private urltosign/5 in lib/exaws/s3.ex builds the URL for presignedurl/5 and presignedpost/4 as "#{scheme}#{bucket}.#{host}#{port}#{object}" when virtualhost is set, or "#{scheme}#{bucket}#{port}#{object}" with bucketashost. s3accelerate: true sets virtualhost and takes the same branch. The bucket name is not checked.

2. Signing for the attacker's host. The string goes to ExAws.Auth.presignedurl/9, which signs URI.parse(url).authority. For the bucket attacker.example/x? the signed host is attacker.example, and the ? pushes the object key into the query string.

3. Effect. Presigned URLs are built locally and never pass through ExAws.Operation.S3.addbuckettopath/2, so the fix in exaws for the request path does not cover them. A browser submitting the presigned POST sends its upload to the attacker, a client following a presigned GET receives attacker content, and X-Amz-Credential discloses the access key id. The secret key is not disclosed and the signature cannot be replayed against AWS.

Proof of concept

1. An application presigns uploads for per-tenant buckets with virtualhost: true. 2. A tenant sets its bucket name to attacker.example/x?. 3. ExAws.S3.presignedurl(config, :put, bucket, "key", virtualhost: true) returns https://attacker.example/x?.s3.amazonaws.com%2Fkey=&X-Amz-Credential=..., and presignedpost/4 returns the form action https://attacker.example/x?.s3.amazonaws.com. 4. URI.parse/1 on either yields the host attacker.example, so any client given the URL or form connects there.

Impact

An attacker who can choose the bucket name makes the application hand out presigned URLs and POST forms that point at the attacker's host. Files other users upload through those forms go to the attacker, presigned downloads serve attacker-controlled content under the application's name, and every such URL discloses the access key id. Applications that presign for per-tenant or user-supplied buckets with virtual-host addressing are affected.

Configurations

Reachable only when presigned URLs or POST forms are generated with virtualhost: true, s3accelerate: true or bucketashost: true and the application passes a bucket name an attacker can influence, for example per-tenant or user-supplied buckets. Path-style presigning, the default, places the bucket in the path and is not affected.

Solutions

Upgrading rejects bucket names containing characters that can change the host of a presigned URL. With bucketashost: true, a syntactically valid hostname is still used as the host after upgrading: applications that presign with bucketashost: true and bucket names they do not fully control must also pass the bucketashostallowlist option, or set it in the S3 config, with the list of trusted hostnames.

Other sources

Externally Controlled Reference to a Resource in Another Sphere vulnerability in ex-aws exawss3 allows an attacker who controls an S3 bucket name to make presigned URLs and presigned POST forms point at a host of their choice.

With virtualhost: true, s3accelerate: true or bucketashost: true, ExAws.S3.presignedurl/5 and ExAws.S3.presignedpost/4 build the URL from the bucket name without checking it. A bucket such as attacker.example/x? turns the URL into https://attacker.example/x?.s3.amazonaws.com..., and the signature is computed for that host. Clients given the URL upload their files to, or download content from, the attacker's host, and every such URL discloses the access key id. With bucketashost: true any valid hostname works as the bucket name.

This issue affects exawss3: from 2.0.0 before 2.6.0.

— MITRE

Affected Software

2 affected componentsFixes available
hex/ex_aws_s3>=2.0.0<2.6.0
erlang/ex_aws_s3>=2.0.0<2.6.0
2.6.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 2.6.0
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.6.0
  3. Configuration

    When presigning with bucket_as_host: true and bucket names you do not fully control, pass bucket_as_host_allowlist or set it in the S3 config to allow only trusted hostnames.

    ex_aws_s3 bucket_as_host_allowlist = list of trusted hostnames

Event History

Nov 24, 2026
CVE Published
via MITRE·02:13 PM
Data Sourced
via MITRE·02:13 PM
RemedyDescriptionWeakness
Data Sourced
via OSV·02:13 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which applications are exposed?

Applications using ex_aws_s3 versions 2.0.0 through before 2.6.0 are exposed when they generate presigned URLs or presigned POST forms with virtual_host: true, s3_accelerate: true, or bucket_as_host: true and an attacker can control the bucket name. With bucket_as_host: true, any valid hostname can be used as the bucket name.

2

What does an attacker need to exploit this?

The attacker needs control over a bucket-name value used when calling ExAws.S3.presigned_url/5 or ExAws.S3.presigned_post/4 under an affected host-building option. They can craft a bucket value that causes the generated URL to target a host they control.

3

What is exposed when a malicious presigned URL is generated?

Clients receiving the URL may upload files to, or download content from, the attacker-controlled host rather than the intended S3 destination. Each generated URL also discloses the access key ID.

4

How can exposure be reduced before upgrading?

Do not allow untrusted input to control bucket names used for presigned URL or presigned POST generation. Avoid the affected virtual_host, s3_accelerate, and bucket_as_host settings where they are used with attacker-influenced bucket names.

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