Where
-Infinity
0
Severity
7
AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:H/SA:H

Summary

ExAws.S3.Utils.buildlifecyclerule/1 in exawss3 interpolates caller-supplied lifecycle rule fields (the rule id, filter prefix, tag key and value, storage class, and noncurrent-version count) directly into the PutBucketLifecycleConfiguration XML body without escaping XML metacharacters. An application that populates any of these fields from untrusted input (for example a tenant-supplied object tag) lets an attacker break out of the surrounding element and inject arbitrary XML into the request, including an entirely new lifecycle action such as a delete-after-one-day expiration that destroys the bucket's objects. The public entry point ExAws.S3.putbucketlifecycle/2 flows directly into this builder.

This issue affects exawss3: from 2.3.0 before 2.6.0.

Details

1. Unescaped interpolation. buildlifecyclerule/1 in lib/exaws/s3/utils.ex builds each text node of the PutBucketLifecycleConfiguration body by raw string interpolation: the rule id, the filter prefix, tag key and value, the storage class and newernoncurrentversions. None is XML-escaped or validated before IO.iodatatobinary/1 flattens the body.

2. Element break-out. A value containing XML metacharacters is emitted verbatim. A tag value such as frontend</Value></Tag></Filter><Expiration><Days>1</Days></Expiration><Filter><Tag><Key>team</Key><Value>frontend closes the <Value>, injects an <Expiration> action and reopens a <Filter>, so the rest of the document stays well-formed. The same technique can close and reopen <Rule> to append a separate rule.

3. Delivery. The public entry point ExAws.S3.putbucketlifecycle/2 flows directly into this builder, so S3 receives and applies the injected lifecycle configuration as soon as the request is sent with ExAws.request/2.

Proof of concept

1. A multi-tenant application mirrors tenant-supplied object tags into an S3 lifecycle rule: ExAws.S3.putbucketlifecycle("tenant-bucket", [rule]) |> ExAws.request(config) with filter: %{tags: [{"team", value}]}. 2. The tenant sets the tag value to frontend</Value></Tag></Filter><Expiration><Days>1</Days></Expiration><Filter><Tag><Key>team</Key><Value>frontend. 3. buildlifecyclerule/1 interpolates it unescaped into the request body. 4. The body S3 receives contains //Rule/Expiration/Days equal to 1: an injected action that expires the bucket's objects after one day.

Impact

This is an XML/document injection vulnerability in the construction of the PutBucketLifecycleConfiguration request. Any application that uses exawss3 and populates a lifecycle rule's id, prefix, tag key/value, storage class, or noncurrent-version count from data it does not fully control is affected. An attacker who controls one of those fields can inject arbitrary lifecycle actions or rules into the request, most damagingly an expiration that deletes the bucket's objects, leading to data loss or unintended retention/transition policies. Multi-tenant services that map tenant-supplied tags or identifiers into bucket lifecycle configuration are the most exposed.

Workarounds

Applications can escape or strictly validate any untrusted value before passing it into a lifecycle rule field (the rule id, filter prefix, tag key or value, storage class, or noncurrent-version count) so that XML metacharacters cannot alter the request structure.

1 / 2
Source: OSV
First published (updated )
Severity
5.9
AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N

Summary

XML Injection vulnerability in ex-aws exawss3 allows an attacker who controls an object version id passed to ExAws.S3.deletemultipleobjects/3 to add objects to the batch delete.

deletemultipleobjects/3 in lib/exaws/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 exawss3: from 2.0.0 before 2.6.0.

Details

1. Selective escaping. When deletemultipleobjects/3 in lib/exaws/s3.ex builds the <Delete> body, it escapes each object's key with escapexmlstring/1 but emits the version from the same tuple raw: "<VersionId>", version, "</VersionId>".

2. Element break-out. XML metacharacters in version are read as markup. A value beginning </VersionId></Object> closes the current object early, and the rest of the string can open further <Object>...</Object> elements while keeping the document well-formed.

3. Extra deletes. The body POSTed to S3 lists more delete targets than the caller passed in, so a single crafted version id removes arbitrary additional objects in the bucket.

Proof of concept

1. An application lets a user delete a version of their own object and calls ExAws.S3.deletemultipleobjects("user-bucket", [{key, version}]) with the user's key and version. 2. The attacker sends the key my-own-file and the version v1</VersionId></Object><Object><Key>important-file</Key></Object><Object><Key>x</Key><VersionId>v2. 3. deletemultipleobjects/3 interpolates the version unescaped into the <Delete> body. 4. The body contains three <Object> entries, one of them important-file, which S3 deletes although the user never named it.

Impact

An attacker who controls a version id passed to deletemultipleobjects/3 can make the batched delete request remove arbitrary additional objects in the same bucket, including objects belonging to other users or critical to the application. Services that let users delete a specific object version by id are affected.

Configurations

Reachable only when the application passes a version id derived, even partially, from untrusted input to ExAws.S3.deletemultipleobjects/3, for example a service that lets users delete a specific object version by id.

1 / 2
Source: OSV
First published (updated )
Severity
5.8
AV:L/AC:L/AT:P/PR:N/UI:P/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N

Summary

Externally Controlled Reference to a Resource in Another Sphere vulnerability in ex-aws exawss3 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 virtualhost: true, s3accelerate: true or bucketashost: true, ExAws.S3.presignedurl/5 and ExAws.S3.presignedpost/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 bucketashost: true any valid hostname works as the bucket name.

This issue affects exawss3: from 2.0.0 before 2.6.0.

Details

1. URL construction. The private urltosign/5 in lib/exaws/s3.ex builds the URL for presignedurl/5 and presignedpost/4 as "#{scheme}#{bucket}.#{host}#{port}#{object}" when virtualhost is set, or "#{scheme}#{bucket}#{port}#{object}" with bucketashost. s3accelerate: true sets virtualhost and takes the same branch. The bucket name is not checked.

2. Signing for the attacker's host. The string goes to ExAws.Auth.presignedurl/9, which signs URI.parse(url).authority. For the bucket attacker.example/x? the signed host is attacker.example, and the ? pushes the object key into the query string.

3. Effect. Presigned URLs are built locally and never pass through ExAws.Operation.S3.addbuckettopath/2, so the fix in exaws for the request path does not cover them. A browser submitting the presigned POST sends its upload to the attacker, a client following a presigned GET receives attacker content, and X-Amz-Credential discloses the access key id. The secret key is not disclosed and the signature cannot be replayed against AWS.

Proof of concept

1. An application presigns uploads for per-tenant buckets with virtualhost: true. 2. A tenant sets its bucket name to attacker.example/x?. 3. ExAws.S3.presignedurl(config, :put, bucket, "key", virtualhost: true) returns https://attacker.example/x?.s3.amazonaws.com%2Fkey=&X-Amz-Credential=..., and presignedpost/4 returns the form action https://attacker.example/x?.s3.amazonaws.com. 4. URI.parse/1 on either yields the host attacker.example, so any client given the URL or form connects there.

Impact

An attacker who can choose the bucket name makes the application hand out presigned URLs and POST forms that point at the attacker's host. Files other users upload through those forms go to the attacker, presigned downloads serve attacker-controlled content under the application's name, and every such URL discloses the access key id. Applications that presign for per-tenant or user-supplied buckets with virtual-host addressing are affected.

Configurations

Reachable only when presigned URLs or POST forms are generated with virtualhost: true, s3accelerate: true or bucketashost: true and the application passes a bucket name an attacker can influence, for example per-tenant or user-supplied buckets. Path-style presigning, the default, places the bucket in the path and is not affected.

Solutions

Upgrading rejects bucket names containing characters that can change the host of a presigned URL. With bucketashost: true, a syntactically valid hostname is still used as the host after upgrading: applications that presign with bucketashost: true and bucket names they do not fully control must also pass the bucketashostallowlist option, or set it in the S3 config, with the list of trusted hostnames.

