{"id":"EEF-CVE-2026-63585","summary":"ExAws.S3 ACL grantee injection via unescaped grant headers in format_grant_header/1","details":"## Summary\n\n`ExAws.S3` constructs S3 ACL grant headers (such as `x-amz-grant-read` and `x-amz-grant-full-control`) in `format_grant_header/1` by interpolating grantee identifiers into a quoted, comma-separated list without escaping. Grantee email and id values are wrapped in double quotes and joined with a comma, but double-quote, comma, and CR/LF characters in the value are not neutralized. An application that passes an attacker-influenced grantee value (for example an email address taken from a \"share this object\" feature) into an ACL grant option (`grant_read`, `grant_write`, `grant_read_acp`, `grant_write_acp`, or `grant_full_control`) lets the attacker close the quoted token and inject an additional grantee, such as the attacker's own canonical id or the predefined AllUsers group URI, into the header. S3 then applies the injected grantee, granting an arbitrary principal the same permission (up to full control or public access) in an unintended ACL grantee-injection and privilege-escalation issue.\n\nThis issue affects ex_aws_s3: from 2.0.0 before 2.6.0.\n\n## Details\n\n**1. Header grammar.** S3 grant headers such as `x-amz-grant-read` and `x-amz-grant-full-control` are a comma-separated list of quoted grantee tuples, `type=\"id\"[, type=\"id\"]...`.\n\n**2. Unescaped interpolation.** `format_grant_header/1` in `lib/ex_aws/s3/utils.ex` builds each tuple as `emailAddress=\"#{email}\"` or `#{key}=\"#{value}\"` and joins them with `, `. It does not check identifiers against the id or email grammar and does not reject or escape `\"`, `,` or CR/LF.\n\n**3. Grantee injection.** A grantee value such as `x\", id=\"ATTACKER_CANONICAL_ID` closes the quoted token and opens a second tuple, producing `id=\"x\", id=\"ATTACKER_CANONICAL_ID\"`. S3 parses two grantees and gives the injected principal the permission the header conveys, up to full control for `x-amz-grant-full-control`.\n\n## Proof of concept\n\n1. An application offers \"share this object\" and calls `ExAws.S3.put_object_acl(\"victim-bucket\", \"secret.txt\", grant_read: [email: email])` with a user-supplied email.\n2. The attacker submits the email `victim@example.com\", id=\"ATTACKER_CANONICAL_ID_deadbeef`.\n3. `format_grant_header/1` interpolates it into `emailAddress=\"...\"`, closing the quote after `victim@example.com` and opening a second tuple.\n4. The `x-amz-grant-read` header carries `emailAddress=\"victim@example.com\", id=\"ATTACKER_CANONICAL_ID_deadbeef\"`, granting the attacker's principal read access.\n\n## Impact\n\nThis is an ACL grantee-injection vulnerability leading to unintended permission grants and potential privilege escalation. It affects any application using `ExAws.S3` ACL grant options (`grant_read`, `grant_write`, `grant_read_acp`, `grant_write_acp`, `grant_full_control`) where the grantee email or id is derived from untrusted input. An attacker who can influence a grantee value can grant their own AWS principal access to objects or buckets, up to full control, by injecting an extra grantee into the comma-separated grant header.\n\n## Workarounds\n\nValidate grantee identifiers before passing them to `ExAws.S3` ACL grant options and reject any value containing a double quote, comma, or CR/LF character, or restrict grantee input to trusted canonical ids and email addresses that match the expected S3 grantee grammar.\n\n## Configurations\n\nThe vulnerability requires the host application to pass untrusted input into an `ExAws.S3` ACL grant option (`grant_read`, `grant_write`, `grant_read_acp`, `grant_write_acp`, or `grant_full_control`). Applications that only pass trusted, validated grantee identifiers into these options are not affected.","aliases":["GHSA-6fg2-v8g4-vfg2","CVE-2026-63585"],"modified":"2026-11-24T14:15:32.263784593Z","published":"2026-11-24T14:13:11.918Z","database_specific":{"capec_ids":["CAPEC-137"],"cpe_ids":["cpe:2.3:a:ex-aws:ex_aws_s3:*:*:*:*:*:*:*:*"],"cwe_ids":["CWE-116"]},"references":[{"type":"ADVISORY","url":"https://github.com/ex-aws/ex_aws_s3/security/advisories/GHSA-6fg2-v8g4-vfg2"},{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-63585.html"},{"type":"WEB","url":"https://github.com/ex-aws/ex_aws_s3/commit/4ce4d72219c0cb8de9356278203d8ea780311b75"},{"type":"FIX","url":"https://github.com/ex-aws/ex_aws_s3/commit/dd422637a46203d01cc47fd832836758f8090556"},{"type":"PACKAGE","url":"https://hex.pm/packages/ex_aws_s3"}],"affected":[{"package":{"name":"ex_aws_s3","ecosystem":"Hex","purl":"pkg:hex/ex_aws_s3"},"ranges":[{"type":"SEMVER","events":[{"introduced":"2.0.0"},{"fixed":"2.6.0"}]}],"versions":["2.0.0","2.0.1","2.0.2","2.1.0","2.2.0","2.3.0","2.3.1","2.3.2","2.3.3","2.4.0","2.5.0","2.5.1","2.5.2","2.5.3","2.5.4","2.5.5","2.5.6","2.5.7","2.5.8","2.5.9"],"database_specific":{"source":"https://cna.erlef.org/osv/EEF-CVE-2026-63585.json"}},{"ranges":[{"type":"GIT","repo":"https://github.com/ex-aws/ex_aws_s3","events":[{"introduced":"4ce4d72219c0cb8de9356278203d8ea780311b75"},{"fixed":"dd422637a46203d01cc47fd832836758f8090556"}]}],"versions":["v2.5.9","v2.5.8","v2.5.7","v2.5.5","v2.5.4","v2.5.3","v2.5.2","v2.5.1","v2.5.0","v2.4.0","v2.3.3","v2.3.2","v2.3.1","v2.3.0","v2.1.0","v2.0.2","v2.0.1","v2.0.0"],"database_specific":{"source":"https://cna.erlef.org/osv/EEF-CVE-2026-63585.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:H/SI:L/SA:N","source":"CNA"}],"credits":[{"name":"Peter Ullrich","type":"FINDER"},{"name":"Peter Ullrich","type":"REPORTER"},{"name":"Jonatan Männchen / EEF","type":"ANALYST"},{"name":"Peter Ullrich","type":"COORDINATOR"},{"name":"Bernard Duggan","type":"REMEDIATION_DEVELOPER"}]}