CVE-2026-59698 in ex_awsinfo

Summary

by MITRE • 11/24/2026

Relative path traversal in ex_aws allows an attacker who controls an S3 object key to escape the intended bucket or key prefix.

When ex_aws builds a path-style S3 request, ExAws.Operation.S3.add_bucket_to_path/2 in lib/ex_aws/operation/s3.ex joins the bucket name and the object key into a single path string and then normalizes it, collapsing . and .. segments the way a filesystem path would. Because the bucket is the first segment of the combined string, a leading ../ in the object key pops the bucket off the path. With bucket mybucket and a key of ../victim/secret.txt, the combined /mybucket/../victim/secret.txt normalizes to /victim/secret.txt, so the request (signed with the application's own credentials) is sent to bucket victim. The same mechanism collapses ../ within a key, defeating any isolation an application enforces by prepending a trusted prefix.

Only the default path-style configuration is affected; requests built with virtual_host: true do not run this normalization. Because S3 treats object keys as opaque and does not resolve .. itself, the client-side normalization introduces a traversal that would not otherwise exist. Any application that derives an S3 object key from untrusted input and relies on the bucket, or a key prefix, as a tenant or trust boundary is exposed to cross-bucket or cross-prefix read and write, depending on the operation and the credentials' permissions.

This issue affects ex_aws: from 2.1.7 before 2.8.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 represents a critical relative path traversal flaw that compromises the integrity of Amazon S3 object access by allowing attackers to escape intended bucket boundaries or key prefixes. This issue arises specifically when the library constructs requests using the default path-style configuration, where the bucket name and object key are concatenated into a single URI path string before being normalized. The normalization process treats the combined string as a standard filesystem path, resolving relative segments such as dot-dot sequences. Consequently, if an attacker controls the input for the S3 object key and includes leading or embedded ../ characters, these sequences can pop the bucket name off the beginning of the path during normalization. For instance, with a target bucket named mybucket and a maliciously crafted key containing ../victim/secret.txt, the resulting normalized path becomes /victim/secret.txt rather than /mybucket/victim/secret.txt. This effectively redirects the request to an unintended destination bucket or directory structure that was not originally intended by the application logic.

The operational impact of this vulnerability is severe for applications that rely on S3 buckets or key prefixes as trust boundaries, such as multi-tenant architectures where each tenant has a dedicated bucket or prefix. Because the client-side normalization introduces path traversal behavior that does not exist in the underlying Amazon S3 service itself, it creates an attack vector based entirely on flawed input sanitization within the library. An attacker who can influence object key generation through untrusted user input can exploit this to perform cross-bucket reads or writes, depending on the permissions associated with the application's AWS credentials. This bypasses any isolation mechanisms implemented by prepending trusted prefixes to keys, as the traversal logic collapses these prefixes along with the bucket name. The vulnerability is particularly dangerous because it allows unauthorized access to sensitive data stored in other buckets that share the same IAM role or user credentials used for signing requests.

From a technical classification perspective, this flaw aligns closely with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal. The root cause lies in the improper handling of relative paths within the add_bucket_to_path function, which fails to validate or escape special characters that could alter the intended directory structure. In terms of offensive security frameworks, this vulnerability facilitates actions consistent with ATT&CK technique T1083: File and Directory Discovery, as it allows an attacker to enumerate and access resources outside their authorized scope. Furthermore, if write operations are permitted under the compromised credentials, it may also relate to T1565: Data Transferred from a Cloud Service or T1485: Data Destruction, depending on whether data is exfiltrated or modified. The vulnerability specifically affects versions of ex_aws from 2.1.7 up to but not including version 2.8.0, as earlier releases lack the necessary safeguards against this normalization behavior.

To mitigate this risk, organizations must upgrade immediately to ex_aws version 2.8.0 or later, where the path construction logic has been corrected to prevent such traversal attacks. In addition to upgrading dependencies, developers should implement strict input validation on all S3 object keys derived from untrusted sources, ensuring that no relative path components are permitted regardless of library behavior. It is also advisable to review IAM policies associated with application credentials to enforce least privilege principles, minimizing the blast radius in case a traversal attempt succeeds. Applications using virtual_host style requests are not affected by this specific flaw because they do not rely on the same path-based normalization mechanism; however, maintaining consistent security practices across all request types remains essential for comprehensive protection against cloud storage misconfigurations and client-side vulnerabilities.

Responsible

EEF

Reservation

07/06/2026

Disclosure

11/24/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!