puma 8.1.1 → 8.1.3

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: 7052c9df9725f6bf314bc5574d76ade85dc480fef3c91a0efb9ad52bf3011a54
4
- data.tar.gz: d95d8b6ff61c48b72b797313367c4d0a2d648d5a87ff1b61cb5d3678d0de4f69
3
+ metadata.gz: 52d4811f3803e10d57702aad8f64a5154f6db50b50f893df77c19df2a7cfb0a7
4
+ data.tar.gz: fd9e63457c9dd9e437125156a5bde8677df59382260a287c53af5ee16582adb6
5
5
  SHA512:
6
- metadata.gz: a7e2d3eb08dee53aab404271f57faab47208b15c1d10d0e11f1db1c76a91aef749108fca548b696db0675a6322be69ad4b542e85a0c8f08262dce84b69840e2f
7
- data.tar.gz: f2d6ea1f0afbd841632268483359e26fc4ba82ef2310190e30fb37e7ec23bb1593d819c56ed0f3bb28d6ebdd3c13b24b38d5e4b831c8d1e113d02161ec0a25ae
6
+ metadata.gz: 39c2e19ecb1c6eba2167e6fbfdd0eadc5de69b8852db2125d021b284c40e15aa2b4b56df9e060dac6c4893e6bd2837269041cf5b5717e206e90ac7f625d25559
7
+ data.tar.gz: f9fac86efb8d4b6978a175f04df4174226c17dc7cccba91c44e3ecb4a3d3916de45803bc82b3912ee0870105ba7e570f96c7a1f0f19755b7761e1b7829791f24
data/History.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## 8.1.3 / 2026-11-25
2
+
3
+ * Security
4
+ * Apply `verify_mode`, `ca` and the other TLS options of an `ssl://` bind when the `localhost` gem supplies the certificate; such a bind now fails at boot if those options are invalid. ([GHSA-r3wq-wqc8-m4pv](https://github.com/puma/puma/security/advisories/GHSA-r3wq-wqc8-m4pv))
5
+ * Escape control characters and invalid UTF-8 bytes in the first line of error log entries, which can include request data. ([GHSA-rhp6-mwcq-4p4c](https://github.com/puma/puma/security/advisories/GHSA-rhp6-mwcq-4p4c))
6
+ * Escape control characters and invalid UTF-8 bytes in request log lines, such as a `REMOTE_USER` with a line break. ([GHSA-9v95-fm6g-2gj5](https://github.com/puma/puma/security/advisories/GHSA-9v95-fm6g-2gj5))
7
+ * Keep the path of an absolute-form request target as the client sent it, whatever its URI scheme. ([GHSA-w67v-xw8r-x55m](https://github.com/puma/puma/security/advisories/GHSA-w67v-xw8r-x55m))
8
+ * Send error details and backtraces from the control server only in the `development` and `test` environments. ([GHSA-7q89-p6pc-544r](https://github.com/puma/puma/security/advisories/GHSA-7q89-p6pc-544r))
9
+
10
+ ## 8.1.2 / 2026-11-17
11
+
12
+ * Security
13
+ * Close a TLS connection when OpenSSL reports a fatal error reading it, rather than buffering everything the client sends until `first_data_timeout`. ([GHSA-4v6q-hvv7-49h9](https://github.com/puma/puma/security/advisories/GHSA-4v6q-hvv7-49h9))
14
+ * On JRuby, stop request headers such as `Query-String` and `Request-Path` from changing `QUERY_STRING`, `PATH_INFO` and the other env keys that come from the request line. ([GHSA-rhww-p99c-hgj9](https://github.com/puma/puma/security/advisories/GHSA-rhww-p99c-hgj9))
15
+
16
+ CVE IDs have been requested for these advisories and will be added here once assigned.
17
+
1
18
  ## 8.1.1 / 2026-11-15
2
19
 
3
20
  * Bugfixes
@@ -607,10 +607,10 @@ VALUE engine_read(VALUE self) {
607
607
  return rb_str_new(buf, bytes);
608
608
  }
609
609
 
610
- if(SSL_want_read(conn->ssl)) return Qnil;
611
-
612
610
  error = SSL_get_error(conn->ssl, bytes);
613
611
 
612
+ if(error == SSL_ERROR_WANT_READ) return Qnil;
613
+
614
614
  if(error == SSL_ERROR_ZERO_RETURN) {
615
615
  rb_eof_error();
616
616
  } else {
data/lib/puma/binder.rb CHANGED
@@ -236,7 +236,7 @@ module Puma
236
236
  # Load localhost authority if not loaded.
237
237
  # Ruby 3 `values_at` accepts an array, earlier do not
238
238
  if params.values_at(*cert_key).all? { |v| v.to_s.empty? }
239
- ctx = localhost_authority && localhost_authority_context
239
+ ctx = localhost_authority && localhost_authority_context(params)
240
240
  end
241
241
 
242
242
  ctx ||=
@@ -320,7 +320,7 @@ module Puma
320
320
  @localhost_authority ||= Localhost::Authority.fetch if defined?(Localhost::Authority) && !Puma::IS_JRUBY
321
321
  end
322
322
 
323
- def localhost_authority_context
323
+ def localhost_authority_context(params = {})
324
324
  return unless localhost_authority
325
325
 
326
326
  key_path, crt_path = if [:key_path, :certificate_path].all? { |m| localhost_authority.respond_to?(m) }
@@ -329,7 +329,8 @@ module Puma
329
329
  local_certificates_path = File.expand_path("~/.localhost")
330
330
  [File.join(local_certificates_path, "localhost.key"), File.join(local_certificates_path, "localhost.crt")]
331
331
  end
332
- MiniSSL::ContextBuilder.new({ "key" => key_path, "cert" => crt_path }, @log_writer).context
332
+ params = params.reject { |k, _| k.start_with?("cert", "key") }
333
+ MiniSSL::ContextBuilder.new(params.merge("key" => key_path, "cert" => crt_path), @log_writer).context
333
334
  end
334
335
 
335
336
  # Tell the server to listen on host +host+, port +port+.
@@ -54,7 +54,7 @@ module Puma
54
54
  unless @env[REQUEST_PATH]
55
55
  # it might be a dumbass full host request header
56
56
  uri = begin
57
- URI.parse(@env[REQUEST_URI])
57
+ URI::Generic.new(*URI.split(@env[REQUEST_URI]))
58
58
  rescue URI::InvalidURIError
59
59
  raise Puma::HttpParserError
60
60
  end
@@ -98,6 +98,9 @@ module Puma
98
98
  def write(env, msg)
99
99
  logger = @logger || env['rack.errors']
100
100
 
101
+ hex = ->(str) { str.bytes.map { |byte| "\\x%02X" % byte }.join }
102
+ msg = msg.dup.force_encoding(Encoding::UTF_8).scrub(&hex).gsub(/[\p{Cc}\u2028\u2029](?!\z)/, &hex)
103
+
101
104
  # Standard library logger doesn't support write but it supports << which actually
102
105
  # calls to write on the log device without formatting
103
106
  if logger.respond_to?(:write)
data/lib/puma/const.rb CHANGED
@@ -100,7 +100,7 @@ module Puma
100
100
  # too taxing on performance.
101
101
  module Const
102
102
 
103
- PUMA_VERSION = VERSION = "8.1.1"
103
+ PUMA_VERSION = VERSION = "8.1.3"
104
104
  CODE_NAME = "Puma Psychosis"
105
105
 
106
106
  PUMA_SERVER_STRING = ["puma", PUMA_VERSION, CODE_NAME].join(" ").freeze
@@ -67,7 +67,8 @@ module Puma
67
67
  string_block << " #{text}" if text
68
68
  string_block << " (#{request_title(req)})" if request_parsed?(req)
69
69
  string_block << ": #{error.inspect}" if error
70
- string_block.join('')
70
+ hex = ->(str) { str.bytes.map { |byte| "\\x%02X" % byte }.join }
71
+ string_block.join('').force_encoding(Encoding::UTF_8).scrub(&hex).gsub(/[\p{Cc}\u2028\u2029]/, &hex)
71
72
  end
72
73
 
73
74
  def request_dump(req)
data/lib/puma/runner.rb CHANGED
@@ -75,7 +75,8 @@ module Puma
75
75
  # A Reactor is not created and nio4r is not loaded when 'queue_requests: false'
76
76
  # Use `nil` for events, no hooks in control server
77
77
  control = Puma::Server.new app, nil,
78
- { min_threads: 0, max_threads: 1, queue_requests: false, log_writer: @log_writer }
78
+ { min_threads: 0, max_threads: 1, queue_requests: false, log_writer: @log_writer,
79
+ environment: @options[:environment] }
79
80
 
80
81
  if (activated = @launcher.control_activated_socket)
81
82
  control.binder.activated_sockets.store(*activated)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.1
4
+ version: 8.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
10
+ date: 2026-11-24 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: nio4r
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []
148
- rubygems_version: 4.0.23
148
+ rubygems_version: 4.0.20
149
149
  specification_version: 4
150
150
  summary: A Ruby/Rack web server built for parallelism.
151
151
  test_files: []