puma 4.3.1 → 4.3.3

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: 0c3e9fdfe5225baf88ff5ee9ec6f58201a220a482d72e5217309964a22b7ccc0
4
- data.tar.gz: 541ad3a7311662ca31e3de234870b03d6aac3eb925c8ad04e7a857bac097edc8
3
+ metadata.gz: bd20b1ca1b6236f1b1677f9bc40f4ea8f980ae678e1f57e6b20987d2322f7f4a
4
+ data.tar.gz: bb416036092bb4657a4f30dda5c72dc6a9ff8dda391e41950f7ece18230a4a5f
5
5
  SHA512:
6
- metadata.gz: 8dc3a1d604212819aa8dc549b767cf00e3c237c95f0053ec61f6750666097980a1fbd2c350b1c47e59a1047d1a0bb35451914629f2829a66ded20a930939a60e
7
- data.tar.gz: f906230de96dd55841faaf6968939b4a096acb9933e91b34c8aada201e1c5e259c567ce8dce744490093072f6cb9d9553b7d83752e07ec7502973c72990563d4
6
+ metadata.gz: d6ce2871efeed834b717174a744ac45db359efd9969efb51b13a83f260d01def32d25fe3ac91a9a0f99483c054c89f4c40aaef988e2a7b46cb9cb54201200abc
7
+ data.tar.gz: c55618f49982d8c1a9161a4b8bce15878b75b960c9a28fb49c81d8934336c22023608082ba649414767d67a59436d580a12719660fa8710174dcb59823bb935d
data/History.md CHANGED
@@ -6,6 +6,18 @@
6
6
  * Bugfixes
7
7
  * Your bugfix goes here (#Github Number)
8
8
 
9
+
10
+ ## 4.3.3 and 3.12.4 / 2020-02-28
11
+ * Bugfixes
12
+ * Fix: Fixes a problem where we weren't splitting headers correctly on newlines (#2132)
13
+ * Security
14
+ * Fix: Prevent HTTP Response splitting via CR in early hints.
15
+
16
+ ## 4.3.2 and 3.12.3 / 2020-02-27
17
+
18
+ * Security
19
+ * Fix: Prevent HTTP Response splitting via CR/LF in header values. CVE-2020-5247.
20
+
9
21
  ## 4.3.1 and 3.12.2 / 2019-12-05
10
22
 
11
23
  * Security
@@ -100,7 +100,7 @@ module Puma
100
100
  # too taxing on performance.
101
101
  module Const
102
102
 
103
- PUMA_VERSION = VERSION = "4.3.1".freeze
103
+ PUMA_VERSION = VERSION = "4.3.3".freeze
104
104
  CODE_NAME = "Mysterious Traveller".freeze
105
105
  PUMA_SERVER_STRING = ['puma', PUMA_VERSION, CODE_NAME].join(' ').freeze
106
106
 
@@ -228,6 +228,7 @@ module Puma
228
228
  COLON = ": ".freeze
229
229
 
230
230
  NEWLINE = "\n".freeze
231
+ HTTP_INJECTION_REGEX = /[\r\n]/.freeze
231
232
 
232
233
  HIJACK_P = "rack.hijack?".freeze
233
234
  HIJACK = "rack.hijack".freeze
@@ -657,6 +657,7 @@ module Puma
657
657
  headers.each_pair do |k, vs|
658
658
  if vs.respond_to?(:to_s) && !vs.to_s.empty?
659
659
  vs.to_s.split(NEWLINE).each do |v|
660
+ next if possible_header_injection?(v)
660
661
  fast_write client, "#{k}: #{v}\r\n"
661
662
  end
662
663
  else
@@ -758,6 +759,7 @@ module Puma
758
759
  headers.each do |k, vs|
759
760
  case k.downcase
760
761
  when CONTENT_LENGTH2
762
+ next if possible_header_injection?(vs)
761
763
  content_length = vs
762
764
  next
763
765
  when TRANSFER_ENCODING
@@ -770,6 +772,7 @@ module Puma
770
772
 
771
773
  if vs.respond_to?(:to_s) && !vs.to_s.empty?
772
774
  vs.to_s.split(NEWLINE).each do |v|
775
+ next if possible_header_injection?(v)
773
776
  lines.append k, colon, v, line_ending
774
777
  end
775
778
  else
@@ -1040,5 +1043,10 @@ module Puma
1040
1043
  def shutting_down?
1041
1044
  @status == :stop || @status == :restart
1042
1045
  end
1046
+
1047
+ def possible_header_injection?(header_value)
1048
+ HTTP_INJECTION_REGEX =~ header_value.to_s
1049
+ end
1050
+ private :possible_header_injection?
1043
1051
  end
1044
1052
  end
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: 4.3.1
4
+ version: 4.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-05 00:00:00.000000000 Z
11
+ date: 2020-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nio4r
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  requirements: []
139
- rubygems_version: 3.0.3
139
+ rubygems_version: 3.1.2
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for