CVE-2024-47220
Description
An issue was discovered in the WEBrick toolkit through 1.8.1 for Ruby. It allows HTTP request smuggling by providing both a Content-Length header and a Transfer-Encoding header, e.g., "GET /admin HTTP/1.1\r\n" inside of a "POST /user HTTP/1.1\r\n" request. NOTE: the supplier's position is "Webrick should not be used in production."
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
WEBrick through 1.8.1 allows HTTP request smuggling via conflicting Content-Length and Transfer-Encoding headers.
Vulnerability
Details
CVE-2024-47220 describes an HTTP request smuggling vulnerability in the WEBrick HTTP server toolkit for Ruby, affecting versions through 1.8.1 [1]. The root cause is improper handling of HTTP requests that include both a Content-Length header and a Transfer-Encoding header. An attacker can craft a request that embeds a smuggled request (e.g., GET /admin HTTP/1.1\r\n) inside a benign-looking request (e.g., POST /user HTTP/1.1\r\n) [1]. This is a classic request smuggling scenario where the server parses the request boundaries differently than intended.
Exploitation
To exploit this vulnerability, an attacker sends an HTTP request with both headers to a WEBrick server. The server's parsing logic may interpret the message length based on one header while another part of the logic uses the other, leading to desynchronization [2]. The attack does not require authentication and can be performed from any network position that can reach the WEBrick server [1]. The smuggled request is often directed at a protected resource or endpoint that would otherwise be restricted.
Impact
Successful exploitation allows an attacker to bypass access controls, poison web caches, or perform actions under a different user's session [1]. For example, an attacker could access an administrative endpoint (/admin) that is normally not exposed directly. The impact depends on the server's configuration and the protected resources behind it.
Mitigation
The WEBrick developers have addressed this issue in a pull request [2]. Users should upgrade to WEBrick version 1.8.2 or later [4]. However, the official supplier's position is that WEBrick should not be used in production environments [1]. For production use, a more robust HTTP server such as Puma or Unicorn is recommended.
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
webrickRubyGems | < 1.8.2 | 1.8.2 |
Affected products
39- osv-coords38 versionspkg:apk/chainguard/kube-fluentd-operatorpkg:apk/chainguard/kube-fluentd-operator-compatpkg:apk/chainguard/kube-fluentd-operator-default-configpkg:apk/chainguard/kube-fluentd-operator-oci-entrypointpkg:apk/chainguard/ruby3.1-fluentd-kubernetes-daemonset-1.16pkg:apk/chainguard/ruby3.1-fluentd-kubernetes-daemonset-1.16-kinesispkg:apk/chainguard/ruby3.2-fluentd-kubernetes-daemonset-1.16pkg:apk/chainguard/ruby3.2-fluentd-kubernetes-daemonset-1.16-kinesispkg:apk/chainguard/ruby3.2-webrickpkg:apk/chainguard/ruby3.3-fluentd-kubernetes-daemonset-1.16pkg:apk/chainguard/ruby3.3-fluentd-kubernetes-daemonset-1.16-kinesispkg:apk/chainguard/ruby3.4-fluentd-kubernetes-daemonset-1.16pkg:apk/chainguard/ruby3.4-fluentd-kubernetes-daemonset-1.16-kinesispkg:apk/wolfi/kube-fluentd-operatorpkg:apk/wolfi/kube-fluentd-operator-compatpkg:apk/wolfi/kube-fluentd-operator-default-configpkg:apk/wolfi/kube-fluentd-operator-oci-entrypointpkg:apk/wolfi/ruby3.2-webrickpkg:gem/webrickpkg:rpm/opensuse/ruby2.5&distro=openSUSE%20Leap%2015.6pkg:rpm/suse/ruby2.1&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5-LTSSpkg:rpm/suse/ruby2.1&distro=SUSE%20Linux%20Enterprise%20Server%20LTSS%20Extended%20Security%2012%20SP5pkg:rpm/suse/ruby2.5&distro=SUSE%20Enterprise%20Storage%207.1pkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-ESPOSpkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-LTSSpkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP5-ESPOSpkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP5-LTSSpkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP6pkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP7pkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSSpkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP4-LTSSpkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP5-LTSSpkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3pkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP4pkg:rpm/suse/ruby2.5&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP5pkg:rpm/suse/ruby2.5&distro=SUSE%20Manager%20Proxy%204.3pkg:rpm/suse/ruby2.5&distro=SUSE%20Manager%20Server%204.3
< 1.18.2-r33+ 37 more
- (no CPE)range: < 1.18.2-r33
- (no CPE)range: < 1.18.2-r33
- (no CPE)range: < 1.18.2-r33
- (no CPE)range: < 1.18.2-r33
- (no CPE)range: < 1.16.6.1.2-r1
- (no CPE)range: < 1.16.6.1.2-r1
- (no CPE)range: < 1.16.6.1.2-r1
- (no CPE)range: < 1.16.6.1.2-r1
- (no CPE)range: < 1.8.2-r0
- (no CPE)range: < 1.16.6.1.2-r1
- (no CPE)range: < 1.16.6.1.2-r1
- (no CPE)range: < 1.16.6.1.2-r2
- (no CPE)range: < 1.16.6.1.2-r2
- (no CPE)range: < 1.18.2-r33
- (no CPE)range: < 1.18.2-r33
- (no CPE)range: < 1.18.2-r33
- (no CPE)range: < 1.18.2-r33
- (no CPE)range: < 1.8.2-r0
- (no CPE)range: < 1.8.2
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.1.9-19.9.1
- (no CPE)range: < 2.1.9-19.9.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150700.24.3.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
- (no CPE)range: < 2.5.9-150000.4.36.1
Patches
1f5faca922254Prevent request smuggling
2 files changed · +22 −0
lib/webrick/httprequest.rb+4 −0 modified@@ -531,6 +531,10 @@ def parse_host_request_line(host) def read_body(socket, block) return unless socket if tc = self['transfer-encoding'] + if self['content-length'] + raise HTTPStatus::BadRequest, "request with both transfer-encoding and content-length, possible request smuggling" + end + case tc when /\Achunked\z/io then read_chunked(socket, block) else raise HTTPStatus::NotImplemented, "Transfer-Encoding: #{tc}."
test/webrick/test_httprequest.rb+18 −0 modified@@ -219,6 +219,24 @@ def test_duplicate_content_length_header } end + def test_content_length_and_transfer_encoding_headers_smuggling + msg = <<~HTTP.gsub("\n", "\r\n") + POST /user HTTP/1.1 + Content-Length: 28 + Transfer-Encoding: chunked + + 0 + + GET /admin HTTP/1.1 + + HTTP + req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP) + req.parse(StringIO.new(msg)) + assert_raise(WEBrick::HTTPStatus::BadRequest){ + req.body + } + end + def test_parse_headers msg = <<~HTTP.gsub("\n", "\r\n") GET /path HTTP/1.1
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- github.com/advisories/GHSA-6f62-3596-g6w7ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-47220ghsaADVISORY
- github.com/ruby/webrick/commit/f5faca9222541591e1a7c3c97552ebb0c92733c7ghsaWEB
- github.com/ruby/webrick/issues/145nvdWEB
- github.com/ruby/webrick/issues/145nvdWEB
- github.com/ruby/webrick/issues/145nvdWEB
- github.com/ruby/webrick/pull/146/commits/d88321da45dcd230ac2b4585cad4833d6d5e8841nvdWEB
- github.com/rubysec/ruby-advisory-db/blob/master/gems/webrick/CVE-2024-47220.ymlghsaWEB
News mentions
0No linked articles in our index yet.