rack 3.1.21 → 3.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7aaf1007eae50de14eec6eaa6a4d586f1fe15b614bfe77bf68bea65c6ad59423
4
- data.tar.gz: 56ce4db8b9c1aeffaf750836ea16bf264841909aeb4befb81719e45189742ac3
3
+ metadata.gz: f3f9b36f03c948233dee682ef0a4724302be7f64dee1b599d45c7ef4068c6b0c
4
+ data.tar.gz: 428c57448bdc479dd1bab423ff9df7376e660a9603b648de733c7c08ae186693
5
5
  SHA512:
6
- metadata.gz: 3917f67c856cf670e2f3eaf4432b74366f8b5ee09a78ae2acad9075b10cca355fc718b5025fed92091b56187e4e614fc5ab24066c26298a3af4352ec064fe490
7
- data.tar.gz: 6a741930a02797a64a50bf7fb8e11957e4bf0c5771a26e0491c131c3ad71d0e120f5a70ceec80fe12c0d866daaa822eb0cdcb9f55a9a2d509ef01659fde08231
6
+ metadata.gz: f25b66f8c806f983f6ec504f5c97ffeec03d1994d8ba508763fb903923c28a9d6a85feab7bba9f6da248e90ef6697dabda9da32ea62d3935259ea4e963ad79d2
7
+ data.tar.gz: 2cc6a87b8003ed98a246913322e266e83e7c3cd1247e27e2540dbed28910cfef76c34dbd635f26da547817f2136d87468be6b3c98566c627fbf9b854f51cce62
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. For info on how to format all future additions to this file please reference [Keep A Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [3.1.22] - 2026-08-13
6
+
7
+ ### Security
8
+
9
+ - [CVE-2026-26962](https://github.com/advisories/GHSA-rx22-g9mx-qrhv) Improper unfolding of folded multipart headers preserves CRLF in parsed parameter values.
10
+
11
+ ### Fixed
12
+
13
+ - Restore Ruby 2.4/2.5 compatibility.
14
+
5
15
  ## [3.1.21] - 2026-04-01
6
16
 
7
17
  ### Security
@@ -17,7 +27,7 @@ All notable changes to this project will be documented in this file. For info on
17
27
  - [CVE-2026-34830](https://github.com/advisories/GHSA-qv7j-4883-hwh7) `Rack::Sendfile` header-based `X-Accel-Mapping` regex injection enables unauthorized `X-Accel-Redirect`.
18
28
  - [CVE-2026-34785](https://github.com/advisories/GHSA-h2jq-g4cq-5ppq) `Rack::Static` prefix matching can expose unintended files under the static root.
19
29
  - [CVE-2026-34829](https://github.com/advisories/GHSA-8vqr-qjwx-82mw) Multipart parsing without `Content-Length` header allows unbounded chunked file uploads.
20
- - [CVE-2026-34827](https://github.com/advisories/GHSA-v6x5-cg8r-vv6x) Quadratic-time multipart header parsing allows denial of service via escape-heavy quoted parameters.
30
+ - [CVE-2026-34827](https://github.com/advisories/GHSA-v6x5-cg8r-vv6x) Multipart header parsing allows denial of service via escape-heavy quoted parameters.
21
31
 
22
32
  ## [3.1.20] - 2026-02-16
23
33
 
@@ -410,6 +420,26 @@ Rack v3.1 is primarily a maintenance release that removes features deprecated in
410
420
  - Fix multipart filename generation for filenames that contain spaces. Encode spaces as "%20" instead of "+" which will be decoded properly by the multipart parser. ([#1736](https://github.com/rack/rack/pull/1645), [@muirdm](https://github.com/muirdm))
411
421
  - `Rack::Request#scheme` returns `ws` or `wss` when one of the `X-Forwarded-Scheme` / `X-Forwarded-Proto` headers is set to `ws` or `wss`, respectively. ([#1730](https://github.com/rack/rack/issues/1730), [@erwanst](https://github.com/erwanst))
412
422
 
423
+ ## [2.2.24] - 2026-08-13
424
+
425
+ ### Security
426
+
427
+ - [CVE-2026-26962](https://github.com/advisories/GHSA-rx22-g9mx-qrhv) Improper unfolding of folded multipart headers preserves CRLF in parsed parameter values.
428
+
429
+ ## [2.2.23] - 2026-04-01
430
+
431
+ ### Security
432
+
433
+ - [CVE-2026-34763](https://github.com/advisories/GHSA-7mqq-6cf9-v2qp) Root directory disclosure via unescaped regex interpolation in `Rack::Directory`.
434
+ - [CVE-2026-34230](https://github.com/advisories/GHSA-v569-hp3g-36wr) Avoid O(n^2) algorithm in `Rack::Utils.select_best_encoding` which could lead to denial of service.
435
+ - [CVE-2026-26961](https://github.com/advisories/GHSA-vgpv-f759-9wx3) Raise error for multipart requests with multiple boundary parameters.
436
+ - [CVE-2026-34786](https://github.com/advisories/GHSA-q4qf-9j86-f5mh) `Rack::Static` `header_rules` bypass via URL-encoded path mismatch.
437
+ - [CVE-2026-34831](https://github.com/advisories/GHSA-q2ww-5357-x388) `Content-Length` mismatch in `Rack::Files` error responses.
438
+ - [CVE-2026-34826](https://github.com/advisories/GHSA-x8cg-fq8g-mxfx) Multipart byte range processing allows denial of service via excessive overlapping ranges.
439
+ - [CVE-2026-34830](https://github.com/advisories/GHSA-qv7j-4883-hwh7) `Rack::Sendfile` header-based `X-Accel-Mapping` regex injection enables unauthorized `X-Accel-Redirect`.
440
+ - [CVE-2026-34785](https://github.com/advisories/GHSA-h2jq-g4cq-5ppq) `Rack::Static` prefix matching can expose unintended files under the static root.
441
+ - [CVE-2026-34829](https://github.com/advisories/GHSA-8vqr-qjwx-82mw) Multipart parsing without `Content-Length` header allows unbounded chunked file uploads.
442
+
413
443
  ## [2.2.22] - 2026-02-16
414
444
 
415
445
  ### Security
@@ -360,13 +360,19 @@ module Rack
360
360
 
361
361
  CONTENT_DISPOSITION_MAX_PARAMS = 16
362
362
  CONTENT_DISPOSITION_MAX_BYTES = 1536
363
+ OBS_UNFOLD = /\r\n([ \t])/
364
+ private_constant :OBS_UNFOLD
363
365
  def handle_mime_head
364
366
  if @sbuf.scan_until(@head_regex)
365
367
  head = @sbuf[1]
366
368
  content_type = head[MULTIPART_CONTENT_TYPE, 1]
369
+ content_type.gsub!(OBS_UNFOLD, '\\1') if content_type
367
370
  if (disposition = head[MULTIPART_CONTENT_DISPOSITION, 1]) &&
368
371
  disposition.bytesize <= CONTENT_DISPOSITION_MAX_BYTES
369
372
 
373
+ # Implement OBS unfolding (RFC 5322 Section 2.2.3)
374
+ disposition.gsub!(OBS_UNFOLD, '\\1')
375
+
370
376
  # ignore actual content-disposition value (should always be form-data)
371
377
  i = disposition.index(';')
372
378
  disposition.slice!(0, i+1)
data/lib/rack/utils.rb CHANGED
@@ -146,8 +146,8 @@ module Rack
146
146
  end
147
147
  end
148
148
 
149
- ALLOWED_FORWARED_PARAMS = %w[by for host proto].to_h { |name| [name, name.to_sym] }.freeze
150
- private_constant :ALLOWED_FORWARED_PARAMS
149
+ ALLOWED_FORWARDED_PARAMS = %w[by for host proto].map { |name| [name, name.to_sym] }.to_h.freeze
150
+ private_constant :ALLOWED_FORWARDED_PARAMS
151
151
 
152
152
  def forwarded_values(forwarded_header)
153
153
  return unless forwarded_header
@@ -170,7 +170,7 @@ module Rack
170
170
  param.chomp!('=')
171
171
  param.strip!
172
172
  param.downcase!
173
- return unless param = ALLOWED_FORWARED_PARAMS[param]
173
+ return unless param = ALLOWED_FORWARDED_PARAMS[param]
174
174
 
175
175
  if header[0] == '"'
176
176
  # Parameter value is quoted, parse it, handling backslash escapes
data/lib/rack/version.rb CHANGED
@@ -12,7 +12,7 @@
12
12
  # so it should be enough just to <tt>require 'rack'</tt> in your code.
13
13
 
14
14
  module Rack
15
- RELEASE = "3.1.21"
15
+ RELEASE = "3.1.22"
16
16
 
17
17
  # Return the Rack release as a dotted string.
18
18
  def self.release
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.21
4
+ version: 3.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leah Neukirchen
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  - !ruby/object:Gem::Version
157
157
  version: '0'
158
158
  requirements: []
159
- rubygems_version: 4.0.6
159
+ rubygems_version: 4.0.10
160
160
  specification_version: 4
161
161
  summary: A modular Ruby webserver interface.
162
162
  test_files: []