CVE-2017-18587: Hyper Headers Containing Newline Characters Can Vulnerability

MODERATE
Advisory Identifier: GHSA-q89x-f52w-6hj2
CVSS 5.3
CWE-93
Published
Advisory Summary

CVE-2017-18587 is a MODERATE (CVSS 5.3) headers containing newline characters can vulnerability (CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')) affecting Hyper libraries in the crates.io ecosystem. The issue involves headers containing newline characters can split messages in hyper. Remediation is available by upgrading affected packages to version 0.10.2, 0.9.18.

CVE-2017-18587 at a Glance

CVE Identifier CVE-2017-18587
GHSA Identifier GHSA-q89x-f52w-6hj2
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')
Affected Product Hyper
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

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

How to Fix CVE-2017-18587

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

hyper fixed: 0.10.2
Upgrade hyper to 0.10.2
hyper fixed: 0.9.18
Upgrade hyper to 0.9.18
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 hyper

How to Check if You Are Affected

To determine whether your application is affected by CVE-2017-18587, inspect your project dependencies for Hyper:

inspect dependencies for hyper

Analyze the terminal output to locate any version of Hyper in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.10.2), 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-93: Improper Neutralization of CRLF Sequences ('CRLF Injection'), where the product uses crlf (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes crlf sequences from inputs. In Hyper, 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

Serializing of headers to the socket did not filter the values for newline bytes (\r or \n), which allowed for header values to split a request or response. People would not likely include newlines in the headers in their own applications, so the way for most people to exploit this is if an application constructs headers based on unsanitized user input. This issue was fixed by replacing all newline characters with a space during serialization of a header value.

CVE-2017-18587 Affected Hyper Versions

2 component(s)
Fixed Versions:
0.10.20.9.18
Product / Package Ecosystem Affected Versions Fixed Version
hyper
crates.io
≥ 0.10.0
< 0.10.2
0.10.2
hyper
crates.io
< 0.9.18
0.9.18

References

Frequently Asked Questions

What is CVE-2017-18587?
CVE-2017-18587 is a security vulnerability in Hyper involving Headers containing newline characters can split messages in hyper under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection').
Which Hyper versions are affected?
Affected versions include releases prior to 0.10.2, 0.9.18 across affected packages: hyper.
What version fixes CVE-2017-18587?
Upgrading to 0.10.2, 0.9.18 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hyper affected?
Yes, hyper is affected in releases prior to 0.10.2, 0.9.18. Upgrade your dependency to 0.10.2, 0.9.18 or later.
What is the CVSS score of CVE-2017-18587?
CVE-2017-18587 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2017-18587?
CVE-2017-18587 is classified under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection') (The product uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs.).
How can I check crates.io dependencies for CVE-2017-18587?
Run the dependency tree command: 'inspect dependencies for hyper'. 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-q89x-f52w-6hj2",
  "modified" : "2023-06-13T17:39:45Z",
  "published" : "2021-08-25T20:43:04Z",
  "aliases" : [ "CVE-2017-18587" ],
  "summary" : "Headers containing newline characters can split messages in hyper",
  "details" : "Serializing of headers to the socket did not filter the values for newline bytes (\\r or \\n), which allowed for header values to split a request or response. People would not likely include newlines in the headers in their own applications, so the way for most people to exploit this is if an application constructs headers based on unsanitized user input.\n\nThis issue was fixed by replacing all newline characters with a space during serialization of a header value.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "hyper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.10.0"
      }, {
        "fixed" : "0.10.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "hyper"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.9.18"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-18587"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hyperium/hyper"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hyperium/hyper/wiki/Security-001"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2017-0002.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-93" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-08-19T21:25:19Z",
    "nvd_published_at" : "2019-08-26T13:15:00Z"
  }
}