rack 3.2.4 → 3.2.5
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 +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/rack/directory.rb +5 -2
- data/lib/rack/mock_response.rb +11 -2
- data/lib/rack/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcab43418ebec9227dad4a8e8fbfeb403097a3c34bcebc63a230350984c68ab9
|
|
4
|
+
data.tar.gz: 6b82c8e25fa9bc835cfe24a05da9731bd9a0654b40a56a01c6f77ac7fc7029f4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a727df6903901d26a8d4e031302cb0c5b45134b9e31b2443b6e4d4a595233f4d18d58ff265cafbd9e344e4b7958fd3d27b6e46d57c6f37c9744617da8eba6db4
|
|
7
|
+
data.tar.gz: 8c914906cc9c4d0610ab8dc0de815cb714311261dc50ef6d1a6c1b5ecacd9d3f58e477014176a0044dd1f1dd24ecc55554eb6eebe78995205bd6c47bee83d9eb
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
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
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
### Security
|
|
8
|
+
|
|
9
|
+
- [CVE-2026-25500](https://github.com/advisories/GHSA-whrj-4476-wvmp) XSS injection via malicious filename in `Rack::Directory`.
|
|
10
|
+
- [CVE-2026-22860](https://github.com/advisories/GHSA-mxw3-3hh2-x2mh) Directory traversal via root prefix bypass in `Rack::Directory`.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Fix `Rack::MockResponse#body` when the body is a Proc. ([#2420](https://github.com/rack/rack/pull/2420), [#2423](https://github.com/rack/rack/pull/2423), [@tavianator](https://github.com/tavianator), [@ioquatix])
|
|
15
|
+
|
|
5
16
|
## [3.2.4] - 2025-11-03
|
|
6
17
|
|
|
7
18
|
### Fixed
|
data/lib/rack/directory.rb
CHANGED
|
@@ -17,7 +17,7 @@ module Rack
|
|
|
17
17
|
# If +app+ is not specified, a Rack::Files of the same +root+ will be used.
|
|
18
18
|
|
|
19
19
|
class Directory
|
|
20
|
-
DIR_FILE = "<tr><td class='name'><a href='
|
|
20
|
+
DIR_FILE = "<tr><td class='name'><a href='./%s'>%s</a></td><td class='size'>%s</td><td class='type'>%s</td><td class='mtime'>%s</td></tr>\n"
|
|
21
21
|
DIR_PAGE_HEADER = <<-PAGE
|
|
22
22
|
<html><head>
|
|
23
23
|
<title>%s</title>
|
|
@@ -82,6 +82,7 @@ table { width:100%%; }
|
|
|
82
82
|
# Set the root directory and application for serving files.
|
|
83
83
|
def initialize(root, app = nil)
|
|
84
84
|
@root = ::File.expand_path(root)
|
|
85
|
+
@root_with_separator = @root.end_with?(::File::SEPARATOR) ? @root : "#{@root}#{::File::SEPARATOR}"
|
|
85
86
|
@app = app || Files.new(@root)
|
|
86
87
|
@head = Head.new(method(:get))
|
|
87
88
|
end
|
|
@@ -118,7 +119,9 @@ table { width:100%%; }
|
|
|
118
119
|
# Rack response to use for requests with paths outside the root, or nil if path is inside the root.
|
|
119
120
|
def check_forbidden(path_info)
|
|
120
121
|
return unless path_info.include? ".."
|
|
121
|
-
|
|
122
|
+
|
|
123
|
+
expanded_path = ::File.expand_path(::File.join(@root, path_info))
|
|
124
|
+
return if expanded_path == @root || expanded_path.start_with?(@root_with_separator)
|
|
122
125
|
|
|
123
126
|
body = "Forbidden\n"
|
|
124
127
|
[403, { CONTENT_TYPE => "text/plain",
|
data/lib/rack/mock_response.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'stringio'
|
|
3
4
|
require 'time'
|
|
4
5
|
|
|
5
6
|
require_relative 'response'
|
|
@@ -82,8 +83,16 @@ module Rack
|
|
|
82
83
|
# end
|
|
83
84
|
buffer = @buffered_body = String.new
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
begin
|
|
87
|
+
if @body.respond_to?(:each)
|
|
88
|
+
@body.each do |chunk|
|
|
89
|
+
buffer << chunk
|
|
90
|
+
end
|
|
91
|
+
else
|
|
92
|
+
@body.call(StringIO.new(buffer))
|
|
93
|
+
end
|
|
94
|
+
ensure
|
|
95
|
+
@body.close if @body.respond_to?(:close)
|
|
87
96
|
end
|
|
88
97
|
|
|
89
98
|
return buffer
|
data/lib/rack/version.rb
CHANGED
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.2.
|
|
4
|
+
version: 3.2.5
|
|
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:
|
|
159
|
+
rubygems_version: 4.0.3
|
|
160
160
|
specification_version: 4
|
|
161
161
|
summary: A modular Ruby webserver interface.
|
|
162
162
|
test_files: []
|