CVE-2023-0040: Github.com/swift server/async http client Async HTTP Client Has CRLF Vulnerability

HIGH
Advisory Identifier: GHSA-v3r5-pjpm-mwgq
CVSS 7.5
CWE-74 CWE-93
Published
Advisory Summary

CVE-2023-0040 is a HIGH (CVSS 7.5) async http client has crlf vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Github.com/swift server/async http client libraries in the SwiftURL ecosystem. The issue involves async http client has crlf injection vulnerability in http request headers. Remediation is available by upgrading affected packages to version 1.13.2, 1.12.1, 1.9.1, 1.4.1.

CVE-2023-0040 at a Glance

CVE Identifier CVE-2023-0040
GHSA Identifier GHSA-v3r5-pjpm-mwgq
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Github.com/swift server/async http client
Package Ecosystem SwiftURL
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/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 High (I:H)
Availability None (A:N)

How to Fix CVE-2023-0040

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

github.com/swift-server/async-http-client fixed: 1.13.2
Upgrade github.com/swift-server/async-http-client to 1.13.2
github.com/swift-server/async-http-client fixed: 1.12.1
Upgrade github.com/swift-server/async-http-client to 1.12.1
github.com/swift-server/async-http-client fixed: 1.9.1
Upgrade github.com/swift-server/async-http-client to 1.9.1
github.com/swift-server/async-http-client fixed: 1.4.1
Upgrade github.com/swift-server/async-http-client to 1.4.1
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 github.com/swift-server/async-http-client

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-0040, inspect your project dependencies for Github.com/swift server/async http client:

inspect dependencies for github.com/swift-server/async-http-client

Analyze the terminal output to locate any version of Github.com/swift server/async http client in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.13.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-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Github.com/swift server/async http client, 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

Versions of Async HTTP Client prior to 1.13.2 are vulnerable to a form of targeted request manipulation called CRLF injection. This vulnerability was the result of insufficient validation of HTTP header field values before sending them to the network. Users are vulnerable if they pass untrusted data into HTTP header field values without prior sanitisation. Common use-cases here might be to place usernames from a database into HTTP header fields. This vulnerability allows attackers to inject new HTTP header fields, or entirely new requests, into the data stream. This can cause requests to be understood very differently by the remote server than was intended. In general, this is unlikely to result in data disclosure, but it can result in a number of logical errors and other misbehaviours.

CVE-2023-0040 Affected Github.com/swift server/async http client Versions

4 component(s)
Fixed Versions:
1.13.21.12.11.9.11.4.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/swift-server/async-http-client
SwiftURL
≥ 1.13.0
< 1.13.2
1.13.2
github.com/swift-server/async-http-client
SwiftURL
≥ 1.10.0
< 1.12.1
1.12.1
github.com/swift-server/async-http-client
SwiftURL
≥ 1.5.0
< 1.9.1
1.9.1
github.com/swift-server/async-http-client
SwiftURL
< 1.4.1
1.4.1

References

Frequently Asked Questions

What is CVE-2023-0040?
CVE-2023-0040 is a security vulnerability in Github.com/swift server/async http client involving Async HTTP Client has CRLF Injection vulnerability in HTTP request headers under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Github.com/swift server/async http client versions are affected?
Affected versions include releases prior to 1.13.2, 1.12.1, 1.9.1, 1.4.1 across affected packages: github.com/swift-server/async-http-client.
What version fixes CVE-2023-0040?
Upgrading to 1.13.2, 1.12.1, 1.9.1, 1.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/swift-server/async-http-client affected?
Yes, github.com/swift-server/async-http-client is affected in releases prior to 1.13.2, 1.12.1, 1.9.1, 1.4.1. Upgrade your dependency to 1.13.2, 1.12.1, 1.9.1, 1.4.1 or later.
What is the CVSS score of CVE-2023-0040?
CVE-2023-0040 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2023-0040?
CVE-2023-0040 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check SwiftURL dependencies for CVE-2023-0040?
Run the dependency tree command: 'inspect dependencies for github.com/swift-server/async-http-client'. 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-v3r5-pjpm-mwgq",
  "modified" : "2023-06-07T15:52:55Z",
  "published" : "2023-06-07T15:52:55Z",
  "aliases" : [ "CVE-2023-0040" ],
  "summary" : "Async HTTP Client has CRLF Injection vulnerability in HTTP request headers",
  "details" : "Versions of Async HTTP Client prior to 1.13.2 are vulnerable to a form of targeted request manipulation called CRLF injection. This vulnerability was the result of insufficient validation of HTTP header field values before sending them to the network. Users are vulnerable if they pass untrusted data into HTTP header field values without prior sanitisation. Common use-cases here might be to place usernames from a database into HTTP header fields.\n\nThis vulnerability allows attackers to inject new HTTP header fields, or entirely new requests, into the data stream. This can cause requests to be understood very differently by the remote server than was intended. In general, this is unlikely to result in data disclosure, but it can result in a number of logical errors and other misbehaviours.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "SwiftURL",
      "name" : "github.com/swift-server/async-http-client"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.13.0"
      }, {
        "fixed" : "1.13.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "SwiftURL",
      "name" : "github.com/swift-server/async-http-client"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.10.0"
      }, {
        "fixed" : "1.12.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "SwiftURL",
      "name" : "github.com/swift-server/async-http-client"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5.0"
      }, {
        "fixed" : "1.9.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "SwiftURL",
      "name" : "github.com/swift-server/async-http-client"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/swift-server/async-http-client/security/advisories/GHSA-v3r5-pjpm-mwgq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-0040"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/swift-server/async-http-client/commit/7f05a8da46cc2a4ab43218722298b81ac7a08031"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/swift-server/async-http-client"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/swift-server/async-http-client/releases/tag/1.12.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/swift-server/async-http-client/releases/tag/1.13.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/swift-server/async-http-client/releases/tag/1.4.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/swift-server/async-http-client/releases/tag/1.9.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74", "CWE-93" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-07T15:52:55Z",
    "nvd_published_at" : "2023-01-18T19:15:00Z"
  }
}