sqreen 1.6.2-java → 1.6.3-java

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
  SHA1:
3
- metadata.gz: 964922cfe82494cbd076546445a9b5cb280e0c9b
4
- data.tar.gz: 707dafb9d328277081816b0f23af346101bb1a5a
3
+ metadata.gz: fb1277e9fe14768daa5419ca6d0e42ab07e95e67
4
+ data.tar.gz: c8c556e20ad621bd7f18414a4bbc8ee80a56820c
5
5
  SHA512:
6
- metadata.gz: 61cfe516eb99a7cd8e6ba0008bc846a637daba292b9a7210df59aab350bcd7564a1491bf4e95fc7b45126a4a396111bd1682cfded3a3f888ea7ee0e6e8aec187
7
- data.tar.gz: 37d2eba1aef0b8a64a76e687d8d5b46ed4b9bf2ecc99020cc7c87dca5baf0867ec3220cef3b08d07695f0610ff489d3de7689d6918770536fcc7a44915b6abbe
6
+ metadata.gz: 8caed917d587a1f571c00281d7135e5c5828be9539567ec13ddce6c2052c26111b67a50022243557baa17d2085a208f29e454ef41c6e6a1492008cdbff6f0e2f
7
+ data.tar.gz: 9b22ce8731b3487d65820bb3f2696c91e89b1c4ab5d93866cec5ca495ecdc839bc531d9826144f7d8dbb058d6ab1ade434e816f2abba0426ce2c33e7572663a6
@@ -192,6 +192,8 @@ module Sqreen
192
192
  skip = true
193
193
  result = ret[:new_return_value] if ret.key? :new_return_value
194
194
  next
195
+ when :modify_args, 'modify_args'
196
+ args = ret[:args]
195
197
  when :raise, 'raise'
196
198
  fail Sqreen::AttackBlocked, "Sqreen blocked a security threat (type: #{ret[:rule_name]}). No action is required."
197
199
  end
@@ -85,6 +85,7 @@ module Sqreen
85
85
  class Haml4ParserScriptHookCB < RuleCB
86
86
  def pre(_inst, *args, &_block)
87
87
  return unless args.size > 1
88
+ return unless Haml::VERSION < "5"
88
89
  text = args[0]
89
90
  escape_html = args[1]
90
91
  if escape_html == false && !text.include?('html_escape')
@@ -97,6 +98,7 @@ module Sqreen
97
98
  # Hook into haml4 tag parser
98
99
  class Haml4ParserTagHookCB < RuleCB
99
100
  def post(ret, _inst, *_args, &_block)
101
+ return unless Haml::VERSION < "5"
100
102
  tag = ret
101
103
  if tag.value[:escape_html] == false &&
102
104
  !tag.value[:value].include?('html_escape')
@@ -109,6 +111,7 @@ module Sqreen
109
111
 
110
112
  class Haml4UtilInterpolationHookCB < RuleCB
111
113
  def pre(_inst, *args, &_block)
114
+ # Also work in haml5
112
115
  str = args[0]
113
116
  escape_html = args[1]
114
117
  # Original code from HAML tuned up to insert escape_haml call
@@ -131,6 +134,7 @@ module Sqreen
131
134
  # Hook build attributes
132
135
  class Haml4CompilerBuildAttributeCB < XSSCB
133
136
  def pre(inst, *args, &_block)
137
+ return unless Haml::VERSION < "5"
134
138
  attrs = args[-1]
135
139
  new_attrs, found_xss = Haml4CompilerBuildAttributeCB.clean_hash_key(attrs) do |key|
136
140
  if !key.nil? && key.is_a?(String) && framework.full_params_include?(key)
@@ -175,6 +179,14 @@ module Sqreen
175
179
  end
176
180
  end
177
181
 
182
+ class Haml5EscapableHookCB < RuleCB
183
+ def pre(_inst, *args, &_block)
184
+ args[0] = "Sqreen.escape_haml(#{args[0]})"
185
+ { :status => :modify_args, :args => args }
186
+ end
187
+ end
188
+
189
+
178
190
  # Hook into temple template rendering
179
191
  class TempleEscapableHookCB < RuleCB
180
192
  def post(ret, _inst, *_args, &_block)
@@ -183,6 +195,7 @@ module Sqreen
183
195
  end
184
196
  end
185
197
 
198
+
186
199
  # Hook into temple template rendering
187
200
  class SlimSplatBuilderCB < XSSCB
188
201
  def pre(inst, *args, &_block)
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
2
  # Please refer to our terms for more information: https://www.sqreen.io/terms.html
3
3
  module Sqreen
4
- VERSION = '1.6.2'.freeze
4
+ VERSION = '1.6.3'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqreen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  platform: java
6
6
  authors:
7
7
  - Sqreen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-16 00:00:00.000000000 Z
11
+ date: 2017-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs