Vulnerabilities in pkg:gem/protocol-http1

PACKAGE
Advisory Identifier: GHSA-6jwc-qr2q-7xwj
Advisory Summary

CVE-2023-38697 is a MODERATE (CVSS 5.8) protocol-http1 http request/response smuggling vulnerability vulnerability (CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) affecting Protocol http1 libraries in the RubyGems ecosystem. The issue involves protocol-http1 http request/response smuggling vulnerability. Remediation is available by upgrading affected packages to version 0.15.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/protocol-http1

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/protocol-http1. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-6jwc-qr2q-7xwj CVE-2023-38697 MODERATE protocol-http1 HTTP Request/Response Smuggling vulnerability

CVE-2023-38697 at a Glance

CVE Identifier CVE-2023-38697
GHSA Identifier GHSA-6jwc-qr2q-7xwj
Severity MODERATE
CVSS v3.1 Base Score 5.8
CWE Classification CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
Affected Product Protocol http1
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.8

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:C/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 Changed (S:C)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-38697

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

protocol-http1 fixed: 0.15.1
Upgrade protocol-http1 to 0.15.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 protocol-http1

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-38697, inspect your project dependencies for Protocol http1:

inspect dependencies for protocol-http1

Analyze the terminal output to locate any version of Protocol http1 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.15.1), 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-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling'), where the product acts as an intermediary http agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed http requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination. In Protocol http1, 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

### Impact [RFC 9112 Section 7.1](https://www.rfc-editor.org/rfc/rfc9112#name-chunked-transfer-coding) defined the format of chunk size, chunk data and chunk extension (detailed ABNF is in Appendix section). In summary: - The value of Content-Length header should be a string of 0-9 digits. - The chunk size should be a string of hex digits and should split from chunk data using CRLF. - The chunk extension shouldn't contain any invisible character. However, we found that Falcon has following behaviors while disobey the corresponding RFCs. - Falcon accepts Content-Length header values that have "+" prefix. - Falcon accepts Content-Length header values that written in hexadecimal with "0x" prefix. - Falcon accepts "0x" and "+" prefixed chunk size. - Falcon accepts LF in chunk extension. This behavior can lead to desync when forwarding through multiple HTTP parsers, potentially results in HTTP request smuggling and firewall bypassing. Note that while these issues were reproduced in Falcon (the server), the issue is with `protocol-http1` which implements the HTTP/1 protocol parser. We have not yet been advised of any real world exploit or practical attack. ### Patches Fixed in `protocol-http1` v0.15.1+. ### Workarounds None. ### References https://github.com/socketry/protocol-http1/pull/20

CVE-2023-38697 Affected Protocol http1 Versions

1 component(s)
Fixed Versions:
0.15.1
Product / Package Ecosystem Affected Versions Fixed Version
protocol-http1
RubyGems
< 0.15.1
0.15.1

References

Frequently Asked Questions

What is CVE-2023-38697?
CVE-2023-38697 is a security vulnerability in Protocol http1 involving protocol-http1 HTTP Request/Response Smuggling vulnerability under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling').
Which Protocol http1 versions are affected?
Affected versions include releases prior to 0.15.1 across affected packages: protocol-http1.
What version fixes CVE-2023-38697?
Upgrading to 0.15.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is protocol-http1 affected?
Yes, protocol-http1 is affected in releases prior to 0.15.1. Upgrade your dependency to 0.15.1 or later.
What is the CVSS score of CVE-2023-38697?
CVE-2023-38697 has a CVSS v3.1 base score of 5.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N.
What CWE is associated with CVE-2023-38697?
CVE-2023-38697 is classified under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') (The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed HTTP requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination.).
How can I check RubyGems dependencies for CVE-2023-38697?
Run the dependency tree command: 'inspect dependencies for protocol-http1'. 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-6jwc-qr2q-7xwj",
  "modified" : "2023-08-10T22:16:47Z",
  "published" : "2023-08-03T16:36:34Z",
  "aliases" : [ "CVE-2023-38697" ],
  "summary" : "protocol-http1 HTTP Request/Response Smuggling vulnerability",
  "details" : "### Impact\n\n[RFC 9112 Section 7.1](https://www.rfc-editor.org/rfc/rfc9112#name-chunked-transfer-coding) defined the format of chunk size, chunk data and chunk extension (detailed ABNF is in Appendix section).\n\nIn summary:\n\n- The value of Content-Length header should be a string of 0-9 digits.\n- The chunk size should be a string of hex digits and should split from chunk data using CRLF.\n- The chunk extension shouldn't contain any invisible character.\n\nHowever, we found that Falcon has following behaviors while disobey the corresponding RFCs.\n\n- Falcon accepts Content-Length header values that have \"+\" prefix.\n- Falcon accepts Content-Length header values that written in hexadecimal with \"0x\" prefix.\n- Falcon accepts \"0x\" and \"+\" prefixed chunk size.\n- Falcon accepts LF in chunk extension.\n\nThis behavior can lead to desync when forwarding through multiple HTTP parsers, potentially results in HTTP request smuggling and firewall bypassing. Note that while these issues were reproduced in Falcon (the server), the issue is with `protocol-http1` which implements the HTTP/1 protocol parser. We have not yet been advised of any real world exploit or practical attack.\n\n### Patches\n\nFixed in `protocol-http1` v0.15.1+.\n\n### Workarounds\n\nNone.\n\n### References\n\nhttps://github.com/socketry/protocol-http1/pull/20",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "protocol-http1"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.15.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/socketry/protocol-http1/security/advisories/GHSA-6jwc-qr2q-7xwj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-38697"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/socketry/protocol-http1/pull/20"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/socketry/protocol-http1/commit/e11fc164fd2b36f7b7e785e69fa8859eb06bcedd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/protocol-http1/CVE-2023-38697.yml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/socketry/protocol-http1"
  }, {
    "type" : "WEB",
    "url" : "https://www.rfc-editor.org/rfc/rfc9112#name-chunked-transfer-coding"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-444" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-03T16:36:34Z",
    "nvd_published_at" : "2023-08-04T18:15:15Z"
  }
}