contrast-agent 7.5.0 → 7.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/ext/cs__common/cs__common.c +5 -5
  3. data/ext/cs__contrast_patch/cs__contrast_patch.c +2 -1
  4. data/ext/cs__scope/cs__scope.c +6 -5
  5. data/lib/contrast/agent/assess/events/event_data.rb +11 -2
  6. data/lib/contrast/agent/assess/finalizers/freeze.rb +1 -0
  7. data/lib/contrast/agent/assess/finalizers/hash.rb +7 -0
  8. data/lib/contrast/agent/assess/policy/patcher.rb +2 -0
  9. data/lib/contrast/agent/assess/policy/policy.rb +4 -0
  10. data/lib/contrast/agent/assess/policy/policy_node.rb +29 -7
  11. data/lib/contrast/agent/assess/policy/preshift.rb +34 -1
  12. data/lib/contrast/agent/assess/policy/propagation_method.rb +16 -1
  13. data/lib/contrast/agent/assess/policy/propagation_node.rb +40 -1
  14. data/lib/contrast/agent/assess/policy/propagator/append.rb +5 -0
  15. data/lib/contrast/agent/assess/policy/propagator/base.rb +10 -0
  16. data/lib/contrast/agent/assess/policy/propagator/buffer.rb +6 -0
  17. data/lib/contrast/agent/assess/policy/propagator/center.rb +14 -0
  18. data/lib/contrast/agent/assess/policy/propagator/custom.rb +6 -0
  19. data/lib/contrast/agent/assess/policy/propagator/database_write.rb +14 -0
  20. data/lib/contrast/agent/assess/policy/propagator/insert.rb +6 -0
  21. data/lib/contrast/agent/assess/policy/propagator/match_data.rb +38 -0
  22. data/lib/contrast/agent/assess/policy/propagator/next.rb +6 -0
  23. data/lib/contrast/agent/assess/policy/propagator/prepend.rb +5 -0
  24. data/lib/contrast/agent/assess/policy/propagator/remove.rb +4 -0
  25. data/lib/contrast/agent/assess/policy/propagator/replace.rb +5 -0
  26. data/lib/contrast/agent/assess/policy/propagator/reverse.rb +5 -0
  27. data/lib/contrast/agent/assess/policy/propagator/select.rb +30 -0
  28. data/lib/contrast/agent/assess/policy/propagator/splat.rb +10 -0
  29. data/lib/contrast/agent/assess/policy/source_node.rb +5 -1
  30. data/lib/contrast/agent/assess/policy/source_validation/cross_site_validator.rb +4 -0
  31. data/lib/contrast/agent/assess/policy/trigger/reflected_xss.rb +16 -0
  32. data/lib/contrast/agent/assess/policy/trigger/xpath.rb +19 -0
  33. data/lib/contrast/agent/assess/policy/trigger_method.rb +8 -1
  34. data/lib/contrast/agent/assess/policy/trigger_node.rb +11 -1
  35. data/lib/contrast/agent/assess/policy/trigger_validation/redos_validator.rb +4 -0
  36. data/lib/contrast/agent/assess/policy/trigger_validation/ssrf_validator.rb +6 -0
  37. data/lib/contrast/agent/assess/policy/trigger_validation/xss_validator.rb +6 -0
  38. data/lib/contrast/agent/hooks/at_exit_hook.rb +1 -0
  39. data/lib/contrast/agent/reporting/reporting_utilities/audit.rb +1 -1
  40. data/lib/contrast/agent/reporting/reporting_utilities/reporter_client.rb +1 -1
  41. data/lib/contrast/agent/reporting/reporting_utilities/reporter_client_utils.rb +1 -1
  42. data/lib/contrast/agent/reporting/reporting_utilities/response_handler.rb +3 -3
  43. data/lib/contrast/agent/reporting/reporting_utilities/response_handler_utils.rb +18 -6
  44. data/lib/contrast/agent/request/request_handler.rb +1 -0
  45. data/lib/contrast/agent/version.rb +1 -1
  46. data/lib/contrast/configuration.rb +1 -1
  47. data/lib/contrast/utils/middleware_utils.rb +9 -0
  48. data/lib/contrast/utils/routes_sent.rb +3 -2
  49. data/lib/contrast.rb +2 -2
  50. data/resources/assess/policy.json +50 -1
  51. data/ruby-agent.gemspec +13 -13
  52. metadata +23 -22
data/lib/contrast.rb CHANGED
@@ -95,15 +95,15 @@ end
95
95
 
96
96
  # This needs to be required very early, after component interfaces, and before instrumentation attempts
97
97
  require 'contrast/funchook/funchook'
98
-
99
98
  require 'contrast/agent/version'
100
99
 
101
100
  # shared utils
102
101
  require 'contrast/utils/timer'
