CVE-2026-131902 in ex_aws_s3
Summary
by MITRE • 11/24/2026
XML 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.
delete_multiple_objects/3 in lib/ex_aws/s3.ex builds the <Delete> request body by placing each object's version between <VersionId> tags without XML escaping. A version such as v1</VersionId></Object><Object><Key>important-file</Key></Object><Object><Key>x</Key><VersionId>v2 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.
This issue affects ex_aws_s3: from 2.0.0 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 as an XML injection flaw within the ex-aws library specifically impacts the ex_aws_s3 component, affecting versions ranging from 2.0.0 up to but not including 2.6.0. This security issue arises in the delete_multiple_objects/3 function located in lib/ex_aws/s3.ex, which is responsible for constructing the XML request body required by Amazon S3 to perform batch deletions of objects. The core technical flaw lies in the failure to properly escape user-supplied input before embedding it into the XML structure. Specifically, when processing object version identifiers provided by the caller, the library inserts these values directly between <VersionId> tags without applying any form of sanitization or encoding. This lack of proper output encoding allows an attacker who controls the content of the object version id to inject arbitrary XML fragments into the request payload.
From a technical perspective, this vulnerability is classified under CWE-74 as Improper Neutralization of Special Elements in Output Used by a Downstream Component. The mechanism of exploitation involves crafting a malicious string for the version identifier that includes closing tags and new opening tags. For instance, if an attacker provides a version id such as v1</VersionId></Object><Object><Key>important-file</Key></Object><Object><Key>x</Key><VersionId>v2, the resulting XML structure is altered significantly. The injected </VersionId> tag closes the intended object entry prematurely, followed by </Object> which terminates that specific deletion request. Immediately after, a new <Object> block is opened with arbitrary keys and version ids defined by the attacker. This effectively allows the injection of additional delete operations into the batch process that were not originally requested or authorized by the application logic calling the function.
The operational impact of this vulnerability is severe, particularly in multi-tenant environments where multiple users share access to the same S3 bucket. Because Amazon S3 processes the entire XML body as a single transactional unit for deletion requests, an attacker can manipulate the batch delete operation to remove objects that were never intended to be deleted by the application. This includes critical files managed by other tenants or system components within the same storage container. The consequence is not merely data loss but also potential denial of service and integrity compromise across shared resources. Since S3 does not validate whether the caller has permission to delete every object listed in a batch request if they have bucket-level write permissions, this injection can lead to widespread unauthorized deletion of sensitive data belonging to other users or critical application assets.
This vulnerability aligns with MITRE ATT&CK technique T1485, specifically Volume Shadow Service Deletion on Windows, although adapted here for cloud storage object destruction via Injection (T1190). The attacker leverages the injection capability to bypass intended access controls and execute destructive actions against resources outside their direct scope. To mitigate this risk, organizations using affected versions of ex-aws must upgrade immediately to version 2.6.0 or later, where the issue has been resolved by implementing proper XML escaping for all user-supplied inputs before they are embedded in the request body. Until an upgrade is performed, developers should implement strict input validation and sanitization on any object identifiers passed to delete operations, ensuring that special characters such as angle brackets are escaped using standard HTML or XML entity encoding techniques like < and >. Additionally, applying least-privilege principles by restricting bucket policies can limit the blast radius if an injection attempt occurs.