1 / 2
Source: OSV
First published (updated )
Severity
4.8
AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:H/SI:L/SA:N

Summary

ExAws.S3 constructs S3 ACL grant headers (such as x-amz-grant-read and x-amz-grant-full-control) in formatgrantheader/1 by interpolating grantee identifiers into a quoted, comma-separated list without escaping. Grantee email and id values are wrapped in double quotes and joined with a comma, but double-quote, comma, and CR/LF characters in the value are not neutralized. An application that passes an attacker-influenced grantee value (for example an email address taken from a "share this object" feature) into an ACL grant option (grantread, grantwrite, grantreadacp, grantwriteacp, or grantfullcontrol) lets the attacker close the quoted token and inject an additional grantee, such as the attacker's own canonical id or the predefined AllUsers group URI, into the header. S3 then applies the injected grantee, granting an arbitrary principal the same permission (up to full control or public access) in an unintended ACL grantee-injection and privilege-escalation issue.

This issue affects exawss3: from 2.0.0 before 2.6.0.

Details

1. Header grammar. S3 grant headers such as x-amz-grant-read and x-amz-grant-full-control are a comma-separated list of quoted grantee tuples, type="id"[, type="id"]....

2. Unescaped interpolation. formatgrantheader/1 in lib/exaws/s3/utils.ex builds each tuple as emailAddress="#{email}" or #{key}="#{value}" and joins them with , . It does not check identifiers against the id or email grammar and does not reject or escape ", , or CR/LF.

3. Grantee injection. A grantee value such as x", id="ATTACKERCANONICALID closes the quoted token and opens a second tuple, producing id="x", id="ATTACKERCANONICALID". S3 parses two grantees and gives the injected principal the permission the header conveys, up to full control for x-amz-grant-full-control.

Proof of concept

1. An application offers "share this object" and calls ExAws.S3.putobjectacl("victim-bucket", "secret.txt", grantread: [email: email]) with a user-supplied email. 2. The attacker submits the email victim@example.com", id="ATTACKERCANONICALIDdeadbeef. 3. formatgrantheader/1 interpolates it into emailAddress="...", closing the quote after victim@example.com and opening a second tuple. 4. The x-amz-grant-read header carries emailAddress="victim@example.com", id="ATTACKERCANONICALIDdeadbeef", granting the attacker's principal read access.

Impact

This is an ACL grantee-injection vulnerability leading to unintended permission grants and potential privilege escalation. It affects any application using ExAws.S3 ACL grant options (grantread, grantwrite, grantreadacp, grantwriteacp, grantfullcontrol) where the grantee email or id is derived from untrusted input. An attacker who can influence a grantee value can grant their own AWS principal access to objects or buckets, up to full control, by injecting an extra grantee into the comma-separated grant header.

Workarounds

Validate grantee identifiers before passing them to ExAws.S3 ACL grant options and reject any value containing a double quote, comma, or CR/LF character, or restrict grantee input to trusted canonical ids and email addresses that match the expected S3 grantee grammar.

Configurations

The vulnerability requires the host application to pass untrusted input into an ExAws.S3 ACL grant option (grantread, grantwrite, grantreadacp, grantwriteacp, or grantfullcontrol). Applications that only pass trusted, validated grantee identifiers into these options are not affected.

1 / 2
Source: OSV
First published (updated )
Severity
2.1
AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N

Summary

exawss3 builds x-amz-meta- request headers by interpolating user-supplied object metadata directly into header names and values without any validation. In ExAws.S3.Utils.buildmetaheaders/1 (lib/exaws/s3/utils.ex), each :meta entry is turned into a header as {"x-amz-meta-#{k}", v} with no check for carriage return (CR), line feed (LF), or other illegal header bytes.

