CVE-2026-62273 in ex_aws_s3
Summary
by MITRE • 11/24/2026
XML 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.
ExAws.S3.put_object_tagging/4 and ExAws.S3.put_bucket_tagging/2 in lib/ex_aws/s3.ex build the <TagSet> request body by interpolating tag keys and values directly into <Key> and <Value> 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 <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 ex_aws_s3: from 2.0.2 before 2.6.0.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/24/2026
The vulnerability identified in the ex-aws library, specifically within the ex_aws_s3 module prior to version 2.6.0, represents a critical XML injection flaw that compromises the integrity of Amazon S3 tagging operations. This security defect arises from improper input validation and sanitization practices when constructing HTTP request bodies for object and bucket tagging APIs. The core technical issue lies in how tag keys and values are serialized into XML format. When an application utilizes functions such as ExAws.S3.put_object_tagging or ExAws.S3.put_bucket_tagging, the library interpolates user-supplied data directly into XML elements using standard string conversion methods without applying necessary escaping mechanisms. This oversight allows malicious actors who control tag inputs to break out of the intended XML structure and inject arbitrary tags into the request payload.
From a technical perspective, the flaw stems from the inconsistent application of security helpers within the library codebase. While other functions like delete_multiple_objects correctly utilize an escape_xml_string helper to sanitize input data, the tagging-related endpoints fail to do so for tag keys and values. This inconsistency creates a predictable attack vector where special characters in user-supplied strings can be exploited to terminate existing XML tags prematurely. For instance, if an attacker provides a value containing specific delimiters or control sequences that mimic XML structure boundaries, they can effectively close the current element and open new ones with arbitrary content. The result is that a single intended tag entry on the client side translates into multiple forged entries in the actual HTTP request sent to AWS S3 services.
The operational impact of this vulnerability extends beyond simple data corruption due to the critical role tags play in Amazon S3 security policies and cost management strategies. Tags are frequently used as conditions in IAM access control policies, allowing administrators to grant or deny permissions based on specific tag key-value pairs. By injecting forged tags, an attacker can manipulate these authorization checks. For example, if a policy grants read access only to objects tagged with environment=production, an injection attack could introduce this exact tag into the request metadata of unauthorized resources, thereby bypassing security controls and gaining illicit access. Furthermore, since S3 uses tags for cost allocation reporting, injected entries can distort financial tracking data, leading to inaccurate billing or resource attribution metrics that may trigger false alerts or mask actual usage patterns.
This vulnerability aligns with CWE-91, which describes XML Injection flaws resulting from the failure to properly neutralize special characters in user-controllable input before it is included in XML documents. The attack technique corresponds to ATT&CK tactic Taint and Command Injection, specifically involving data manipulation through injection techniques that alter system behavior by modifying structured data formats. In cloud environments where infrastructure-as-code and automated tagging are prevalent, such vulnerabilities pose a significant risk because they exploit trust boundaries between application logic and cloud service APIs without requiring authentication bypasses at the network level.
To mitigate this vulnerability, organizations must immediately upgrade ex_aws_s3 to version 2.6.0 or later, which addresses the serialization issue by ensuring all tag inputs are properly escaped before being embedded in XML payloads. For applications unable to update immediately due to dependency constraints, implementing a custom wrapper that applies rigorous input sanitization is recommended. This includes validating that tag keys and values do not contain characters capable of breaking XML structure, such as angle brackets or specific control sequences defined by the S3 API specification. Additionally, adopting least-privilege principles for IAM roles associated with these tagging operations can limit the blast radius if an injection attempt succeeds. Regular security audits focusing on how external data is serialized into structured formats like JSON and XML are essential to prevent similar issues in other parts of the codebase that may rely on inconsistent escaping practices.