{"id":"EEF-CVE-2026-63583","summary":"XML injection in ExAws.S3.Utils.build_lifecycle_rule/1 in ex_aws_s3","details":"## Summary\n\n`ExAws.S3.Utils.build_lifecycle_rule/1` in ex_aws_s3 interpolates caller-supplied lifecycle rule fields (the rule id, filter prefix, tag key and value, storage class, and noncurrent-version count) directly into the `PutBucketLifecycleConfiguration` XML body without escaping XML metacharacters. An application that populates any of these fields from untrusted input (for example a tenant-supplied object tag) lets an attacker break out of the surrounding element and inject arbitrary XML into the request, including an entirely new lifecycle action such as a delete-after-one-day expiration that destroys the bucket's objects. The public entry point `ExAws.S3.put_bucket_lifecycle/2` flows directly into this builder.\n\nThis issue affects ex_aws_s3: from 2.3.0 before 2.6.0.\n\n## Details\n\n**1. Unescaped interpolation.** `build_lifecycle_rule/1` in `lib/ex_aws/s3/utils.ex` builds each text node of the `PutBucketLifecycleConfiguration` body by raw string interpolation: the rule `id`, the filter `prefix`, tag `key` and `value`, the `storage` class and `newer_noncurrent_versions`. None is XML-escaped or validated before `IO.iodata_to_binary/1` flattens the body.\n\n**2. Element break-out.** A value containing XML metacharacters is emitted verbatim. A tag value such as `frontend\u003c/Value\u003e\u003c/Tag\u003e\u003c/Filter\u003e\u003cExpiration\u003e\u003cDays\u003e1\u003c/Days\u003e\u003c/Expiration\u003e\u003cFilter\u003e\u003cTag\u003e\u003cKey\u003eteam\u003c/Key\u003e\u003cValue\u003efrontend` closes the `\u003cValue\u003e`, injects an `\u003cExpiration\u003e` action and reopens a `\u003cFilter\u003e`, so the rest of the document stays well-formed. The same technique can close and reopen `\u003cRule\u003e` to append a separate rule.\n\n**3. Delivery.** The public entry point `ExAws.S3.put_bucket_lifecycle/2` flows directly into this builder, so S3 receives and applies the injected lifecycle configuration as soon as the request is sent with `ExAws.request/2`.\n\n## Proof of concept\n\n1. A multi-tenant application mirrors tenant-supplied object tags into an S3 lifecycle rule: `ExAws.S3.put_bucket_lifecycle(\"tenant-bucket\", [rule]) |\u003e ExAws.request(config)` with `filter: %{tags: [{\"team\", value}]}`.\n2. The tenant sets the tag value to `frontend\u003c/Value\u003e\u003c/Tag\u003e\u003c/Filter\u003e\u003cExpiration\u003e\u003cDays\u003e1\u003c/Days\u003e\u003c/Expiration\u003e\u003cFilter\u003e\u003cTag\u003e\u003cKey\u003eteam\u003c/Key\u003e\u003cValue\u003efrontend`.\n3. `build_lifecycle_rule/1` interpolates it unescaped into the request body.\n4. The body S3 receives contains `//Rule/Expiration/Days` equal to `1`: an injected action that expires the bucket's objects after one day.\n\n## Impact\n\nThis is an XML/document injection vulnerability in the construction of the `PutBucketLifecycleConfiguration` request. Any application that uses `ex_aws_s3` and populates a lifecycle rule's id, prefix, tag key/value, storage class, or noncurrent-version count from data it does not fully control is affected. An attacker who controls one of those fields can inject arbitrary lifecycle actions or rules into the request, most damagingly an expiration that deletes the bucket's objects, leading to data loss or unintended retention/transition policies. Multi-tenant services that map tenant-supplied tags or identifiers into bucket lifecycle configuration are the most exposed.\n\n## Workarounds\n\nApplications can escape or strictly validate any untrusted value before passing it into a lifecycle rule field (the rule id, filter prefix, tag key or value, storage class, or noncurrent-version count) so that XML metacharacters cannot alter the request structure.","aliases":["GHSA-pcgv-phrm-r85v","CVE-2026-63583"],"modified":"2026-11-24T14:15:04.253437189Z","published":"2026-11-24T14:14:58.243Z","database_specific":{"cwe_ids":["CWE-91"],"capec_ids":["CAPEC-250"],"cpe_ids":["cpe:2.3:a:ex-aws:ex_aws_s3:*:*:*:*:*:*:*:*"]},"references":[{"type":"ADVISORY","url":"https://github.com/ex-aws/ex_aws_s3/security/advisories/GHSA-pcgv-phrm-r85v"},{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-63583.html"},{"type":"WEB","url":"https://github.com/ex-aws/ex_aws_s3/commit/34a3f1b264bd9a28d68fa98173af7085da72a15b"},{"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.3.0"},{"fixed":"2.6.0"}]}],"versions":["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-63583.json"}},{"ranges":[{"type":"GIT","repo":"https://github.com/ex-aws/ex_aws_s3","events":[{"introduced":"34a3f1b264bd9a28d68fa98173af7085da72a15b"},{"fixed":"eda0b9b9c63707f7db8d8f18c331df7fda57c397"}]}],"database_specific":{"source":"https://cna.erlef.org/osv/EEF-CVE-2026-63583.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:H/VA:N/SC:N/SI:H/SA:H","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"}]}