Object metadata is routinely derived from end-user input (for example an upload service that lets users attach a comment or label to an object). When such input reaches ExAws.S3.putobject/4 or any other operation accepting the :meta option, a value containing CR/LF is carried unchanged into the outbound header list. If the configured HTTP adapter does not neutralize header values before writing them to the socket, the embedded CRLF starts a new header line, allowing an attacker to inject arbitrary headers into (or split) the HTTP request the library sends to the S3 endpoint. This is an HTTP header (CRLF) injection leading to HTTP request splitting. The practical impact depends on the HTTP adapter, and no authentication is required beyond the ability to influence object metadata.

This issue affects exawss3: from 2.0.0 before 2.6.0.

Details

1. Unvalidated header construction. ExAws.S3.Utils.buildmetaheaders/1 in lib/exaws/s3/utils.ex turns each :meta entry into {"x-amz-meta-#{k}", v}. Neither the key nor the value is checked for CR, LF or other illegal header bytes.

2. Untrusted metadata. Object metadata is routinely populated from end-user input, such as a comment or label attached to an upload. A value like "legit\r\nX-Injected-By-Attacker: pwned" reaches the header list unchanged through ExAws.S3.putobject/4 or any operation taking :meta.

3. Header injection. If the HTTP adapter does not validate header values before writing them to the socket, the embedded CRLF ends the x-amz-meta- line and starts a new one, injecting arbitrary headers into, or splitting, the request sent to S3. The library delegates this safety to the adapter entirely.

Proof of concept

1. An upload service forwards user-supplied metadata: ExAws.S3.putobject("victim-bucket", "uploads/file.txt", "hello", meta: [{"comment", value}]). 2. The attacker sets the value to legit\r\nX-Injected-By-Attacker: pwned\r\nX-Smuggled: yes. 3. buildmetaheaders/1 copies it verbatim into the x-amz-meta-comment header. 4. With an adapter that does not reject CR/LF, the bytes on the wire contain X-Injected-By-Attacker: pwned and X-Smuggled: yes as separate header lines.

Impact

This is an HTTP header (CRLF) injection / request-splitting issue. Anyone using exawss3 to store objects whose metadata is derived from untrusted input (upload services, multi-tenant file stores, anything exposing object metadata over an HTTP boundary) is affected. The practical impact depends on the configured HTTP adapter: adapters that validate header values will reject or strip the injection, but the library offers no guarantee and performs no validation of its own, so the safety of the request is silently delegated to the HTTP client.

Workarounds

Reject or strip carriage return (CR) and line feed (LF) characters from object metadata keys and values before passing them to exawss3, or configure an HTTP adapter that neutralizes CR/LF in header values before writing them to the socket (for example hackney 4.x).

Configurations

The vulnerability is only exploitable when an application both populates object :meta entries from untrusted input and uses an HTTP adapter that does not neutralize CR/LF in header values before writing them to the socket. The default adapter (hackney 4.x) strips CR/LF from header values, which masks the issue; the library performs no validation of its own and silently delegates safety to the configured HTTP client.

1 / 2
Source: OSV
First published (updated )

XML Injection vulnerability in ex-aws exawss3 allows an attacker who controls tag keys or values to inject forged tag entries into S3 object and bucket tagging requests.

ExAws.S3.putobjecttagging/4 and ExAws.S3.putbuckettagging/2 in lib/exaws/s3.ex build the <TagSet> request body by interpolating tag keys and values directly into <Key> and <Value> elements via tostring/1, without applying the module's existing escapexmlstring/1 helper (which deletemultipleobjects 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 exawss3: from 2.0.2 before 2.6.0.

First published (updated )

XML Injection vulnerability in ex-aws exawss3 (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/exaws/s3.ex and program routines ExAws.S3.putbucketlogging/2, ExAws.S3.putbucketnotification/2, ExAws.S3.putbucketreplication/2, ExAws.S3.putbucketwebsite/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 escapexmlstring/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 putbucketlogging/2, putbucketnotification/2, putbucketreplication/2, and putbucketwebsite/2.

This issue affects exawss3: from 2.5.9 before 2.6.0.

First published (updated )

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203