103
-
104
102
  require 'contrast/utils/assess/sampling_util'
105
103
  require 'contrast/agent'
106
104
 
105
+ # Prepend fix for Ruby 3.0
106
+ # TODO: RUBY-99999 remove once obsolete.
107
107
  if RUBY_VERSION >= '3.0.0' && RUBY_VERSION < '3.1.0'
108
108
  # Put prepend back as it was.
109
109
  Class.alias_method(:prepend, :cs__orig_prepend)
@@ -304,7 +304,15 @@
304
304
  "class_name":"String",
305
305
  "instance_method": true,
306
306
  "method_visibility": "public",
307
- "method_name":"capitalize!",
307
+ "method_name":"capitalize",
308
+ "source":"O",
309
+ "target":"R",
310
+ "action":"KEEP"
311
+ }, {
312
+ "class_name":"String",
313
+ "instance_method": true,
314
+ "method_visibility": "public",
315
+ "method_name":"html_safe",
308
316
  "source":"O",
309
317
  "target":"R",
310
318
  "action":"KEEP"
@@ -908,6 +916,36 @@
908
916
  "action":"SPLAT",
909
917
  "tags":["HTML_ENCODED"],
910
918
  "untags":["HTML_DECODED"]
919
+ }, {
920
+ "class_name": "ActiveSupport::CoreExt::ERBUtil",
921
+ "method_name": "html_escape",
922
+ "method_visibility": "public",
923
+ "instance_method": true,
924
+ "source": "P0",
925
+ "target": "R",
926
+ "action": "SPLAT",
927
+ "tags":["HTML_ENCODED"],
928
+ "untags":["HTML_DECODED"]
929
+ }, {
930
+ "class_name": "ActiveSupport::CoreExt::ERBUtil",
931
+ "method_name": "h",
932
+ "method_visibility": "public",
933
+ "instance_method": true,
934
+ "source": "P0",
935
+ "target": "R",
936
+ "action": "SPLAT",
937
+ "tags":["HTML_ENCODED"],
938
+ "untags":["HTML_DECODED"]
939
+ }, {
940
+ "class_name": "ActiveSupport::CoreExt::ERBUtil",
941
+ "method_name": "unwrapped_html_escape",
942
+ "method_visibility": "public",
943
+ "instance_method": true,
944
+ "source": "P0",
945
+ "target": "R",
946
+ "action": "SPLAT",
947
+ "tags":["HTML_ENCODED"],
948
+ "untags":["HTML_DECODED"]
911
949
  }, {
912
950
  "class_name":"ERB::Util",
913
951
  "method_name":"h",
@@ -1028,6 +1066,17 @@
1028
1066
  "target": "R",
1029
1067
  "action": "SPLAT"
1030
1068
  },
