sqreen 0.8.11465220943 → 1.0.0.pre1480953244

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,25 +0,0 @@
1
- # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
- # Please refer to our terms for more information: https://www.sqreen.io/terms.html
3
-
4
- require 'sqreen/rules_callbacks/shell'
5
-
6
- module Sqreen
7
- module Rules
8
- # Look for Shell injections in system like calls
9
- class SystemShellCB < ShellCB
10
- alias initial_pre pre
11
- def pre(inst, *args, &block)
12
- return if args.size == 0
13
- cmd = args[0]
14
- if cmd.is_a?(Hash)
15
- # skip optional env arguments
16
- return unless args.size > 1
17
- cmd = args[1]
18
- end
19
- # skip [cmd, argv0] arguments
20
- return if cmd.is_a?(Array)
21
- initial_pre(inst, cmd, &block)
22
- end
23
- end
24
- end
25
- end