GitHub Advisoryadvisory · RubyGems
GHSA-6jwc-qr2q-7xwj protocol-http1 HTTP Request/Response Smuggling vulnerability
MEDIUM
Official page ↗
- Aliases
- CVE-2023-38697
- Ecosystem
- RubyGems
- Packages
- protocol-http1
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N
- Weaknesses
- CWE-444
- Reviewed
- 2023-08-03
Affected packages
• RubyGems protocol-http1: < 0.15.1 → fixed in 0.15.1
Description
Impact
RFC 9112 Section 7.1 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
Related
Alias · CVE (1)
- CVE-2023-38697 protocol-http1 provides a low-level implementation of the HTTP/1 protocol. vulnerability
Weakness · CWE (1)
- CWE-444 Inconsistent Interpretation of HTTP Requests weakness
References
- https://github.com/socketry/protocol-http1/security/advisories/GHSA-6jwc-qr2q-7xwj web
- https://nvd.nist.gov/vuln/detail/CVE-2023-38697 advisory
- https://github.com/socketry/protocol-http1/pull/20 web
- https://github.com/socketry/protocol-http1/commit/e11fc164fd2b36f7b7e785e69fa8859eb06bcedd web
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/protocol-http1/CVE-2023-38697.yml web
- https://github.com/socketry/protocol-http1 package
- https://www.rfc-editor.org/rfc/rfc9112#name-chunked-transfer-coding web