1069
+ {
1070
+ "class_name": "ActiveSupport::Multibyte::Unicode",
1071
+ "instance_method": true,
1072
+ "method_visibility": "public",
1073
+ "method_name":"tidy_bytes",
1074
+ "source":"P0",
1075
+ "target":"R",
1076
+ "action": "KEEP",
1077
+ "tags":["HTML_ENCODED"],
1078
+ "untags":["HTML_DECODED"]
1079
+ },
1031
1080
  {
1032
1081
  "class_name": "JSON",
1033
1082
  "method_name": "generate",
data/ruby-agent.gemspec CHANGED
@@ -9,14 +9,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
9
9
 
10
10
  # Add the team as authors of the Agent
11
11
  def self.add_authors spec
12
- spec.authors = %w[
13
- galen.palmer@contrastsecurity.com
14
- harold.mcginnis@contrastsecurity.com
15
- donald.propst@contrastsecurity.com
16
- alex.macdonald@contrastsecurity.com
17
- mark.petersen@contrastsecurity.com
18
- joshua.reed@contrastsecurity.com
19
- ]
12
+ spec.authors = %w[ruby@contrastsecurity.com]
20
13
  end
21
14
 
22
15
  # Add those dependencies required to develop or test the Agent
@@ -44,7 +37,6 @@ end
44
37
  def self.add_debuggers spec
45
38
  spec.add_development_dependency 'pry'
46
39
  spec.add_development_dependency 'pry-byebug', '>= 3.9'
47
- spec.add_development_dependency 'ruby-debug-ide'
48
40
  end
49
41
 
50
42
  # Dependencies used for framework testing.
@@ -52,7 +44,7 @@ def self.add_frameworks spec
52
44
  spec.add_development_dependency 'grape', '~> 1.5', '>= 1.5.2'
53
45
  spec.add_development_dependency 'rack-protection', '>= 2'
54
46
  spec.add_development_dependency 'rails', '>= 6', '~> 7'
55
- spec.add_development_dependency 'sinatra', '>= 2'
47
+ spec.add_development_dependency 'sinatra', '>= 2', '<4.0.0'
56
48
  end
57
49
 
58
50
  # Dependencies used for linting prior to commit.
@@ -105,9 +97,14 @@ def self.add_tested_gems spec
105
97
  spec.add_development_dependency 'async'
106
98
  spec.add_development_dependency 'execjs'
107
99
  spec.add_development_dependency 'rhino'
108
- spec.add_development_dependency 'sqlite3'
100
+ if ENV.fetch('CONTRAST__PIPELINE__RUN', nil) == 'true'
101
+ spec.add_development_dependency 'sqlite3', '1.6.6'
102
+ else
103
+ spec.add_development_dependency 'sqlite3'
104
+ end
109
105
  spec.add_development_dependency 'tilt'
110
106
  spec.add_development_dependency 'xpath'
107
+ spec.add_development_dependency 'ruby'
111
108
  end
112
109
 
113
110
  # Add those dependencies required to run the Agent in customer applications.
@@ -116,8 +113,11 @@ end
116
113
  # dependencies.csv in this directory to indicate that and create a
117
114
  # corresponding update to the fake gem server data in TeamServer.
118
115
  def self.add_dependencies spec
119
- # TODO: RUBY-99999 investigate init_with_options segmentation fault
120
- spec.add_dependency 'ffi'
116
+ if ENV.fetch('CONTRAST__PIPELINE__RUN', nil) == 'true'
117
+ spec.add_dependency 'ffi', '1.15.5'
118
+ else
119
+ spec.add_dependency 'ffi'
120
+ end
121
121
  spec.add_dependency 'ougai', '>= 1.8', '< 3.0.0'
122
122
  spec.add_dependency 'rack', '>= 2.0', '< 4.0.0'
123
123
 
metadata CHANGED
@@ -1,19 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contrast-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.5.0
4
+ version: 7.6.0
5
5
  platform: ruby
6
6
  authors:
7
- - galen.palmer@contrastsecurity.com
8
- - harold.mcginnis@contrastsecurity.com
9
- - donald.propst@contrastsecurity.com
10
- - alex.macdonald@contrastsecurity.com
11
- - mark.petersen@contrastsecurity.com
12
- - joshua.reed@contrastsecurity.com
7
+ - ruby@contrastsecurity.com
13
8
  autorequire:
14
9
  bindir: exe
15
10
  cert_chain: []
16
- date: 2023-10-06 00:00:00.000000000 Z
11
+ date: 2024-04-11 00:00:00.000000000 Z
17
12
  dependencies:
18
13
  - !ruby/object:Gem::Dependency
19
14
  name: bundler
@@ -85,20 +80,6 @@ dependencies:
85
80
  - - ">="
86
81
  - !ruby/object:Gem::Version
87
82
  version: '3.9'
88
- - !ruby/object:Gem::Dependency
89
- name: ruby-debug-ide
90
- requirement: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: '0'
95
- type: :development
96
- prerelease: false
97
- version_requirements: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
83
  - !ruby/object:Gem::Dependency
103
84
  name: debride
104
85
  requirement: !ruby/object:Gem::Requirement
@@ -300,6 +281,9 @@ dependencies:
300
281
  - - ">="
301
282
  - !ruby/object:Gem::Version
302
283
  version: '2'
284
+ - - "<"
285
+ - !ruby/object:Gem::Version
286
+ version: 4.0.0
303
287
  type: :development
304
288
  prerelease: false
305
289
  version_requirements: !ruby/object:Gem::Requirement
@@ -307,6 +291,9 @@ dependencies:
307
291
  - - ">="
308
292
  - !ruby/object:Gem::Version
309
293
  version: '2'
294
+ - - "<"
295
+ - !ruby/object:Gem::Version
296
+ version: 4.0.0
310
297
  - !ruby/object:Gem::Dependency
311
298
  name: async
312
299
  requirement: !ruby/object:Gem::Requirement
@@ -391,6 +378,20 @@ dependencies:
391
378
  - - ">="
392
379
  - !ruby/object:Gem::Version
393
380
  version: '0'
381
+ - !ruby/object:Gem::Dependency
382
+ name: ruby
383
+ requirement: !ruby/object:Gem::Requirement
384
+ requirements:
385
+ - - ">="
386
+ - !ruby/object:Gem::Version
387
+ version: '0'
388
+ type: :development
389
+ prerelease: false
390
+ version_requirements: !ruby/object:Gem::Requirement
391
+ requirements:
392
+ - - ">="
393
+ - !ruby/object:Gem::Version
394
+ version: '0'
394
395
  - !ruby/object:Gem::Dependency
395
396
  name: benchmark-ips
396
397
  requirement: !ruby/object:Gem::Requirement