CVE-2026-62273: XML injection via unescaped tag keys and values in ex_aws_s3 object and bucket tagging
XML Injection vulnerability in ex-aws exawss3 allows an attacker who controls tag keys or values to inject forged tag entries into S3 object and bucket tagging requests.
ExAws.S3.putobjecttagging/4 and ExAws.S3.putbuckettagging/2 in lib/exaws/s3.ex build the <TagSet> request body by interpolating tag keys and values directly into <Key> and <Value> elements via tostring/1, without applying the module's existing escapexmlstring/1 helper (which deletemultipleobjects 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 <Tag> entries. For example, a tag value of blue</Value></Tag><Tag><Key>owner</Key><Value>admin 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.
This issue affects exawss3: from 2.0.2 before 2.6.0.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to exploitation?
Applications using affected ex_aws_s3 versions are exposed only where untrusted or attacker-influenced data can reach tag keys or values passed to ExAws.S3.put_object_tagging/4 or ExAws.S3.put_bucket_tagging/2. The impact is especially significant when S3 tags are used in access-control conditions or cost-allocation reporting.
What does an attacker need to inject forged tags?
An attacker needs control over a tag key or value and must be able to supply XML markup that closes the intended Key or Value element and adds a new Tag element. For example, a value can terminate its enclosing elements and introduce an attacker-chosen key and value.
Are default tag values safe?
Tags that are fixed by the application and never incorporate attacker-controlled input are not described as exploitable. The vulnerable request construction directly converts supplied keys and values to strings without XML escaping.
What can be done if upgrading is not immediately possible?
Do not forward untrusted input into object or bucket tag keys or values. Restrict tag names and values to an allowlisted character set or otherwise XML-escape them before they reach the affected tagging calls.
How can I determine whether my deployment is affected?
Check whether hex/ex_aws_s3 is installed at version 2.0.2 or later but earlier than 2.6.0, and whether the application calls ExAws.S3.put_object_tagging/4 or ExAws.S3.put_bucket_tagging/2 with externally influenced tag data.