puma 3.12.1-java → 3.12.2-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puma might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5806fb34ffd1840cdcdccc3ec1f8193affc6cfc12f6a493801836b529ca1de00
4
- data.tar.gz: 3499e2b03cc6d19cd60cb38bd3f83adf61d75b8c845ac6ecb8e15c7e511a74b4
3
+ metadata.gz: 835d444c7e619728a20f960ff33b6d09c0ee07b5d63428ba34ce22e7408ecbfb
4
+ data.tar.gz: 7474d589404b47d916e134be4ed568652f029be024dfbb82c7ab404a7cb50daa
5
5
  SHA512:
6
- metadata.gz: 160a9538102860ff42d698b5c0e785d7eaaabc51f3c4015a6c3bf20bf169e11357154a8972e345037864553a41da9da098de1a52e7f9a954da16145df45a97fe
7
- data.tar.gz: 04a399c06144d7826da0263451b34558a28c0ea496b25de4208d36b0b5879535efa890cf849477e4c63afd53d12695d8b8e6213a736f258977f6ce180e5850d7
6
+ metadata.gz: 4cae9db11916b0e7838fd3949f7a71a7531ad9fb2c32f8312686a614d8f5b04a24d60b790ddca3af9c47dccad5212ba64f180d04a45d5ad47dfdb7f3c39054c5
7
+ data.tar.gz: 79a5ff3eb5c648690829404bc15535ae4f8082f3bdb5bc1740bbc36fdaa836fe4e32bdf7f3597b11a48a8f9ca0e98ffbb6370109747c378d2df707d90caaeadc
data/History.md CHANGED
@@ -4,7 +4,12 @@
4
4
 
5
5
  * x bugfixes
6
6
 
7
- ## 3.12.1 / 2019-01-08
7
+ ## 4.3.1 and 3.12.2 / 2019-12-05
8
+
9
+ * Security
10
+ * Fix: a poorly-behaved client could use keepalive requests to monopolize Puma's reactor and create a denial of service attack. CVE-2019-16770.
11
+
12
+ ## 3.12.1 / 2019-03-19
8
13
 
9
14
  * 1 features
10
15
  * Internal strings are frozen (#1649)
@@ -100,7 +100,7 @@ module Puma
100
100
  # too taxing on performance.
101
101
  module Const
102
102
 
103
- PUMA_VERSION = VERSION = "3.12.1".freeze
103
+ PUMA_VERSION = VERSION = "3.12.2".freeze
104
104
  CODE_NAME = "Llamas in Pajamas".freeze
105
105
  PUMA_SERVER_STRING = ['puma', PUMA_VERSION, CODE_NAME].join(' ').freeze
106
106
 
@@ -118,6 +118,13 @@ module Puma
118
118
  # sending data back
119
119
  WRITE_TIMEOUT = 10
120
120
 
121
+ # How many requests to attempt inline before sending a client back to
122
+ # the reactor to be subject to normal ordering. The idea here is that
123
+ # we amortize the cost of going back to the reactor for a well behaved
124
+ # but very "greedy" client across 10 requests. This prevents a not
125
+ # well behaved client from monopolizing the thread forever.
126
+ MAX_FAST_INLINE = 10
127
+
121
128
  # The original URI requested by the client.
122
129
  REQUEST_URI= 'REQUEST_URI'.freeze
123
130
  REQUEST_PATH = 'REQUEST_PATH'.freeze
Binary file
@@ -470,6 +470,8 @@ module Puma
470
470
  clean_thread_locals = @options[:clean_thread_locals]
471
471
  close_socket = true
472
472
 
473
+ requests = 0
474
+
473
475
  while true
474
476
  case handle_request(client, buffer)
475
477
  when false
@@ -483,7 +485,19 @@ module Puma
483
485
 
484
486
  ThreadPool.clean_thread_locals if clean_thread_locals
485
487
 
486
- unless client.reset(@status == :run)
488
+ requests += 1
489
+
490
+ check_for_more_data = @status == :run
491
+
492
+ if requests >= MAX_FAST_INLINE
493
+ # This will mean that reset will only try to use the data it already
494
+ # has buffered and won't try to read more data. What this means is that
495
+ # every client, independent of their request speed, gets treated like a slow
496
+ # one once every MAX_FAST_INLINE requests.
497
+ check_for_more_data = false
498
+ end
499
+
500
+ unless client.reset(check_for_more_data)
487
501
  close_socket = false
488
502
  client.set_timeout @persistent_timeout
489
503
  @reactor.add client
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.12.1
4
+ version: 3.12.2
5
5
  platform: java
6
6
  authors:
7
7
  - Evan Phoenix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-19 00:00:00.000000000 Z
11
+ date: 2019-12-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server
14
14
  for Ruby/Rack applications. Puma is intended for use in both development and production
@@ -123,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubyforge_project:
127
- rubygems_version: 2.7.6
126
+ rubygems_version: 3.0.6
128
127
  signing_key:
129
128
  specification_version: 4
130
129
  summary: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for