CVE-2026-65621: Unvalidated object metadata in ex_aws_s3 enables HTTP header (CRLF) injection into S3 requests

Published Nov 24, 2026
·
Updated

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.

Other sources

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.

— MITRE

Affected Software

2 affected componentsFixes available
hex/ex_aws_s3>=2.0.0<2.6.0
erlang/ex_aws_s3>=2.0.0<2.6.0
2.6.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade erlang/ex_aws_s3 to a version that resolves this vulnerability.

    Fixed in 2.6.0
  2. Upgrade

    Upgrade ex_aws_s3 to a version that resolves this vulnerability.

    Fixed in 2.6.0
  3. Compensating control

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

Event History

Nov 24, 2026
CVE Published
via MITRE·02:13 PM
Data Sourced
via MITRE·02:13 PM
DescriptionWeakness
Data Sourced
via OSV·02:13 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What conditions are required for exploitation?

An attacker must be able to influence object metadata passed through the :meta option to ExAws.S3.put_object/4 or another operation that accepts :meta. Exploitation also depends on the configured HTTP adapter allowing CR/LF-containing header values to reach the socket without neutralizing them.

2

Are applications using default metadata handling exposed?

Exposure is relevant where application-controlled or end-user-controlled data is used as object metadata. The issue does not require authentication beyond the ability to influence that metadata.

3

What can be done before a fix is available?

Reject or remove carriage return, line feed, and other illegal HTTP header bytes from all metadata keys and values before passing them in the :meta option. Avoid placing untrusted user input directly into S3 object metadata.

4

How can I determine whether my application is affected?

Review calls to ExAws.S3.put_object/4 and other S3 operations that accept :meta, then trace whether metadata keys or values can originate from users or other untrusted sources. Also verify whether the configured HTTP adapter validates or neutralizes CR/LF in outbound header values.

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