{"id":"EEF-CVE-2026-62273","summary":"XML injection via unescaped tag keys and values in ex_aws_s3 object and bucket tagging","details":"## Summary\n\nXML Injection vulnerability in ex-aws ex_aws_s3 allows an attacker who controls tag keys or values to inject forged tag entries into S3 object and bucket tagging requests.\n\n`ExAws.S3.put_object_tagging/4` and `ExAws.S3.put_bucket_tagging/2` in `lib/ex_aws/s3.ex` build the `\u003cTagSet\u003e` request body by interpolating tag keys and values directly into `\u003cKey\u003e` and `\u003cValue\u003e` elements via `to_string/1`, without applying the module's existing `escape_xml_string/1` helper (which `delete_multiple_objects` already uses for object keys). An application that forwards user-supplied data as a tag key or value lets an attacker close the intended element and inject attacker-chosen `\u003cTag\u003e` entries. For example, a tag value of `blue\u003c/Value\u003e\u003c/Tag\u003e\u003cTag\u003e\u003cKey\u003eowner\u003c/Key\u003e\u003cValue\u003eadmin` turns one intended tag into two tags on the wire. Because S3 honors tags in access-control conditions (`aws:RequestTag`, `s3:ExistingObjectTag`) and cost-allocation reporting, an injected tag can forge an authorization-relevant tag or corrupt the intended tag set.\n\nThis issue affects ex_aws_s3: from 2.0.2 before 2.6.0.\n\n## Details\n\n**1. Unescaped interpolation.** `ExAws.S3.put_bucket_tagging/2` and `ExAws.S3.put_object_tagging/4` in `lib/ex_aws/s3.ex` build each `\u003cTag\u003e` element by placing `to_string(key)` and `to_string(value)` directly inside `\u003cKey\u003e` and `\u003cValue\u003e`. The module's `escape_xml_string/1` helper, which `delete_multiple_objects` already applies to object keys, is not used.\n\n**2. Element break-out.** XML metacharacters in a key or value are emitted verbatim. A value such as `blue\u003c/Value\u003e\u003c/Tag\u003e\u003cTag\u003e\u003cKey\u003eowner\u003c/Key\u003e\u003cValue\u003eadmin` closes the intended `\u003cValue\u003e` and `\u003cTag\u003e` and opens a new `\u003cTag\u003e` of the attacker's choosing, so S3 parses two tags where the application intended one.\n\n**3. Effect in S3.** S3 honors tags in access-control conditions (`aws:RequestTag`, `s3:ExistingObjectTag/\u003ckey\u003e`) and in cost-allocation reporting, so the injected tag can set an authorization-relevant key the application never meant to assign, or override and corrupt the legitimate tag set.\n\n## Proof of concept\n\n1. An application forwards a user-supplied tag value: `ExAws.S3.put_object_tagging(\"victim-bucket\", \"user/object.txt\", [{\"customer\", value}]) |\u003e ExAws.request()`.\n2. The attacker supplies the value `blue\u003c/Value\u003e\u003c/Tag\u003e\u003cTag\u003e\u003cKey\u003eowner\u003c/Key\u003e\u003cValue\u003eadmin`.\n3. `put_object_tagging/4` interpolates it into the `\u003cTagSet\u003e` body without escaping.\n4. The request body S3 receives contains two `\u003cTag\u003e` elements: `customer=blue` and the forged `owner=admin`.\n\n## Impact\n\nThis is an XML injection vulnerability. It affects any application that uses `ex_aws_s3` and passes user-influenced data as tag keys or values to `put_object_tagging/4` or `put_bucket_tagging/2`. An attacker who controls part of a tag key or value can inject additional `\u003cTag\u003e` elements into the request S3 receives, forging tags used for tag-based access control and cost allocation, or corrupting the intended tag set. The only precondition is that user-controlled input reaches the tag key/value of one of these calls.\n\n## Workarounds\n\nBefore passing user-influenced data to `put_object_tagging/4` or `put_bucket_tagging/2`, validate and reject any tag key or value containing XML metacharacters (`\u003c`, `\u003e`, `&`, `\"`, `'`), or restrict tag keys and values to an allowlisted character set.","aliases":["GHSA-979q-5hj9-vvvv","CVE-2026-62273"],"modified":"2026-11-24T14:30:02.502935410Z","published":"2026-11-24T14:15:59.569Z","database_specific":{"cpe_ids":["cpe:2.3:a:ex-aws:ex_aws_s3:*:*:*:*:*:*:*:*"],"cwe_ids":["CWE-91"],"capec_ids":["CAPEC-250"]},"references":[{"type":"ADVISORY","url":"https://github.com/ex-aws/ex_aws_s3/security/advisories/GHSA-979q-5hj9-vvvv"},{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-62273.html"},{"type":"WEB","url":"https://github.com/ex-aws/ex_aws_s3/commit/c6331b84c80f09d24d4a25cf05d8604541ce162e"},{"type":"FIX","url":"https://github.com/ex-aws/ex_aws_s3/commit/eda0b9b9c63707f7db8d8f18c331df7fda57c397"},{"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.2"},{"fixed":"2.6.0"}]}],"versions":["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-62273.json"}},{"ranges":[{"type":"GIT","repo":"https://github.com/ex-aws/ex_aws_s3","events":[{"introduced":"c6331b84c80f09d24d4a25cf05d8604541ce162e"},{"fixed":"eda0b9b9c63707f7db8d8f18c331df7fda57c397"}]}],"database_specific":{"source":"https://cna.erlef.org/osv/EEF-CVE-2026-62273.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:N/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"}]}