{"affected":[{"package":{"ecosystem":"Hex","name":"ex_aws_s3","purl":"pkg:hex/ex_aws_s3"},"ranges":[{"events":[{"introduced":"2.0.0"},{"fixed":"2.6.0"}],"type":"SEMVER"}],"versions":["2.0.0","2.0.1","2.0.2","2.1.0","2.2.0","2.3.0","2.3.1","2.3.2","2.3.3","2.4.0","2.5.0","2.5.1","2.5.2","2.5.3","2.5.4","2.5.5","2.5.6","2.5.7","2.5.8","2.5.9"]},{"ranges":[{"events":[{"introduced":"4ce4d72219c0cb8de9356278203d8ea780311b75"},{"fixed":"ea26e8b43785f3ff1f14d6b22d8069fc06a58e55"}],"repo":"https://github.com/ex-aws/ex_aws_s3","type":"GIT"}]}],"aliases":["GHSA-p62r-cgcg-9fm7","CVE-2026-63582"],"credits":[{"name":"Peter Ullrich","type":"FINDER"},{"name":"Peter Ullrich","type":"REPORTER"},{"name":"Jonatan Männchen / EEF","type":"ANALYST"},{"name":"Peter Ullrich","type":"COORDINATOR"},{"name":"Bernard Duggan","type":"REMEDIATION_DEVELOPER"}],"database_specific":{"capec_ids":["CAPEC-154"],"cpe_ids":["cpe:2.3:a:ex-aws:ex_aws_s3:*:*:*:*:*:*:*:*"],"cwe_ids":["CWE-610"]},"details":"## Summary\n\nExternally Controlled Reference to a Resource in Another Sphere vulnerability in ex-aws ex_aws_s3 allows an attacker who controls an S3 bucket name to make presigned URLs and presigned POST forms point at a host of their choice.\n\nWith `virtual_host: true`, `s3_accelerate: true` or `bucket_as_host: true`, `ExAws.S3.presigned_url/5` and `ExAws.S3.presigned_post/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 `bucket_as_host: true` any valid hostname works as the bucket name.\n\nThis issue affects ex_aws_s3: from 2.0.0 before 2.6.0.\n\n## Details\n\n**1. URL construction.** The private `url_to_sign/5` in `lib/ex_aws/s3.ex` builds the URL for `presigned_url/5` and `presigned_post/4` as `\"#{scheme}#{bucket}.#{host}#{port}#{object}\"` when `virtual_host` is set, or `\"#{scheme}#{bucket}#{port}#{object}\"` with `bucket_as_host`. `s3_accelerate: true` sets `virtual_host` and takes the same branch. The bucket name is not checked.\n\n**2. Signing for the attacker's host.** The string goes to `ExAws.Auth.presigned_url/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.\n\n**3. Effect.** Presigned URLs are built locally and never pass through `ExAws.Operation.S3.add_bucket_to_path/2`, so the fix in ex_aws 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.\n\n## Proof of concept\n\n1. An application presigns uploads for per-tenant buckets with `virtual_host: true`.\n2. A tenant sets its bucket name to `attacker.example/x?`.\n3. `ExAws.S3.presigned_url(config, :put, bucket, \"key\", virtual_host: true)` returns `https://attacker.example/x?.s3.amazonaws.com%2Fkey=&X-Amz-Credential=...`, and `presigned_post/4` returns the form action `https://attacker.example/x?.s3.amazonaws.com`.\n4. `URI.parse/1` on either yields the host `attacker.example`, so any client given the URL or form connects there.\n\n## Impact\n\nAn 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.\n\n## Configurations\n\nReachable only when presigned URLs or POST forms are generated with `virtual_host: true`, `s3_accelerate: true` or `bucket_as_host: 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.\n\n## Solutions\n\nUpgrading rejects bucket names containing characters that can change the host of a presigned URL. With `bucket_as_host: true`, a syntactically valid hostname is still used as the host after upgrading: applications that presign with `bucket_as_host: true` and bucket names they do not fully control must also pass the `bucket_as_host_allowlist` option, or set it in the S3 config, with the list of trusted hostnames.","id":"EEF-CVE-2026-63582","modified":"2026-11-24T14:13:17.753773Z","published":"2026-11-24T14:13:16.822Z","references":[{"type":"ADVISORY","url":"https://github.com/ex-aws/ex_aws_s3/security/advisories/GHSA-p62r-cgcg-9fm7"},{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-63582.html"},{"type":"WEB","url":"https://github.com/ex-aws/ex_aws_s3/commit/4ce4d72219c0cb8de9356278203d8ea780311b75"},{"type":"FIX","url":"https://github.com/ex-aws/ex_aws_s3/commit/ea26e8b43785f3ff1f14d6b22d8069fc06a58e55"},{"type":"PACKAGE","url":"https://hex.pm/packages/ex_aws_s3"}],"related":[],"schema_version":"1.8.0","severity":[{"score":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N","source":"CNA","type":"CVSS_V4"}],"summary":"S3 bucket name controls the host of presigned URLs in ex_aws_s3","upstream":[]}