{"id":"EEF-CVE-2026-131902","summary":"XML injection via unescaped VersionId in ExAws.S3.delete_multiple_objects/3","details":"## Summary\n\nXML Injection vulnerability in ex-aws ex_aws_s3 allows an attacker who controls an object version id passed to `ExAws.S3.delete_multiple_objects/3` to add objects to the batch delete.\n\n`delete_multiple_objects/3` in `lib/ex_aws/s3.ex` builds the `\u003cDelete\u003e` request body by placing each object's `version` between `\u003cVersionId\u003e` tags without XML escaping. A version such as `v1\u003c/VersionId\u003e\u003c/Object\u003e\u003cObject\u003e\u003cKey\u003eimportant-file\u003c/Key\u003e\u003c/Object\u003e\u003cObject\u003e\u003cKey\u003ex\u003c/Key\u003e\u003cVersionId\u003ev2` closes the caller's object and opens new ones, so S3 deletes objects the application never listed, including other users' objects in the same bucket.\n\nThis issue affects ex_aws_s3: from 2.0.0 before 2.6.0.\n\n## Details\n\n**1. Selective escaping.** When `delete_multiple_objects/3` in `lib/ex_aws/s3.ex` builds the `\u003cDelete\u003e` body, it escapes each object's key with `escape_xml_string/1` but emits the version from the same tuple raw: `\"\u003cVersionId\u003e\", version, \"\u003c/VersionId\u003e\"`.\n\n**2. Element break-out.** XML metacharacters in `version` are read as markup. A value beginning `\u003c/VersionId\u003e\u003c/Object\u003e` closes the current object early, and the rest of the string can open further `\u003cObject\u003e...\u003c/Object\u003e` elements while keeping the document well-formed.\n\n**3. Extra deletes.** The body POSTed to S3 lists more delete targets than the caller passed in, so a single crafted version id removes arbitrary additional objects in the bucket.\n\n## Proof of concept\n\n1. An application lets a user delete a version of their own object and calls `ExAws.S3.delete_multiple_objects(\"user-bucket\", [{key, version}])` with the user's `key` and `version`.\n2. The attacker sends the key `my-own-file` and the version `v1\u003c/VersionId\u003e\u003c/Object\u003e\u003cObject\u003e\u003cKey\u003eimportant-file\u003c/Key\u003e\u003c/Object\u003e\u003cObject\u003e\u003cKey\u003ex\u003c/Key\u003e\u003cVersionId\u003ev2`.\n3. `delete_multiple_objects/3` interpolates the version unescaped into the `\u003cDelete\u003e` body.\n4. The body contains three `\u003cObject\u003e` entries, one of them `important-file`, which S3 deletes although the user never named it.\n\n## Impact\n\nAn attacker who controls a version id passed to `delete_multiple_objects/3` can make the batched delete request remove arbitrary additional objects in the same bucket, including objects belonging to other users or critical to the application. Services that let users delete a specific object version by id are affected.\n\n## Configurations\n\nReachable only when the application passes a version id derived, even partially, from untrusted input to `ExAws.S3.delete_multiple_objects/3`, for example a service that lets users delete a specific object version by id.","aliases":["GHSA-mwxg-gfj8-x32v","CVE-2026-131902"],"modified":"2026-11-24T14:15:04.253618245Z","published":"2026-11-24T14:13:43.953Z","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-mwxg-gfj8-x32v"},{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-131902.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/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.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-131902.json"}},{"ranges":[{"type":"GIT","repo":"https://github.com/ex-aws/ex_aws_s3","events":[{"introduced":"4ce4d72219c0cb8de9356278203d8ea780311b75"},{"fixed":"eda0b9b9c63707f7db8d8f18c331df7fda57c397"}]}],"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-131902.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:H/SC:N/SI:N/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"}]}