CVE-2024-23644: Trillium http Improper Neutralization Of CRLF Sequences Vulnerability

MODERATE
Advisory Identifier: GHSA-9f9p-cp3c-72jf
CVSS 6.8
CWE-113 CWE-436
Published
Advisory Summary

CVE-2024-23644 is a MODERATE (CVSS 6.8) improper neutralization of crlf sequences vulnerability (CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')) affecting Trillium http libraries in the crates.io ecosystem. The issue involves improper neutralization of crlf sequences in http headers ('http request/response splitting') in trillium-http and trillium-client. Remediation is available by upgrading affected packages to version 0.3.12, 0.5.4.

CVE-2024-23644 at a Glance

CVE Identifier CVE-2024-23644
GHSA Identifier GHSA-9f9p-cp3c-72jf
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')
Affected Product Trillium http
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 6.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2024-23644

To remediate this vulnerability, upgrade all affected Trillium http dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

trillium-http fixed: 0.3.12
Upgrade trillium-http to 0.3.12
trillium-client fixed: 0.5.4
Upgrade trillium-client to 0.5.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for trillium-http

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-23644, inspect your project dependencies for Trillium http:

inspect dependencies for trillium-http

Analyze the terminal output to locate any version of Trillium http in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.12), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting'), where the product receives data from an http agent/component (e.g., web server, proxy, browser, etc.), but it does not neutralize or incorrectly neutralizes cr and lf characters before the data is included in outgoing http headers. In Trillium http, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Insufficient validation of outbound header values may lead to request splitting or response splitting attacks in scenarios where attackers have sufficient control over outbound headers. ### Details Outbound `trillium_http::HeaderValue` and `trillium_http::HeaderName` can be constructed infallibly and were not checked for illegal bytes when sending requests from the client or responses from the server. Thus, if an attacker has sufficient control over header values (or names) in a request or response that they could inject `\r\n` sequences, they could get the client and server out of sync, and then pivot to gain control over other parts of requests or responses. (i.e. exfiltrating data from other requests, SSRF, etc.) ### Patches #### trillium-http >= 0.3.12: * If a header name is invalid in server response headers, the specific header and any associated values are omitted from network transmission. * If a header value is invalid in server response headers, the individual header value is omitted from network transmission. Other headers values with the same header name will still be sent. #### trillium-client >= 0.5.4: * If any header name or header value is invalid in the client request headers, awaiting the client Conn returns an `Error::MalformedHeader` prior to any network access. ### Workarounds trillium services and client applications should sanitize or validate untrusted input that is included in header values and header names. Carriage return, newline, and null characters are not allowed. ### Impact This only affects use cases where attackers have control of outbound headers, and can insert "\r\n" sequences. Specifically, if untrusted and unvalidated input is inserted into header names or values. ### A note on timing from @jbr on behalf of `trillium-rs` @divergentdave filed this vulnerability many months ago but I did not see it until the evening of Jan 23, 2024. Patches were issued less than 24h after reading the vulnerability. The [security policy](https://github.com/trillium-rs/trillium/blob/main/SECURITY.md) has been [updated](https://github.com/trillium-rs/trillium/commit/b27950ceae52aa7a0f482494fe67b6069234d417) to avoid delays like this in the future.

CVE-2024-23644 Affected Trillium http Versions

2 component(s)
Fixed Versions:
0.3.120.5.4
Product / Package Ecosystem Affected Versions Fixed Version
trillium-http
crates.io
< 0.3.12
0.3.12
trillium-client
crates.io
< 0.5.4
0.5.4

References

Frequently Asked Questions

What is CVE-2024-23644?
CVE-2024-23644 is a security vulnerability in Trillium http involving Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') in trillium-http and trillium-client under CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting').
Which Trillium http versions are affected?
Affected versions include releases prior to 0.3.12, 0.5.4 across affected packages: trillium-http, trillium-client.
What version fixes CVE-2024-23644?
Upgrading to 0.3.12, 0.5.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is trillium-http affected?
Yes, trillium-http is affected in releases prior to 0.3.12. Upgrade your dependency to 0.3.12 or later.
Is trillium-client affected?
Yes, trillium-client is affected in releases prior to 0.5.4. Upgrade your dependency to 0.5.4 or later.
What is the CVSS score of CVE-2024-23644?
CVE-2024-23644 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2024-23644?
CVE-2024-23644 is classified under CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') (The product receives data from an HTTP agent/component (e.g., web server, proxy, browser, etc.), but it does not neutralize or incorrectly neutralizes CR and LF characters before the data is included in outgoing HTTP headers.).
How can I check crates.io dependencies for CVE-2024-23644?
Run the dependency tree command: 'inspect dependencies for trillium-http'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9f9p-cp3c-72jf",
  "modified" : "2024-01-24T21:32:24Z",
  "published" : "2024-01-24T20:20:38Z",
  "aliases" : [ "CVE-2024-23644" ],
  "summary" : "Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') in trillium-http and trillium-client",
  "details" : "### Summary\nInsufficient validation of outbound header values may lead to request splitting or response splitting attacks in scenarios where attackers have sufficient control over outbound headers.\n\n### Details\nOutbound `trillium_http::HeaderValue` and `trillium_http::HeaderName` can be constructed infallibly and were not checked for illegal bytes when sending requests from the client or responses from the server. Thus, if an attacker has sufficient control over header values (or names) in a request or response that they could inject `\\r\\n` sequences, they could get the client and server out of sync, and then pivot to gain control over other parts of requests or responses. (i.e. exfiltrating data from other requests, SSRF, etc.)\n\n### Patches\n\n#### trillium-http >= 0.3.12:\n* If a header name is invalid in server response headers, the specific header and any associated values are omitted from network transmission.\n* If a header value is invalid in server response headers, the individual header value is omitted from network transmission. Other headers values with the same header name will still be sent.\n\n#### trillium-client >= 0.5.4:\n* If any header name or header value is invalid in the client request headers, awaiting the client Conn returns an `Error::MalformedHeader` prior to any network access.\n\n### Workarounds\n\ntrillium services and client applications should sanitize or validate untrusted input that is included in header values and header names. Carriage return, newline, and null characters are not allowed.\n\n### Impact\n\nThis only affects use cases where attackers have control of outbound headers, and can insert \"\\r\\n\" sequences. Specifically, if untrusted and unvalidated input is inserted into header names or values.\n\n### A note on timing from @jbr on behalf of `trillium-rs`\n\n@divergentdave filed this vulnerability many months ago but I did not see it until the evening of Jan 23, 2024. Patches were issued less than 24h after reading the vulnerability. The [security policy](https://github.com/trillium-rs/trillium/blob/main/SECURITY.md) has been [updated](https://github.com/trillium-rs/trillium/commit/b27950ceae52aa7a0f482494fe67b6069234d417) to avoid delays like this in the future.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "trillium-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "trillium-client"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/trillium-rs/trillium/security/advisories/GHSA-9f9p-cp3c-72jf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-23644"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/trillium-rs/trillium/commit/16a42b3f8378a3fa4e61ece3e3e37e6a530df51d"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/trillium-rs/trillium/commit/8d468f85e27b8d0943d6f43ce9f8c7397141a999"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/trillium-rs/trillium"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2024-0008.html"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2024-0009.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-113", "CWE-436" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-24T20:20:38Z",
    "nvd_published_at" : "2024-01-24T20:15:53Z"
  }
}