CVE-2026-63581 in ex_aws_s3
Summary
by MITRE • 11/24/2026
XML Injection vulnerability in ex-aws ex_aws_s3 (ExAws.S3 module) allows an attacker to inject arbitrary XML configuration elements into S3 bucket-configuration request bodies via unescaped, caller-supplied values.
This vulnerability is associated with program files lib/ex_aws/s3.ex and program routines ExAws.S3.put_bucket_logging/2, ExAws.S3.put_bucket_notification/2, ExAws.S3.put_bucket_replication/2, ExAws.S3.put_bucket_website/2.
The bucket-configuration body builders construct their XML by interpolating caller-supplied values directly into the request body without escaping, and never route them through the module's own escape_xml_string/1 helper. A value containing XML metacharacters (<, >, &, quotes) can close the intended element early and open attacker-chosen elements, which the builder's trailing closing tag then closes, keeping the document single-rooted and well-formed. In a multi-tenant application where tenants configure their own bucket settings, an attacker who can influence one of the interpolated field values (for example the logging target, a notification ARN, a replication destination or Account, or a website redirect HostName) can inject arbitrary configuration nodes into a request the application signs and sends to AWS. The affected builders are reached through the public functions put_bucket_logging/2, put_bucket_notification/2, put_bucket_replication/2, and put_bucket_website/2.
This issue affects ex_aws_s3: from 2.5.9 before 2.6.0.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 11/26/2026
The vulnerability identified in the ExAws.S3 module of the ex-aws library represents a critical XML Injection flaw that compromises the integrity and security of Amazon S3 bucket configurations. This issue arises specifically within functions responsible for setting up logging, notifications, replication rules, and website hosting endpoints. The core technical defect lies in how these functions construct the HTTP request body. Instead of utilizing the module's dedicated escape_xml_string helper to sanitize input data, the builders directly interpolate caller-supplied values into the XML structure. This lack of proper encoding allows special characters such as angle brackets, ampersands, and quotation marks to be interpreted by the underlying XML parser rather than being treated as literal string content. Consequently, an attacker who can control any field passed to these functions can manipulate the resulting document structure.
From a technical perspective, this vulnerability enables an attacker to close existing XML elements prematurely and inject arbitrary new nodes into the configuration payload. Because the builder appends closing tags for the original intended element at the end of the request body, the injected content is seamlessly integrated while maintaining valid XML syntax with a single root node. This structural integrity ensures that AWS accepts the malformed but well-formed document without raising parsing errors. The attack vector targets specific public API functions including put_bucket_logging/2, put_bucket_notification/2, put_bucket_replication/2, and put_bucket_website/2. By injecting malicious configuration nodes, an attacker can alter how data is logged, where notifications are sent, or which external hosts receive replication traffic.
The operational impact of this vulnerability is severe, particularly in multi-tenant environments where different users configure their own S3 bucket settings. If a tenant can influence the input values for logging targets, notification ARNs, replication destinations, or website redirect hostnames, they can effectively hijack the configuration behavior of other tenants or even administrative accounts if those configurations are shared or improperly isolated. For instance, an attacker could redirect logging data to a server under their control, facilitating unauthorized surveillance of sensitive bucket activity. Alternatively, by modifying notification ARNs, they might trigger actions in connected AWS services like Lambda functions or SQS queues that were not intended for the victim's use case. In cases involving website hosting configurations, injecting malicious hostnames could lead to phishing attacks or redirection to compromised infrastructure.
This flaw aligns with CWE-91, which describes XML Injection vulnerabilities where untrusted data is used as input in an XML document without proper validation or escaping of special elements. The exploitation technique also maps closely to MITRE ATT&CK techniques related to Command and Scripting Interpreter abuse, specifically the injection of commands into interpreted environments, although here the target is a cloud service configuration API rather than a local shell. The vulnerability persists because the library fails to enforce strict input sanitization before serialization. This oversight allows structured data manipulation that bypasses standard security controls relying on XML schema validation or simple string matching.
Mitigation strategies must focus on immediate updates and defensive coding practices. Users of ex-aws_s3 versions prior to 2.6.0 should upgrade to version 2.6.0 or later, where the developers have addressed this issue by ensuring that all user-supplied values are properly escaped before being inserted into XML request bodies. For applications unable to update immediately, a temporary workaround involves implementing custom wrapper functions that manually escape special characters in any input passed to these S3 configuration endpoints. Developers should also audit their codebases for other instances where unescaped data is interpolated into XML or HTML contexts to prevent similar injection attacks across the application stack. Regular security reviews and static analysis tools configured to detect unsafe string interpolation patterns can further reduce the risk of such vulnerabilities emerging in future development cycles.