CVE-2026-63582 in ex_aws_s3
Summary
by MITRE • 11/24/2026
Externally Controlled Reference to a Resource in Another Sphere vulnerability in ex-aws ex_aws_s3 allows an attacker who controls an S3 bucket name to make presigned URLs and presigned POST forms point at a host of their choice.
With virtual_host: true, s3_accelerate: true or bucket_as_host: true, ExAws.S3.presigned_url/5 and ExAws.S3.presigned_post/4 build the URL from the bucket name without checking it. A bucket such as attacker.example/x? turns the URL into https://attacker.example/x?.s3.amazonaws.com..., and the signature is computed for that host. Clients given the URL upload their files to, or download content from, the attacker's host, and every such URL discloses the access key id. With bucket_as_host: true any valid hostname works as the bucket name.
This issue affects ex_aws_s3: from 2.0.0 before 2.6.0.
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Analysis
by VulDB Data Team • 11/24/2026
The vulnerability identified in the ex-aws library, specifically within the ex_aws_s3 component prior to version 2.6.0, represents a critical flaw related to externally controlled references to resources in another sphere. This security issue arises from improper validation of user-supplied input when constructing presigned URLs and presigned POST forms for Amazon S3 buckets. The core technical failure lies in the library's handling of bucket names under specific configuration modes such as virtual_host, s3_accelerate, or bucket_as_host being enabled. In these configurations, the code constructs the target URL directly from the provided bucket name without performing adequate sanitization or validation to ensure that the string represents a legitimate S3 bucket identifier rather than an arbitrary hostname.
When an attacker controls the input for the bucket name, they can inject malicious hostnames into the resulting presigned URLs. For instance, if the configuration allows virtual hosting and a user supplies a value like attacker.example/x? as the bucket name, the library generates a URL where the domain portion is replaced by the injected hostname. The signature included in the presigned URL is computed based on this manipulated request structure, meaning that AWS validates the signature against the attacker's host rather than Amazon S3 infrastructure. Consequently, any client using this maliciously crafted URL will direct their HTTP requests to the attacker-controlled server instead of the intended S3 bucket. This behavior effectively allows an attacker to intercept traffic or redirect uploads and downloads away from secure storage environments.
The operational impact of this vulnerability is severe due to the disclosure of sensitive credentials and the potential for data exfiltration or injection. Every presigned URL generated with a manipulated bucket name includes the AWS Access Key ID in plain text within the query parameters. This exposes long-term or short-term credential identifiers that can be harvested by attackers for further reconnaissance or brute-force attacks against associated IAM roles. Furthermore, because clients trust these URLs as valid instructions from an authorized source, they may upload sensitive data to attacker-controlled endpoints, leading to unauthorized data collection. Conversely, if the vulnerability is exploited in a context where downloads are initiated, it could facilitate phishing campaigns by serving malicious content disguised as legitimate S3 resources.
This flaw aligns with CWE-829, which describes Inclusion of Functionality from Untrusted Control Sphere, and maps directly to MITRE ATT&CK technique T1564.007, known as Hostile Data Spoofing via URL Manipulation. The attack vector relies on the victim application or user trusting a presigned URL that has been tampered with by an adversary who had control over the bucket name parameter during generation. It is important to note that this issue specifically affects configurations where the bucket name is used directly as part of the host structure, such as when virtual_hosting is enabled in ex_aws_s3 versions from 2.0.0 up to but not including 2.6.0.
To mitigate this vulnerability, organizations must immediately upgrade the ex-aws library and specifically the ex_aws_s3 package to version 2.6.0 or later, where input validation has been strengthened to prevent hostname injection through bucket name parameters. Additionally, developers should review their application logic for any dynamic construction of S3 URLs using user-supplied data. Implementing strict allow-lists for valid bucket names and ensuring that only alphanumeric characters and hyphens are accepted can provide defense-in-depth against such manipulation. It is also advisable to audit existing codebases for instances where presigned URLs are generated with external inputs, as these represent high-risk areas requiring immediate remediation through library updates or custom validation logic until the upgrade is complete.