)
35 | if @issue_name.blank? && @text =~ /\D/
36 | @issue_name = @text
37 | end
38 | when 'serialNumber'
39 | @serial_number = @text
40 | when 'type'
41 | @type = @text
42 | when 'host'
43 | @url = @text
44 | when 'path'
45 | @path = @text
46 | when 'location'
47 | @location = @cdata
48 | when 'severity'
49 | @severity = @text
50 | when 'confidence'
51 | @confidence = @text
52 | when 'issueBackground'
53 | @issue_background = @cdata
54 | when 'remediationBackground'
55 | @remediation_background = @cdata
56 | when 'references'
57 | @references = @text
58 | when 'issue'
59 | background = @issue_background.gsub(/<\/?[^>]*>/, "").gsub("\n", '').strip
60 | remediation = @remediation_background.gsub(/<\/?[^>]*>/, "").gsub("\n", '').strip
61 | refs = @references.gsub(/<\/?[^>]*>/, "").gsub("\n", '').strip
62 |
63 | #report description, detail, source, severity, fingerprint
64 | @task.report @issue_name, "#{background}\n\n#{remediation}\n\n#{refs}", @location, @severity, @serial_number
65 | end
66 | end
67 |
68 | def text(text)
69 | @text = text
70 | end
71 |
72 | def cdata(cdata)
73 | @cdata = cdata
74 | end
75 | end
76 |
77 | class Glue::Burp < Glue::BaseTask
78 | Glue::Tasks.add self
79 | include Glue::Util
80 |
81 | def initialize(trigger, tracker)
82 | super(trigger, tracker)
83 | @name = "Burp"
84 | @description = "Burp Suite Pro Issues"
85 |
86 | @stage = :code
87 | @labels << "code"
88 |
89 | @burp_xml_path = @tracker.options[:burp_xml_path]
90 | end
91 |
92 | def run
93 | Glue.notify "#{@name}"
94 | end
95 |
96 | def analyze
97 | begin
98 | Glue.debug "Parsing report #{@burp_xml_path}"
99 | get_warnings(@burp_xml_path)
100 | rescue Exception => e
101 | Glue.notify "Problem running Burp ... skipped."
102 | Glue.notify e.message
103 | raise e
104 | end
105 | end
106 |
107 | def supported?
108 | true
109 | end
110 |
111 | def get_warnings(path)
112 | listener = Glue::BurpListener.new(self)
113 |
114 | xml_stream = get_input_stream
115 | parser = Parsers::StreamParser.new(xml_stream, listener)
116 | parser.parse
117 | end
118 |
119 | def get_input_stream
120 | File.new(@tracker.options[:burp_xml_path])
121 | end
122 | end
123 |
--------------------------------------------------------------------------------
/lib/glue/tasks/checkmarx.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'glue/util'
3 | require 'nokogiri'
4 |
5 | class Glue::Checkmarx < Glue::BaseTask
6 |
7 | Glue::Tasks.add self
8 | include Glue::Util
9 |
10 | def initialize(trigger, tracker)
11 | super(trigger, tracker)
12 | @name = "Checkmarx"
13 | @description = "CxSAST"
14 | @stage = :code
15 | @labels << "code"
16 | @checkmarx_path = tracker.options[:checkmarx_path] || "runCxConsole.sh"
17 | end
18 |
19 | def run
20 | rootpath = @trigger.path
21 |
22 | # source: https://stackoverflow.com/a/2149183/4792970
23 | mandatory = [:checkmarx_user, :checkmarx_password, :checkmarx_server, :checkmarx_project]
24 | missing = mandatory.select{ |param| @tracker.options[param].nil? }
25 | unless missing.empty?
26 | Glue.error "missing one or more required params: #{missing}"
27 | return
28 | end
29 |
30 | params = [@checkmarx_path, "scan", "-v",
31 | "-CxUser", "#{@tracker.options[:checkmarx_user]}",
32 | "-CxPassword", "#{@tracker.options[:checkmarx_password]}",
33 | "-CxServer", "#{@tracker.options[:checkmarx_server]}",
34 | "-LocationType", "folder",
35 | "-LocationPath", "#{rootpath}",
36 | "-ProjectName", "#{@tracker.options[:checkmarx_project]}",
37 | "-ReportXML", "#{Dir.pwd}/checkmarx_results.xml",
38 | "-ReportPDF", "#{Dir.pwd}/checkmarx_results.pdf"]
39 |
40 | if (@tracker.options[:checkmarx_log])
41 | params << "-Log"
42 | params << "#{@tracker.options[:checkmarx_log]}"
43 | end
44 |
45 | if (@tracker.options[:checkmarx_exclude])
46 | params << "-LocationExclude"
47 | params << "#{@tracker.options[:checkmarx_exclude]}"
48 | end
49 |
50 | if (@tracker.options[:checkmarx_preset])
51 | params << "-Preset"
52 | params << "#{@tracker.options[:checkmarx_preset]}"
53 | end
54 |
55 | if (@tracker.options[:checkmarx_incremental])
56 | params << "-Incremental"
57 | end
58 |
59 | output = runsystem(true, *params)
60 |
61 | #CxConsole does not set exit code on errors, so we need to test if a report file created
62 | if (File.file?("checkmarx_results.xml"))
63 | @results = Nokogiri::XML(File.read("checkmarx_results.xml")).xpath '//Result'
64 | else
65 | Glue.fatal "checkmarx scan failed: #{output}"
66 | end
67 | end
68 |
69 | def analyze
70 | begin
71 | if (@results == nil)
72 | return
73 | end
74 | @results.each do |result|
75 | description = result.parent.attributes['name'].value.gsub('_', ' ')
76 | detail = result.attributes['DeepLink'].value
77 | state = result.attributes['state'].value.to_i
78 |
79 | #state different from zero mean that the result is marked as ignored (not exploitable) in CxSAST web portal
80 | if (state > 0)
81 | return
82 | end
83 |
84 | source = { :scanner => @name, :file => result.attributes['FileName'].value, :line => result.attributes['Line'].value.to_i, :code => result.at_xpath('Path/PathNode/Snippet/Line/Code').text }
85 | sev = severity(result.parent.attributes['Severity'].value)
86 | fprint = fingerprint("#{description}#{source}#{sev}")
87 |
88 | report description, detail, source, sev, fprint
89 | end
90 | rescue Exception => e
91 | Glue.warn e.message
92 | Glue.warn e.backtrace
93 | end
94 | end
95 |
96 | def supported?
97 | supported=runsystem(true, @checkmarx_path, "--help")
98 | if supported =~ /command not found/
99 | Glue.notify "Install CxConsolePlugin"
100 | return false
101 | else
102 | return true
103 | end
104 | end
105 |
106 | end
107 |
--------------------------------------------------------------------------------
/lib/glue/tasks/clamav.rb:
--------------------------------------------------------------------------------
1 | # https://gist.github.com/paulspringett/8802240
2 |
3 | require 'glue/tasks/base_task'
4 |
5 | class Glue::ClamAV < Glue::BaseTask
6 |
7 | Glue::Tasks.add self
8 |
9 | def initialize(trigger, tracker)
10 | super(trigger,tracker)
11 | @name = "ClamAV"
12 | @description = "Test for virus/malware"
13 | @stage = :file
14 | @labels << "filesystem"
15 | end
16 |
17 | def run
18 | # Update AV
19 | `freshclam`
20 | # Run AV
21 | # TODO: Circle back and use runsystem.
22 | Glue.notify "Malware/Virus Check"
23 | rootpath = @trigger.path
24 | @result=`clamscan --no-summary -i -r "#{rootpath}"`
25 | end
26 |
27 | def analyze
28 | list = @result.split(/\n/)
29 | list.each do |v|
30 | # v.slice! installdir
31 | Glue.notify v
32 | report "Malicious file identified.", v, @name, :medium
33 | end
34 | end
35 |
36 | def supported?
37 | # TODO verify.
38 | # In future, verify tool is available.
39 | return true
40 | end
41 |
42 | end
43 |
--------------------------------------------------------------------------------
/lib/glue/tasks/dawnscanner.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'glue/util'
3 | require 'tempfile'
4 |
5 | class Glue::DawnScanner < Glue::BaseTask
6 |
7 | Glue::Tasks.add self
8 | include Glue::Util
9 |
10 | def initialize(trigger, tracker)
11 | super(trigger, tracker)
12 | @name = "DawnScanner"
13 | @description = "DawnScanner ruby analyzer"
14 | @stage = :code
15 | @labels << "code"
16 | end
17 |
18 | def run
19 | @results_file = Tempfile.new(['dawnresults', 'xml'])
20 | runsystem(true, "dawn", "-F", "#{@results_file.path}", "-j", ".", :chdir => @trigger.path)
21 | @results = JSON.parse(File.read("#{@results_file.path}"))['vulnerabilities']
22 | end
23 |
24 | def analyze
25 | begin
26 | @results.each do |result|
27 | description = result['name'].gsub('\n',' ')
28 | detail = "#{result['message']}\n#{result['remediation']}\n#{result['cve_link']}"
29 | source = {:scanner => @name, :file => nil, :line => nil, :code => nil}
30 | sev = severity(result['severity'])
31 | fprint = fingerprint("#{description}#{detail}#{source}#{sev}")
32 |
33 | report description, detail, source, sev, fprint
34 | end
35 | rescue Exception => e
36 | Glue.warn e.message
37 | Glue.warn e.backtrace
38 | ensure
39 | File.unlink @results_file
40 | end
41 | end
42 |
43 | def supported?
44 | supported=runsystem(true, "dawn", "--version")
45 | if supported =~ /command not found/
46 | Glue.notify "Install dawnscanner: 'gem install dawnscanner'"
47 | return false
48 | else
49 | return true
50 | end
51 | end
52 |
53 | end
54 |
--------------------------------------------------------------------------------
/lib/glue/tasks/dynamic.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'glue/util'
3 | require 'json'
4 | require 'json-schema'
5 |
6 | class Glue::Dynamic < Glue::BaseTask
7 | Glue::Tasks.add self
8 | include Glue::Util
9 |
10 | MAPPING_NAME_REGEX = /\A\w{0,20}\z/
11 | MAPPING_FOLDER = File.join(File.dirname(__FILE__), "../mappings")
12 | SCHEMA_FILE_PATH = File.join(MAPPING_FOLDER, "schema.json")
13 |
14 | def initialize(trigger, tracker)
15 | super(trigger, tracker)
16 | @name = "Dynamic Task"
17 | @description = "Dynamic task that parse JSON reports by using a mappings file"
18 | @stage = :code
19 | @labels << "code"
20 | end
21 |
22 | def run
23 | mapping_schema = JSON.parse(File.read(SCHEMA_FILE_PATH))
24 | report_path = "#{@tracker.options[:target]}"
25 | mapping_file_path = "#{@tracker.options[:mapping_file_path]}"
26 |
27 | if (!!MAPPING_NAME_REGEX.match(mapping_file_path) &&
28 | File.exist?(File.join(MAPPING_FOLDER, "#{mapping_file_path}.json")))
29 | mapping_file_path = File.join(MAPPING_FOLDER, "#{mapping_file_path}.json")
30 | elsif (!File.exist?(mapping_file_path))
31 | Glue.fatal "Mapping file #{mapping_file_path} not found"
32 | end
33 |
34 | if (!File.exist?(report_path))
35 | Glue.fatal "Report #{report_path} not found"
36 | end
37 |
38 | report = JSON.parse(File.read(report_path))
39 | mappings = JSON.parse(File.read(mapping_file_path))
40 |
41 | errors = JSON::Validator.fully_validate(mapping_schema, mappings, :validate_schema => true)
42 |
43 | if errors.any?
44 | Glue.fatal "Invalid mappings JSON: #{errors.inspect}"
45 | end
46 |
47 | app_name = report[mappings["app_name"]]
48 | task_name = mappings["task_name"]
49 |
50 | mappings["mappings"].each do |map|
51 | key = map["key"]
52 |
53 | if (report[key] == nil)
54 | Glue.fatal "report does not contains key '#{key}''"
55 | end
56 |
57 | report[key].each do |item|
58 | description = item[map["properties"]["description"]]
59 | detail = item[map["properties"]["detail"]]
60 | source = item[map["properties"]["source"]]
61 | severity_raw = item[map["properties"]["severity"]]
62 | fingerprint = item[map["properties"]["fingerprint"]]
63 | finding = Glue::Finding.new( app_name, description, detail, source, severity(severity_raw), fingerprint, task_name )
64 | @findings << finding
65 | end
66 | end
67 |
68 | end
69 |
70 | def analyze
71 | end
72 |
73 | def supported?
74 | return true
75 | end
76 |
77 | end
78 |
--------------------------------------------------------------------------------
/lib/glue/tasks/eslint.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'json'
3 | require 'glue/util'
4 |
5 | class Glue::ESLint < Glue::BaseTask
6 |
7 | Glue::Tasks.add self
8 | include Glue::Util
9 |
10 | def initialize(trigger, tracker)
11 | super(trigger,tracker)
12 | @name = "ESLint/ScanJS"
13 | @description = "Source analysis for JavaScript"
14 | @stage = :code
15 | @labels << "code" << "javascript"
16 | end
17 |
18 | def run
19 | rootpath = @trigger.path
20 | currentpath = File.expand_path File.dirname(__FILE__)
21 | Glue.debug "ESLint Config Path: #{currentpath}"
22 | @result = `eslint -c #{currentpath}/scanjs-eslintrc --no-color --quiet --format json #{rootpath}`
23 | end
24 |
25 | def analyze
26 | # puts @result
27 | begin
28 | parsed = JSON.parse(@result)
29 | parsed.each do |result|
30 | findings = {}
31 | prints = []
32 | messages = []
33 | result['messages'].each do |msg|
34 | message = msg['message']
35 | findings[message] = {} if findings[message].nil?
36 | findings[message][:detail] = msg['ruleId']
37 | if messages.include?(message)
38 | findings[message][:source] = "#{findings[message][:source]},#{msg['line']}" unless findings[message][:source].include?(",#{msg['line']}")
39 | else
40 | findings[message][:source] = "#{result['filePath']} Line: #{msg['line']}"
41 | messages << message
42 | end
43 | findings[message][:severity] = severity(msg['severity'].to_s)
44 | end
45 | findings.each do |key, value|
46 | print = fingerprint("#{key}#{value[:detail]}#{value[:source]}#{value[:sev]}")
47 | unless prints.include?(print)
48 | prints << print
49 | report key, value[:detail], value[:source], value[:severity], print
50 | end
51 | end
52 | end
53 | rescue Exception => e
54 | Glue.warn e.message
55 | Glue.warn e.backtrace
56 | Glue.warn "Raw result: #{@result}"
57 | end
58 | end
59 |
60 | def supported?
61 | supported=runsystem(true, "eslint", "-c", "~/.scanjs-eslintrc")
62 | if supported =~ /command not found/
63 | Glue.notify "Install eslint and the scanjs .eslintrc"
64 | return false
65 | else
66 | return true
67 | end
68 | end
69 |
70 | end
71 |
--------------------------------------------------------------------------------
/lib/glue/tasks/fim.rb:
--------------------------------------------------------------------------------
1 | # https://github.com/jessek/hashdeep/releases/tag/release-4.4
2 |
3 | require 'glue/tasks/base_task'
4 | require 'open3'
5 |
6 | class Glue::FIM < Glue::BaseTask
7 |
8 | Glue::Tasks.add self
9 |
10 | def initialize(trigger, tracker)
11 | super(trigger,tracker)
12 | @name = "FIM"
13 | @description = "File integrity monitor"
14 | @stage = :file
15 | @result = ''
16 | @labels << "filesystem"
17 | end
18 |
19 | def run
20 | rootpath = @trigger.path
21 | if File.exists?("/area81/tmp/#{rootpath}/filehash")
22 | Glue.notify "File Hashes found, comparing to file system"
23 | cmd="hashdeep -j99 -r -a -vv -k /area81/tmp/#{rootpath}/filehash #{rootpath}"
24 |
25 | # Ugly stdout parsing
26 | r=/(.*): No match/
27 | Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
28 | while line = stdout.gets
29 | if line.match r
30 | @result << line
31 | end
32 | end
33 | end
34 | else
35 | Glue.notify "No existing baseline - generating initial hashes"
36 | cmd="mkdir -p /area81/tmp/#{rootpath}; hashdeep -j99 -r #{rootpath} > /area81/tmp/#{rootpath}/filehash"
37 | Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
38 | while line = stdout.gets
39 | puts "."
40 | end
41 | end
42 | @result = ''
43 | end
44 | end
45 |
46 | def analyze
47 | list = @result.split(/\n/)
48 | list.each do |v|
49 | # v.slice! installdir
50 | Glue.notify v
51 | report "File changed.", v, @name, :low
52 | end
53 | end
54 |
55 | def supported?
56 | # In future, verify tool is available.
57 | return true
58 | end
59 |
60 | end
61 |
--------------------------------------------------------------------------------
/lib/glue/tasks/findsecbugs.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'glue/util'
3 | require 'nokogiri'
4 | require 'tempfile'
5 | require 'mkmf'
6 |
7 | MakeMakefile::Logging.instance_variable_set(:@logfile, File::NULL)
8 |
9 | class Glue::FindSecurityBugs < Glue::BaseTask
10 |
11 | Glue::Tasks.add self
12 | include Glue::Util
13 |
14 | def initialize(trigger, tracker)
15 | super(trigger, tracker)
16 | @name = "FindSecurityBugs"
17 | @description = "FindSecurityBugs plugin for FindBugs"
18 | @stage = :code
19 | @labels << "code"
20 | end
21 |
22 | def run
23 | @results_file = Tempfile.new(['findsecbugs','xml'])
24 |
25 | unless File.exist?("#{@trigger.path}/.git/config")
26 | runsystem(true, "git", "init", :chdir => @trigger.path)
27 | runsystem(true, "git", "add", "*", :chdir => @trigger.path)
28 | runsystem(true, "git", "commit", "-am", "fake commit for mvn compile", :chdir => @trigger.path)
29 | end
30 |
31 | directories_with?('pom.xml').each do |dir|
32 | runsystem(true, "mvn", "compile", "-fn", :chdir => dir)
33 | end
34 |
35 | runsystem(true, "/bin/sh", "#{@tracker.options[:findsecbugs_path]}/findsecbugs.sh", "-effort:max", "-quiet", "-xml:withMessages", "-output", "#{@results_file.path}", "#{@trigger.path}", :chdir => @tracker.options[:findsecbugs_path] )
36 | @results = Nokogiri::XML(File.read(@results_file)).xpath '//BugInstance'
37 | end
38 |
39 | def analyze
40 | begin
41 | @results.each do |result|
42 | description = result.xpath('ShortMessage').text
43 | bug_type = result.attributes['type'].value
44 | detail = "Class: #{result.at_xpath('Method').attributes['classname'].value}, Method: #{result.at_xpath('Method').attributes['name'].value}\n#{result.xpath('LongMessage').text}\nhttps://find-sec-bugs.github.io/bugs.htm##{bug_type}"
45 |
46 | file = result.at_xpath('SourceLine').attributes['sourcepath'].value
47 | trigger_path = Pathname.new(@trigger.path)
48 | real_path = nil
49 | trigger_path.find {|path| real_path = path if path.fnmatch "*/#{file}"}
50 | file = real_path.relative_path_from(trigger_path).to_s unless real_path.nil?
51 |
52 | line = result.at_xpath('SourceLine[@primary="true"]').attributes['start'].value
53 | code = "#{result.at_xpath('String').attributes['value'].value}"
54 | source = {:scanner => @name, :file => file, :line => line, :code => code}
55 | sev = result.attributes['priority'].value
56 | fprint = fingerprint("#{description}#{detail}#{source}")
57 |
58 | report description, detail, source, sev, fprint
59 | end
60 | rescue Exception => e
61 | Glue.warn e.message
62 | Glue.warn e.backtrace
63 | ensure
64 | File.unlink @results_file
65 | end
66 | end
67 |
68 | def supported?
69 | unless find_executable0('mvn') and File.exist?("#{@trigger.path}/pom.xml")
70 | Glue.notify "FindSecurityBugs support requires maven and pom.xml"
71 | Glue.notify "Please install maven somewhere in your PATH and include a valid pom.xml in the project root"
72 | return false
73 | end
74 |
75 | unless @tracker.options.has_key?(:findsecbugs_path) and File.exist?("#{@tracker.options[:findsecbugs_path]}/findsecbugs.sh")
76 | Glue.notify "#{@tracker.options[:findsecbugs_path]}"
77 | Glue.notify "Download and unpack the latest findsecbugs-cli release: https://github.com/find-sec-bugs/find-sec-bugs/releases"
78 | return false
79 | else
80 | return true
81 | end
82 | end
83 |
84 | end
85 |
--------------------------------------------------------------------------------
/lib/glue/tasks/npm.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'glue/util'
3 | require 'find'
4 |
5 | class Glue::Npm < Glue::BaseTask
6 |
7 | Glue::Tasks.add self
8 | include Glue::Util
9 |
10 | def initialize(trigger, tracker)
11 | super(trigger, tracker)
12 | @name = "NPM"
13 | @description = "Node Package Manager"
14 | @stage = :file
15 | @labels << "file" << "javascript"
16 | @results = []
17 | end
18 |
19 | def run
20 | exclude_dirs = ['node_modules','bower_components']
21 | exclude_dirs = exclude_dirs.concat(@tracker.options[:exclude_dirs]).uniq if @tracker.options[:exclude_dirs]
22 | directories_with?('package.json', exclude_dirs).each do |dir|
23 | Glue.notify "#{@name} scanning: #{dir}"
24 | if @tracker.options.has_key?(:npm_registry)
25 | registry = "--registry #{@tracker.options[:npm_registry]}"
26 | else
27 | registry = nil
28 | end
29 | @command = "npm install -q --ignore-scripts #{registry}"
30 | @results << runsystem(true, @command, :chdir => dir)
31 | end
32 | end
33 |
34 | def analyze
35 | begin
36 | if @results.include? false
37 | Glue.warn 'Error installing javascript dependencies with #{@command}'
38 | end
39 | rescue Exception => e
40 | Glue.warn e.message
41 | Glue.warn e.backtrace
42 | end
43 | end
44 |
45 | def supported?
46 | supported = find_executable0('npm')
47 | unless supported
48 | Glue.notify "Install npm: https://nodejs.org/en/download/"
49 | return false
50 | else
51 | return true
52 | end
53 | end
54 |
55 | end
56 |
--------------------------------------------------------------------------------
/lib/glue/tasks/nsp.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'glue/util'
3 |
4 | class Glue::NodeSecurityProject < Glue::BaseTask
5 |
6 | Glue::Tasks.add self
7 | include Glue::Util
8 |
9 | def initialize(trigger, tracker)
10 | super(trigger, tracker)
11 | @name = "NodeSecurityProject"
12 | @description = "Node Security Project"
13 | @stage = :code
14 | @labels << "code" << "javascript" << "node"
15 | @results = []
16 | end
17 |
18 | def run
19 | exclude_dirs = ['node_modules','bower_components']
20 | exclude_dirs = exclude_dirs.concat(@tracker.options[:exclude_dirs]).uniq if @tracker.options[:exclude_dirs]
21 | directories_with?('package.json', exclude_dirs).each do |dir|
22 | Glue.notify "#{@name} scanning: #{dir}"
23 | res = runsystem(true, "nsp", "check", "--output", "json", :chdir => dir)
24 | @results << JSON.parse(res)
25 | end
26 | end
27 |
28 | def analyze
29 | begin
30 | @results.each do |dir_result|
31 | # This block iterates through each package name found and selects the unique nsp advisories
32 | # regardless of version, and builds a Glue finding hash for each unique package/advisory combo.
33 | dir_result.uniq {|finding| finding['module']}.each do |package|
34 | dir_result.select {|f| f['module'] == package['module']}.uniq {|m| m['advisory']}.each do |unique_finding|
35 | description = "#{unique_finding['module']} - #{unique_finding['title']}"
36 | detail = "Upgrade to versions: #{unique_finding['patched_versions']}\n#{unique_finding['advisory']}"
37 | source = {
38 | :scanner => 'NodeSecurityProject',
39 | :file => "#{unique_finding['module']} - #{unique_finding['vulnerable_versions']}",
40 | :line => nil,
41 | :code => nil
42 | }
43 | report description, detail, source, 'medium', fingerprint("#{description}#{detail}#{source}")
44 | end
45 | end
46 | end
47 | rescue Exception => e
48 | Glue.warn e.message
49 | Glue.warn e.backtrace
50 | end
51 | end
52 |
53 | def supported?
54 | supported=runsystem(true, "nsp", "--version")
55 | if supported =~ /command not found/
56 | Glue.notify "Install nodesecurity: 'npm install -g nsp'"
57 | return false
58 | else
59 | return true
60 | end
61 | end
62 |
63 | end
64 |
--------------------------------------------------------------------------------
/lib/glue/tasks/pmd.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'glue/util'
3 | require 'nokogiri'
4 | require 'pathname'
5 |
6 | class Glue::PMD < Glue::BaseTask
7 |
8 | Glue::Tasks.add self
9 | include Glue::Util
10 |
11 | def initialize(trigger, tracker)
12 | super(trigger, tracker)
13 | @name = "PMD"
14 | @description = "PMD Source Code Analyzer"
15 | @stage = :code
16 | @labels << "code"
17 | end
18 |
19 | def run
20 | @tracker.options[:pmd_checks] ||= "java-basic,java-sunsecure"
21 | results_xml = runsystem(true,'bin/run.sh', 'pmd', '-d', "#{@trigger.path}", '-f', 'xml', '-R', "#{@tracker.options[:pmd_checks]}", :chdir => @tracker.options[:pmd_path])
22 | @results = Nokogiri::XML(results_xml).xpath('//file')
23 | end
24 |
25 | def analyze
26 | begin
27 | @results.each do |result|
28 | attributes = result.at_xpath('violation').attributes
29 | description = result.children.children.to_s.strip
30 | detail = "Ruleset: #{attributes['ruleset']}"
31 | source = {:scanner => @name, :file => result.attributes['name'].to_s.split(Pathname.new(@trigger.path).cleanpath.to_s)[1][1..-1], :line => attributes['beginline'].to_s, :code => "package: #{attributes['package'].to_s}\nclass: #{attributes['class'].to_s}\nmethod: #{attributes['method'].to_s}" }
32 | case attributes['priority'].value.to_i
33 | when 3
34 | sev = 1
35 | when 2
36 | sev = 2
37 | when 1
38 | sev = 3
39 | else
40 | sev = 0
41 | end
42 | fprint = fingerprint("#{description}#{detail}#{source}#{sev}")
43 |
44 | report description, detail, source, sev, fprint
45 | end
46 | rescue Exception => e
47 | Glue.warn e.message
48 | Glue.warn e.backtrace
49 | end
50 | end
51 |
52 | def supported?
53 | unless @tracker.options.has_key?(:pmd_path) and File.exist?("#{@tracker.options[:pmd_path]}/bin/run.sh")
54 | Glue.notify "#{@tracker.options[:pmd_path]}"
55 | Glue.notify "Install PMD from: https://pmd.github.io/"
56 | return false
57 | else
58 | return true
59 | end
60 | end
61 |
62 | end
63 |
--------------------------------------------------------------------------------
/lib/glue/tasks/scanjs.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 |
3 | class Glue::ScanJS < Glue::BaseTask
4 |
5 | # WIP
6 | # Glue::Tasks.add self
7 |
8 | def initialize(trigger, tracker)
9 | super(trigger)
10 | @name = "ScanJS"
11 | @description = "Source analysis for JavaScript"
12 | @stage = :code
13 | @labels << "code" << "javascript"
14 | end
15 |
16 | def run
17 | Glue.notify "#{@name}"
18 | rootpath = @trigger.path
19 | @result=`scanner.js -t "#{rootpath}"`
20 | end
21 |
22 | def analyze
23 | puts @result
24 | end
25 |
26 | def supported?
27 | # In future, verify tool is available.
28 | return true
29 | end
30 |
31 | end
32 |
--------------------------------------------------------------------------------
/lib/glue/tasks/scout2.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'json'
3 | require 'glue/util'
4 | require 'securerandom'
5 |
6 | class Glue::Scout < Glue::BaseTask
7 |
8 | Glue::Tasks.add self
9 | include Glue::Util
10 |
11 | def initialize(trigger, tracker)
12 | super(trigger, tracker)
13 | @name = "Scout"
14 | @description = "Security review for your AWS environment"
15 | @stage = :live
16 | @labels << "cloud" << "aws"
17 | end
18 |
19 | # TODO AWS Credentials
20 | # TODO Docker image
21 | # TODO Cleanup issues - release 1.0
22 |
23 | def run
24 | rootpath = @trigger.path
25 | context = SecureRandom.uuid
26 | @tmppath = "/tmp/#{context}/"
27 | runsystem(true, "Scout2", "--no-browser", "--report-dir", "#{@tmppath}")
28 | file = File.open("#{@tmppath}/inc-awsconfig/aws_config.js", "rb")
29 | @result= file.read
30 | end
31 |
32 | def analyze
33 | begin
34 | # Glue.warn @result
35 | start = @result.index('{') # First we need to take out the variable = part which is not proper JSON
36 | json = @result.slice(start, @result.size)
37 | parsed = JSON.parse(json)
38 | count = 0
39 | parsed["services"].each do |servicename, servicesjson|
40 | # This would be a chance to skip a named service...
41 | if servicesjson["findings"] then # Have seen this as empty / nil in practice
42 | servicesjson["findings"].each do |findingname, detail|
43 | count = count + 1
44 | severity = "low"
45 | if detail["level"] === "danger" then severity = "high" end
46 |
47 | source = { :scanner => @name,
48 | :service => servicename,
49 | :findingname => findingname
50 | # TODO Add region?
51 | }
52 |
53 | # This would be a place to only report danger. (If Sev low)
54 | report findingname,
55 | detail["description"],
56 | source,
57 | severity,
58 | fingerprint(source.to_s)
59 |
60 | end
61 | end
62 | end
63 | rescue Exception => e
64 | Glue.warn e.message
65 | Glue.warn e.backtrace
66 | Glue.warn "Raw result: #{@result}"
67 | end
68 | end
69 |
70 | def supported?
71 | supported=runsystem(true, "Scout2", "-h")
72 | if supported =~ /usage: Scout2/
73 | return true
74 | else
75 | Glue.notify "Install python and pip."
76 | Glue.notify "Run: pip install awsscout"
77 | Glue.notify "See: https://github.com/nccgroup/Scout2"
78 | return false
79 | end
80 | end
81 |
82 | end
83 |
--------------------------------------------------------------------------------
/lib/glue/tasks/sfl.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'glue/util'
3 | require 'json'
4 | require 'find'
5 | require 'English'
6 |
7 | class Glue::SFL < Glue::BaseTask
8 | Glue::Tasks.add self
9 | include Glue::Util
10 |
11 | PATTERNS_FILE_PATH = File.join(File.dirname(__FILE__), "patterns.json")
12 |
13 | def initialize(trigger, tracker)
14 | super(trigger, tracker)
15 | @name = "SFL"
16 | @description = "Sensitive File Lookup (SFL)"
17 | @stage = :code
18 | @labels << "code"
19 | @results = []
20 | self
21 | end
22 |
23 | def run
24 | begin
25 | Glue.notify @name
26 | run_sfl!
27 | rescue StandardError => e
28 | log_error(e)
29 | end
30 |
31 | self
32 | end
33 |
34 | def analyze
35 | @results.each do |result|
36 | begin
37 | report_finding! result
38 | rescue StandardError => e
39 | log_error(e)
40 | end
41 | end
42 |
43 | self
44 | end
45 |
46 | def supported?
47 | true
48 | end
49 |
50 | def self.patterns
51 | @patterns ||= read_patterns_file
52 | @patterns.dup
53 | end
54 |
55 | def self.matches?(filepath, pattern)
56 | text = extract_filepart(filepath, pattern)
57 | pattern_matched?(text, pattern)
58 | end
59 |
60 | private
61 |
62 | def run_sfl!
63 | files = Find.find(@trigger.path).select { |path| File.file?(path) }
64 | Glue.debug "Found #{files.count} files"
65 |
66 | files.each do |filepath|
67 | self.class.patterns.each do |pattern|
68 | if self.class.matches?(filepath, pattern)
69 | @results << { filepath: filepath, pattern: pattern }
70 | end
71 | end
72 | end
73 |
74 | nil
75 | end
76 |
77 | def report_finding!(result)
78 | pattern = result[:pattern]
79 | filepath = result[:filepath]
80 |
81 | description = pattern['caption']
82 | detail = pattern['description']
83 | source = "#{@name}:#{filepath}"
84 | severity = 1
85 | fprint = fingerprint("SFL-#{pattern['part']}#{pattern['type']}" \
86 | "#{pattern['pattern']}#{filepath}")
87 |
88 | report description, detail, source, severity, fprint
89 | end
90 |
91 | private_class_method def self.read_patterns_file
92 | JSON.parse(File.read(PATTERNS_FILE_PATH))
93 | rescue
94 | modified_message = "#{$ERROR_INFO} (problem with SFL patterns file)"
95 | raise $ERROR_INFO, modified_message, $ERROR_INFO.backtrace
96 | end
97 |
98 | private_class_method def self.extract_filepart(filepath, pattern)
99 | case pattern['part']
100 | when 'filename' then File.basename(filepath)
101 | when 'extension' then File.extname(filepath).gsub(/^\./, '')
102 | when 'path' then filepath
103 | else ''
104 | end
105 | end
106 |
107 | private_class_method def self.pattern_matched?(text, pattern)
108 | case pattern['type']
109 | when 'match'
110 | text == pattern['pattern']
111 | when 'regex'
112 | regex = Regexp.new(pattern['pattern'], Regexp::IGNORECASE)
113 | !!regex.match(text)
114 | else
115 | false
116 | end
117 | end
118 |
119 | def log_error(e)
120 | Glue.notify "Problem running SFL"
121 | Glue.warn e.inspect
122 | Glue.warn e.backtrace
123 | end
124 | end
125 |
--------------------------------------------------------------------------------
/lib/glue/tasks/snyk.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'glue/util'
3 | require 'redcarpet'
4 |
5 | class Glue::Snyk < Glue::BaseTask
6 |
7 | Glue::Tasks.add self
8 | include Glue::Util
9 |
10 | BASE_EXCLUDE_DIRS = %w(node_modules bower_components).freeze
11 |
12 | def initialize(trigger, tracker)
13 | super(trigger, tracker)
14 | @name = "Snyk"
15 | @description = "Snyk.io JS dependency checker"
16 | @stage = :code
17 | @labels << "code" << "javascript"
18 | @results = []
19 | end
20 |
21 | def run
22 | directories_with?('package.json', exclude_dirs).each do |dir|
23 | Glue.notify "#{@name} scanning: #{dir}"
24 | raw_output = runsystem(true, "snyk", "test", "--json", :chdir => dir)
25 | parsed_output = parse_snyk(raw_output)
26 | @results << parsed_output unless parsed_output.nil?
27 | end
28 |
29 | self
30 | end
31 |
32 | def analyze
33 | @results.each do |dir_results|
34 | # We build a single finding for each uniq result ID within a given directory,
35 | # adding the unique info (upgrade path and files) as a list.
36 | begin
37 | dir_results.chunk { |r| r['id'] }.each do |_, results|
38 | result = results.first
39 |
40 | description = "#{result['name']}@#{result['version']} - #{result['title']}"
41 | detail = markdown_to_html(result['description'])
42 | source = build_source_hash(results)
43 | sev = severity(result['severity'])
44 | fprint = fingerprint("#{description}#{detail}#{source}#{sev}")
45 |
46 | report description, detail, source, sev, fprint
47 | end
48 | rescue NoMethodError, TypeError => e
49 | log_error(e)
50 | end
51 | end
52 |
53 | self
54 | end
55 |
56 | def supported?
57 | supported = find_executable0('snyk')
58 |
59 | unless supported
60 | Glue.notify "Install Snyk: 'npm install -g snyk'"
61 | false
62 | else
63 | true
64 | end
65 | end
66 |
67 | private
68 |
69 | def exclude_dirs
70 | extra_exclude_dirs = @tracker.options[:exclude_dirs] || []
71 | BASE_EXCLUDE_DIRS | extra_exclude_dirs
72 | end
73 |
74 | def parse_snyk(raw_output)
75 | JSON.parse(raw_output)["vulnerabilities"]
76 | rescue JSON::ParserError, TypeError => e
77 | log_error(e)
78 | nil
79 | end
80 |
81 | def log_error(e)
82 | Glue.notify "Problem running Snyk"
83 | Glue.warn e.inspect
84 | Glue.warn e.backtrace
85 | end
86 |
87 | def markdown_to_html(markdown)
88 | # Use Redcarpet to render the Markdown details to something pretty for web display
89 | @@markdown_engine ||= Redcarpet::Markdown.new Redcarpet::Render::HTML.new(link_attributes: {target: "_blank"}), autolink: true, tables: true
90 | @@markdown_engine.render(markdown).gsub('h2>','strong>').gsub('h3>', 'strong>')
91 | end
92 |
93 | def build_source_hash(results)
94 | # Consolidate the list of files and upgrade paths for all results with the same 'id'
95 | # in the same directory.
96 | # This uses the same form as the retirejs task so it all looks nice together.
97 |
98 | upgrade_paths = [ "Upgrade Path:\n" ]
99 | files = []
100 |
101 | results.each do |res|
102 | res['upgradePath'].each_with_index do |upgrade, i|
103 | upgrade_paths << "#{res['from'][i]} -> #{upgrade}"
104 | end
105 | files << res['from'].join('->')
106 | end
107 |
108 | {
109 | :scanner => @name,
110 | :file => files.join('
'),
111 | :line => nil,
112 | :code => upgrade_paths.uniq.join("\n"),
113 | }
114 | end
115 | end
116 |
--------------------------------------------------------------------------------
/lib/glue/tasks/test.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'glue/util'
3 |
4 | class Glue::Test < Glue::BaseTask
5 | Glue::Tasks.add self
6 | include Glue::Util
7 |
8 | def initialize(trigger, tracker)
9 | super(trigger, tracker)
10 | @name = "Test"
11 | @description = "Test"
12 | @stage = :code
13 | @labels << "code" << "ruby"
14 | end
15 |
16 | def run
17 | # Glue.notify "#{@name}"
18 | rootpath = @trigger.path
19 | Glue.debug "Rootpath: #{rootpath}"
20 | @result= runsystem(true, "grep", "-R", "secret", :chdir => rootpath)
21 | end
22 |
23 | def analyze
24 | begin
25 | list = @result.split(/\n/)
26 | list.each do |match|
27 | report "Match", match, @name, :low, "fingerprint"
28 | end
29 | rescue Exception => e
30 | Glue.warn e.message
31 | Glue.notify "Error grepping ... "
32 | end
33 | end
34 |
35 | def supported?
36 | supported=runsystem(true, "grep", "-h")
37 | if supported =~ /usage/
38 | Glue.notify "Install grep."
39 | return false
40 | else
41 | return true
42 | end
43 | end
44 |
45 | end
46 |
--------------------------------------------------------------------------------
/lib/glue/tasks/trufflehog.rb:
--------------------------------------------------------------------------------
1 | require 'glue/tasks/base_task'
2 | require 'glue/util'
3 | require 'httparty'
4 |
5 | # Runs the TruffleHog scanner. See https://github.com/dxa4481/truffleHog for details.
6 | class Glue::Trufflehog < Glue::BaseTask
7 | Glue::Tasks.add self
8 | include Glue::Util
9 |
10 | ISSUE_SEVERITY = 4
11 |
12 | def initialize(trigger, tracker)
13 | super(trigger, tracker)
14 | @name = "Trufflehog"
15 | @description = "Runs Trufflehog check"
16 | @stage = :code
17 | @labels << "code" << "java" << ".net"
18 |
19 | @trufflehog_path = '/home/glue/tools/truffleHog/truffleHog/truffleHog.py'
20 | end
21 |
22 | def run
23 | Glue.notify "#{@name}"
24 | @result = runsystem(true, '/usr/bin/env', 'python', @trufflehog_path, '--json', @trigger.path)
25 | end
26 |
27 | def analyze
28 | begin
29 | # Glue.debug "Parsing results..."
30 | # puts @result
31 | get_warnings
32 | rescue Exception => e
33 | Glue.notify "Problem running Trufflehog ... skipped."
34 | Glue.notify e.message
35 | raise e
36 | end
37 | end
38 |
39 | def supported?
40 | if runsystem(false, '/usr/bin/env', 'python', @trufflehog_path, '-h').empty?
41 | Glue.notify "Check that TruffleHog is installed at #{@trufflehog_path}."
42 | return false
43 | end
44 |
45 | true
46 | end
47 |
48 | private
49 |
50 | def get_warnings
51 | JSON::parse(@result).each do |title, string|
52 | detail = "Apparent password or other secret: #{string}"
53 | fingerprint = "Trufflehog|#{title}"
54 | self.report "Possible password or other secret in source code.", detail, title, ISSUE_SEVERITY, fingerprint
55 | end
56 | end
57 | end
58 |
--------------------------------------------------------------------------------
/lib/glue/tracker.rb:
--------------------------------------------------------------------------------
1 | require 'json'
2 |
3 | class Glue::Tracker
4 | attr_reader :options
5 | attr_reader :warnings
6 | attr_reader :errors
7 | attr_reader :findings
8 |
9 | # Pass in the options.
10 | # Let the Tracker be the one thing that gets passed around
11 | # with options and collecting output.
12 | def initialize options
13 | @options = options
14 | @warnings = []
15 | @errors = []
16 | @findings = []
17 | end
18 |
19 | #Process events that
20 | def process event
21 |
22 | end
23 |
24 | def error error
25 | @errors << error
26 | end
27 |
28 | def warn warning
29 | @warnings << warning
30 | end
31 |
32 | def report finding
33 | @findings << finding
34 | end
35 |
36 | def get_worst_finding
37 | worst = nil
38 | @findings.each do |finding|
39 | if !worst
40 | worst = finding
41 | elsif finding.severity > worst.severity
42 | worst = finding
43 | end
44 | end
45 | worst
46 | end
47 |
48 | def to_json
49 | s = "{ \"findings\": [ "
50 | @findings.each do |finding|
51 | s << finding.to_json
52 | s << ","
53 | end
54 | s = s.slice(0,s.length-1) # One easy way to remove the last ,
55 | s << "] }"
56 | s
57 |
58 | end
59 | end
60 |
--------------------------------------------------------------------------------
/lib/glue/util.rb:
--------------------------------------------------------------------------------
1 | require 'open3'
2 | require 'pathname'
3 | require 'digest'
4 |
5 | module Glue::Util
6 |
7 | def runsystem(report, *splat)
8 | Open3.popen3(*splat) do |stdin, stdout, stderr, wait_thr|
9 |
10 | # start a thread consuming the stdout buffer
11 | # if the pipes fill up a deadlock occurs
12 | stdout_consumed = ""
13 | consumer_thread = Thread.new {
14 | while line = stdout.gets do
15 | stdout_consumed += line
16 | end
17 | }
18 |
19 | if $logfile and report
20 | while line = stderr.gets do
21 | $logfile.puts line
22 | end
23 | end
24 |
25 | consumer_thread.join
26 | return stdout_consumed.chomp
27 | #return stdout.read.chomp
28 | end
29 | end
30 |
31 | def fingerprint text
32 | Digest::SHA2.new(256).update(text).to_s
33 | end
34 |
35 | def strip_archive_path path, delimeter
36 | path.split(delimeter).last.split('/')[1..-1].join('/')
37 | end
38 |
39 | def relative_path path, pwd
40 | pathname = Pathname.new(path)
41 | return path if pathname.relative?
42 | pathname.relative_path_from(Pathname.new pwd)
43 | end
44 | end
45 |
--------------------------------------------------------------------------------
/lib/glue/version.rb:
--------------------------------------------------------------------------------
1 | module Glue
2 | Version = "0.9.4"
3 | end
4 |
--------------------------------------------------------------------------------
/spec/awsscout_spec.rb:
--------------------------------------------------------------------------------
1 | # require 'spec_helper'
2 |
3 | # require 'glue/tasks'
4 | # require 'glue/tracker'
5 | # require 'glue/tasks/scout2'
6 | # require 'glue'
7 |
8 | # def get_scouter
9 | # options = {}
10 | # trigger = "abc"
11 | # tracker = Glue::Tracker.new(options)
12 | # scouter = Glue::Scout.new(@trigger, @tracker)
13 | # scouter
14 | # end
15 |
16 | # RSpec.describe "Test AWS Scout Glue Task Supports" do
17 | # scouter = get_scouter
18 | # result = scouter.supported?
19 | # it {
20 | # expect(result).to be == true
21 | # }
22 | # end
23 |
24 | # RSpec.describe "Test analyze on main scout_data.json file" do
25 | # scouter = get_scouter
26 | # scouter.result = File.open("#{File.expand_path(File.dirname(__FILE__))}/scout_data.json", "rb")
27 | # scouter.analyze
28 | # # scouter.
29 | # end
30 |
31 |
32 |
--------------------------------------------------------------------------------
/spec/cli_spec.rb:
--------------------------------------------------------------------------------
1 | require 'aruba'
2 |
3 | # RSpec.describe 'CLI HELP', :type => :aruba do
4 | # before(:each) { run('glue -h') }
5 | # it { expect(last_command_started).to be_successfully_executed }
6 | # it { expect(last_command_started).to have_output /Glue is a swiss army knife of security analysis tools/ }
7 | # end
8 |
9 | # RSpec.describe 'CLI Version', :type => :aruba do
10 | # before(:each) { run('glue -v') }
11 | # it { expect(last_command_started).to be_successfully_executed }
12 | # it { expect(last_command_started).to have_output /Glue 0.9.4/ }
13 | # end
14 |
--------------------------------------------------------------------------------
/spec/eicar.com:
--------------------------------------------------------------------------------
1 | X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
--------------------------------------------------------------------------------
/spec/filters/file_filter/targets/finding_ignore.json:
--------------------------------------------------------------------------------
1 | {
2 | "fingerprint1": "ignore",
3 | "fingerprint2": "new"
4 | }
--------------------------------------------------------------------------------
/spec/filters/file_filter/targets/finding_partial.json:
--------------------------------------------------------------------------------
1 | {
2 | "fingerprint1": "ignore",
3 | "fingerprint2": "new"
4 | }
--------------------------------------------------------------------------------
/spec/filters/file_filter/targets/finding_postpone.json:
--------------------------------------------------------------------------------
1 | {
2 | "fingerprint1": "postpone:1-1-2999",
3 | "fingerprint2": "new"
4 | }
--------------------------------------------------------------------------------
/spec/filters/file_filter/targets/finding_postpone_passed.json:
--------------------------------------------------------------------------------
1 | {
2 | "fingerprint1": "postpone:1-1-1",
3 | "fingerprint2": "new"
4 | }
--------------------------------------------------------------------------------
/spec/parse_scout_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 | require 'json'
3 |
4 | RSpec.describe 'Parse Scout JSON' do
5 | file = File.open("#{File.expand_path(File.dirname(__FILE__))}/scout_data.json", "rb")
6 | result = file.read
7 | start = result.index('{')
8 | result = result.slice(start,result.size)
9 | #puts "Result: #{result}"
10 | it {
11 | expect( JSON.parse(result) )
12 | json = JSON.parse(result)
13 | count = 0
14 | findingcount = 0
15 | dangercount = 0
16 | json["services"].each do |name, servicesjson|
17 | count = count + 1
18 | # puts "Count: #{count}"
19 | # puts name
20 | if servicesjson["findings"] then
21 | servicesjson["findings"].each do |findingname, detail|
22 | findingcount = findingcount + 1
23 | # puts "\t#{findingname}"
24 | # puts "\t\t#{detail["description"]}"
25 | # puts "\t\t#{detail["level"]}"
26 | if detail["level"] == "danger" then
27 | dangercount = dangercount + 1
28 | end
29 | end
30 | end
31 | end
32 | # puts "Finding count #{dangercount}"
33 | expect(findingcount).to be == 109
34 | expect(dangercount).to be == 75
35 | expect(count).to be == 15
36 | }
37 | end
38 |
--------------------------------------------------------------------------------
/spec/reporters/jira_reporter_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | require 'glue'
4 | require 'glue/event'
5 | require 'glue/tracker'
6 | require 'glue/finding'
7 | require 'glue/reporters'
8 | require 'glue/reporters/jira_reporter'
9 |
10 | describe Glue::JiraReporter do
11 |
12 | describe "JIRA Reporter" do
13 | subject {Glue::JiraReporter.new()}
14 |
15 | it "should set jira issue type to Bug when no type given" do
16 | expected_output = "Bug"
17 | actual_output_example_1 = subject.send("jira_issue_type", nil)
18 | actual_output_example_2 = subject.send("jira_issue_type", "")
19 |
20 | expect(expected_output).to eq(actual_output_example_1)
21 | expect(expected_output).to eq(actual_output_example_2)
22 | end
23 |
24 | it "should set jira issue to type passed by the user" do
25 | expected_output = "Story"
26 | actual_output = subject.send("jira_issue_type", "Story")
27 |
28 | expect(expected_output).to eq(actual_output)
29 | end
30 |
31 | end
32 | end
--------------------------------------------------------------------------------
/spec/reporters/slack_reporter_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | require 'glue'
4 | require 'glue/event'
5 | require 'glue/tracker'
6 | require 'glue/finding'
7 | require 'glue/reporters'
8 | require 'glue/reporters/slack_reporter'
9 |
10 | describe Glue::SlackReporter do
11 |
12 | before do
13 | @tracker = Glue::Tracker.new({
14 | slack_token: "",
15 | slack_channel: ""
16 | })
17 |
18 | @tracker.report Glue::Finding.new( "finding_appname",
19 | "finding_description",
20 | "finding_detail",
21 | "finding_test",
22 | 1,
23 | "fingerprint_1",
24 | "finding_task" )
25 | end
26 |
27 | describe "Slack Reporter" do
28 | subject {Glue::SlackReporter.new()}
29 |
30 | it "should report findings as a slack message with an attachment" do
31 | # Stub out requests to Slack API
32 | stub_request(:post, "https://slack.com/api/auth.test")
33 | .to_return(status: 200, body: "", headers: {})
34 |
35 | stub_request(:post, "https://slack.com/api/chat.postMessage")
36 | .to_return(status: 200, body: "", headers: {})
37 |
38 |
39 | # Build slack report
40 | subject.run_report(@tracker)
41 |
42 | # Check slack client made request to send message with attachment for findings
43 | WebMock.should have_requested(:post, "https://slack.com/api/chat.postMessage")
44 | .with{|req|
45 | req.body.include?("attachments=%0A%09Description%3A+finding_description")
46 | req.body.include?("text=OWASP+Glue+test+run+completed+-+See+attachment.")
47 | }
48 | end
49 | end
50 | end
--------------------------------------------------------------------------------
/spec/reporters/teamcity_reporter_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | require 'glue'
4 | require 'glue/event'
5 | require 'glue/tracker'
6 | require 'glue/finding'
7 | require 'glue/reporters'
8 | require 'glue/reporters/teamcity_reporter'
9 |
10 | describe Glue::TeamCityReporter do
11 |
12 | before do
13 | @tracker = Glue::Tracker.new({})
14 | @tracker.report Glue::Finding.new( "test", "test", "test", "test", 1, "fingerprint1", "some test" )
15 | end
16 |
17 | describe "TeamCity Reporter" do
18 | subject {Glue::TeamCityReporter.new()}
19 | describe "Report non-high finding as ignored tests" do
20 |
21 | it "should write all finding to file with state 'new'" do
22 | output = subject.run_report(@tracker)
23 | expected = %q(##teamcity[message text='Report failed tests for each finding with severity equal or above High' status='NORMAL']
24 | ##teamcity[testSuiteStarted name='some test']
25 | ##teamcity[testIgnored name='fingerprint1' message='Severity Low']
26 | ##teamcity[testSuiteFinished name='some test']
27 | )
28 | expect(output).to eq(expected)
29 | end
30 | end
31 |
32 | describe "Report all finding as failing tests when setting the appropriate level" do
33 | before do
34 | @tracker.options[:teamcity_min_level] = 1
35 | end
36 |
37 | it "should write all finding to file with state 'new'" do
38 | output = subject.run_report(@tracker)
39 | expected = %q(##teamcity[message text='Report failed tests for each finding with severity equal or above Low' status='NORMAL']
40 | ##teamcity[testSuiteStarted name='some test']
41 | ##teamcity[testStarted name='fingerprint1' captureStandardOutput='true']
42 | Source: test
43 | Details: test
44 | ##teamcity[testFailed name='fingerprint1' message='Severity Low' details='test']
45 | ##teamcity[testFinished name='fingerprint1']
46 | ##teamcity[testSuiteFinished name='some test']
47 | )
48 | expect(output).to eq(expected)
49 | end
50 | end
51 | end
52 | end
--------------------------------------------------------------------------------
/spec/support/aruba.rb:
--------------------------------------------------------------------------------
1 | require 'aruba/rspec'
2 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/README.md:
--------------------------------------------------------------------------------
1 | ## bundler-audit spec tests
2 |
3 | ### Overview of bundler-audit
4 |
5 | [bundler-audit](https://github.com/rubysec/bundler-audit)
6 |
7 | Scans a project's vulnerable versions of gems in the `Gemfile.lock` file and checks for gem sources without TLS.
8 |
9 | The names/versions are compared against the [ruby-advisory-db ](https://github.com/rubysec/ruby-advisory-db).
10 |
11 | To install bundler-audit:
12 | ```
13 | gem install bundler-audit
14 | ```
15 |
16 | The simplest way to run it from the command line is to `cd` to the folder with the `Gemfile.lock` file and call:
17 | ```
18 | bundle-audit check
19 | ```
20 |
21 | In Glue, `bundler-audit` is called with the following argument:
22 | ```
23 | bundle-audit check
24 | ```
25 |
26 | Some other command line options when running bundler-audit locally:
27 | * `--update` - Updates the ruby-advisory-db;
28 | * `--ignore [ADVISORY-ID]` - Ignores specific advisories.
29 |
30 | See [bundler-audit documentation](https://www.rubydoc.info/gems/bundler-audit/frames) for more info.
31 |
32 | ### The spec tests
33 |
34 | The specs do not call the bundler-audit tool because this would be too slow (~1 sec per spec test).
35 | Instead the specs rely on stubbing Glue's `runsystem` method (which calls CLI commands).
36 |
37 | In the specs, the return value of `runsystem` is always a canned response.
38 | Either it will be a generic, minimal response, or it will be a snapshot of an actual bundler-audit report.
39 |
40 | The actual reports were generated via the script `generate_reports.sh`.
41 | The targets of the spec tests were set up in a minimal way to produce non-trivial output.
42 | This required a `Gemfile.lock` file per target.
43 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/generate_reports.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Runs bundle-audit on the contents of the 'targets' dir,
3 | # storing the output in 'report.txt' within each target folder.
4 | # Include a 'SKIP.txt' file next to 'package.json' if you don't want snyk to run on that target.
5 |
6 | set -e
7 |
8 | run_bundleaudit_recurs ()
9 | {
10 | if [ -f "Gemfile.lock" ] && [ ! -f "SKIP.txt" ]; then
11 | bundle-audit check > report.txt
12 | fi
13 |
14 | for SUBTARGET in *
15 | do
16 | if [ -d ${SUBTARGET} ]; then
17 | cd ${SUBTARGET}
18 | run_bundleaudit_recurs
19 | cd ..
20 | fi
21 | done
22 | }
23 |
24 | DIR=`dirname $0`
25 | cd "${DIR}/targets/"
26 | run_bundleaudit_recurs
27 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/targets/finding_1/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | kafo (0.3.1)
5 |
6 | PLATFORMS
7 | ruby
8 |
9 | RUBY VERSION
10 | ruby 2.3.3
11 |
12 | BUNDLED WITH
13 | 1.14.6
14 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/targets/finding_1/report.txt:
--------------------------------------------------------------------------------
1 | Name: kafo
2 | Version: 0.3.1
3 | Advisory: CVE-2014-0135
4 | Criticality: Low
5 | URL: http://osvdb.org/show/osvdb/106826
6 | Title: Kafo default_values.yaml Insecure Permissions Local Information Disclosure
7 | Solution: upgrade to ~> 0.3.17, >= 0.5.2
8 |
9 | Vulnerabilities found!
10 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/targets/finding_2/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | http (0.7.3)
5 |
6 | PLATFORMS
7 | ruby
8 |
9 | RUBY VERSION
10 | ruby 2.3.3
11 |
12 | BUNDLED WITH
13 | 1.14.6
14 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/targets/finding_2/report.txt:
--------------------------------------------------------------------------------
1 | Name: http
2 | Version: 0.7.1
3 | Advisory: CVE-2015-1828
4 | Criticality: Medium
5 | URL: https://groups.google.com/forum/#!topic/httprb/jkb4oxwZjkU
6 | Title: HTTPS MitM vulnerability in http.rb
7 | Solution: upgrade to >= 0.7.3, ~> 0.6.4
8 |
9 | Vulnerabilities found!
10 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/targets/finding_2_unknown/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | nokogiri (1.8.2)
5 |
6 | PLATFORMS
7 | ruby
8 |
9 | RUBY VERSION
10 | ruby 2.3.3
11 |
12 | BUNDLED WITH
13 | 1.14.6
14 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/targets/finding_2_unknown/report.txt:
--------------------------------------------------------------------------------
1 | Name: nokogiri
2 | Version: 1.8.2
3 | Advisory: CVE-2018-8048
4 | Criticality: Unknown
5 | URL: https://github.com/sparklemotion/nokogiri/pull/1746
6 | Title: Revert libxml2 behavior in Nokogiri gem that could cause XSS
7 | Solution: upgrade to >= 1.8.3
8 |
9 | Vulnerabilities found!
10 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/targets/finding_3/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | curl
5 |
6 | PLATFORMS
7 | ruby
8 |
9 | RUBY VERSION
10 | ruby 2.3.3
11 |
12 | BUNDLED WITH
13 | 1.14.6
14 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/targets/finding_3/report.txt:
--------------------------------------------------------------------------------
1 | Name: curl
2 | Version:
3 | Advisory: CVE-2013-2617
4 | Criticality: High
5 | URL: http://osvdb.org/show/osvdb/91230
6 | Title: Curl Gem for Ruby URI Handling Arbitrary Command Injection
7 | Solution: remove or disable this gem until a patch is available!
8 |
9 | Vulnerabilities found!
10 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/targets/no_findings/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | nokogiri (1.8.4)
5 |
6 | PLATFORMS
7 | ruby
8 |
9 | RUBY VERSION
10 | ruby 2.3.3
11 |
12 | BUNDLED WITH
13 | 1.14.6
14 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/targets/no_findings/report.txt:
--------------------------------------------------------------------------------
1 | No vulnerabilities found
2 |
--------------------------------------------------------------------------------
/spec/tasks/bundle-audit/targets/no_findings_no_gemfile_lock/example.txt:
--------------------------------------------------------------------------------
1 | Empty
2 |
--------------------------------------------------------------------------------
/spec/tasks/dynamic/targets/dummy/invalid_report.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test",
3 | "items": [
4 | {
5 | "description": "desc",
6 | "detail": "detail",
7 | "source": "source",
8 | "severity": "high",
9 | "fingerprint": "fingerprint"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/spec/tasks/dynamic/targets/dummy/invalid_schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "task_name": "dummy",
3 | "a_name": "name",
4 | "mappings": [
5 | {
6 | "key": "issues",
7 | "properties": {
8 | "description": "description",
9 | "detail": "detail",
10 | "source": "source",
11 | "severity": "severity",
12 | "fingerprint": "fingerprint"
13 | }
14 | }
15 | ]
16 | }
--------------------------------------------------------------------------------
/spec/tasks/dynamic/targets/dummy/mapping.json:
--------------------------------------------------------------------------------
1 | {
2 | "task_name": "dummy",
3 | "app_name": "name",
4 | "mappings": [
5 | {
6 | "key": "issues",
7 | "properties": {
8 | "description": "description",
9 | "detail": "detail",
10 | "source": "source",
11 | "severity": "severity",
12 | "fingerprint": "fingerprint"
13 | }
14 | }
15 | ]
16 | }
--------------------------------------------------------------------------------
/spec/tasks/dynamic/targets/dummy/report.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test",
3 | "issues": [
4 | {
5 | "description": "desc",
6 | "detail": "detail",
7 | "source": "source",
8 | "severity": "high",
9 | "fingerprint": "fingerprint"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/spec/tasks/dynamic/targets/tools_samples/zaproxy.json:
--------------------------------------------------------------------------------
1 | {
2 | "@name": "http://api:9999",
3 | "alerts": [
4 | {
5 | "description": "Base64 encoded data was disclosed by the application/web server
",
6 | "source": "URI: http://api:9999/ Method: POST",
7 | "detail": "Base64 Disclosure \n Evidence: DxyPP_YQ6qdWluCCz93Xs1CeJPvg \n Solution: Manually confirm that the Base64 data does not leak sensitive information, and that the data cannot be aggregated/used to exploit other vulnerabilities.
\n Other info: \\x000f\\x001c�?�\\x0010�V���Re\\x000c��9�7C\\x001b \\x0011Ű�\\x0004?a\tP�\\x0017���\u007f@]ۺ�\\x0005\\x0007��7\\x0006\\x000e���\\x0019�,�D[�n���_)��X�w��&^���3l����'�~h?��O\\x0011�H����΅\\x001c��ޕ�Bi|��>\\x0007\u007f:�-QY(\\x0016
��A|��9��E��%&\\x0011�]�j\\x001c!��o�\\x000e�\\x0014�L�\\x0000j:\\x0008V:��]L����փԫ�o$\\x0003����KՆn��5�T_P�ͭ�w����l$\\x000fU���+vq\\x001e\\x001b& P\n7+���u9�\\x001e��tN����+\\x0003�X�R$\\,��{5\t�O
\n Reference: https://www.owasp.org/index.php/Top_10_2013-A6-Sensitive_Data_Exposure
http://projects.webappsec.org/w/page/13246936/Information%20Leakage
",
8 | "severity": "Informational",
9 | "fingerprint": "10094_http://api:9999/_POST"
10 | }
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/spec/tasks/owasp-dep-check/generate_reports.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Runs dependency-check.sh on the contents of the 'targets' dir,
3 | # storing the output in 'dependency-check-report.xml' within each target root folder.
4 | # Include a 'SKIP.txt' in the root folder if you don't want dependency-check to run on that target.
5 |
6 | set -e
7 |
8 | DEP_CHECK_PATH=~/dependency-check/bin/dependency-check.sh
9 |
10 | function usage () {
11 | local name=$(basename "$0")
12 |
13 | echo >&2 "Usage: ${name} [-p PATH_TO_DEP_CHECK]"
14 | echo >&2 "Options:"
15 | echo >&2 " -p Path to dependency-check.sh executable"
16 | exit 1
17 | }
18 |
19 | run_dependency_check () {
20 | FILES=$(find -type f -name "*.jar")
21 | if [ ! -z ${FILES} ] && [ ! -f "SKIP.txt" ]; then
22 | ${DEP_CHECK_PATH} --project Glue -s . -f XML
23 | fi
24 | }
25 |
26 |
27 | while getopts ":p:h" opt; do
28 | case $opt in
29 | p)
30 | DEP_CHECK_PATH=${OPTARG}
31 | ;;
32 | h)
33 | usage
34 | ;;
35 | \?)
36 | echo >&2 "Invalid option: -${OPTARG}"
37 | usage
38 | ;;
39 | esac
40 | done
41 |
42 | echo >&2 "Using dependency-check path: ${DEP_CHECK_PATH}"
43 |
44 | DIR=`dirname $0`
45 | cd "${DIR}/targets/"
46 |
47 | # dependency-check.sh will generate a report in each root directory
48 | # for all dependencies found in its sub directories
49 | for SUBTARGET in *
50 | do
51 | if [ -d ${SUBTARGET} ]; then
52 | cd ${SUBTARGET}
53 | run_dependency_check
54 | cd ..
55 | fi
56 | done
57 |
--------------------------------------------------------------------------------
/spec/tasks/owasp-dep-check/targets/findings_1/kibana-2.2.335.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/owasp-dep-check/targets/findings_1/kibana-2.2.335.jar
--------------------------------------------------------------------------------
/spec/tasks/owasp-dep-check/targets/findings_1_nested/findings_1/jackson-databind-2.1.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/owasp-dep-check/targets/findings_1_nested/findings_1/jackson-databind-2.1.4.jar
--------------------------------------------------------------------------------
/spec/tasks/owasp-dep-check/targets/findings_2/limesurvey-rc-0.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/owasp-dep-check/targets/findings_2/limesurvey-rc-0.6.jar
--------------------------------------------------------------------------------
/spec/tasks/owasp-dep-check/targets/no_findings/jinjava-2.4.15.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/owasp-dep-check/targets/no_findings/jinjava-2.4.15.jar
--------------------------------------------------------------------------------
/spec/tasks/retirejs/README.md:
--------------------------------------------------------------------------------
1 | ## RetireJS spec tests
2 |
3 | ### Overview of RetireJS
4 |
5 | [Retire](https://github.com/retirejs/retire.js/)
6 | scans a project's Node.js package dependencies
7 | (similar to [Snyk](https://snyk.io/))
8 | and also scans the content of files looking for dependencies
9 | on JS libraries.
10 |
11 | The names/versions are compared against
12 | [repositories](https://github.com/RetireJS/retire.js/tree/master/repository)
13 | of known npm and JS library vulnerabilities.
14 |
15 | To install RetireJS:
16 | ```
17 | npm install -g retire
18 | ```
19 |
20 | The simplest way to run it from the command line
21 | is to `cd` to the root folder of your project and call:
22 | ```
23 | retire
24 | ```
25 |
26 | In Glue, `retire` is called with the following arguments:
27 | ```
28 | retire -c --outputpath /dev/stdout --outputformat json --path
29 | ```
30 | (By default, `retire` outputs to `STDERR`. Glue expects results to be
31 | output to `STDOUT`, hence the need for the `--outputpath /dev/stdout`.)
32 |
33 | ### The spec tests
34 |
35 | The specs do not call the RetireJS API because this would be too
36 | slow (about 1 sec per spec test). Instead the specs rely on stubbing
37 | Glue's `runsystem` method (which calls CLI commands).
38 |
39 | In the specs, the return value of `runsystem` is always a canned response.
40 | Either it will be a generic, minimal response, or it will be a snapshot of an
41 | actual RetireJS report (generated using
42 | [this commit](https://github.com/RetireJS/retire.js/commit/75d728139eda79aa825d1fe17ad2af6d48120146)
43 | of RetireJS.)
44 |
45 | The actual reports were generated via the script 'generate_reports.sh'.
46 | The targets of the spec tests were set up in a minimal way to produce
47 | non-trivial output.
48 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/generate_reports.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Runs 'retire' on the contents of the 'test_targets' dir,
3 | # storing the output in 'report.json' within each target folder.
4 | #
5 | # After running it, transfer the results to the 'targets' dir.
6 | #
7 | # Include a 'SKIP.txt' file next to 'package.json'
8 | # if you don't want retire to run on that target.
9 | #
10 | # This uses sed to find-replace the absolute file paths
11 | # with truncated relative versions.
12 | # (Some vulnerabilities report an abs file path.
13 | # Glue attempts to parse this to a relative path, using 'relative_path'.
14 | # But this will not work correctly for the canned reports of
15 | # the spec tests, since the abs file path in the canned report
16 | # won't necessarily match the abs file path on the user's machine.
17 | # To get around this for the spec tests, we just convert the
18 | # reported abs file paths to relative file paths.)
19 | #
20 | # Note with sed: on Mac (but not on Linux) the -i (inplace editing)
21 | # will always create a backup, with extension equal to the first arg
22 | # after -i.
23 |
24 | run_retire_recurs ()
25 | {
26 | if [ -f package.json ] && [ ! -f SKIP.txt ]; then
27 | # pwd
28 | retire -c --outputformat json --outputpath report.json
29 | sed -i.bak -e "s;$ABS_DIR/;;g" report.json
30 | rm report.json.bak
31 | fi
32 |
33 | for SUBTARGET in *
34 | do
35 | if [ -d $SUBTARGET ] && [ $SUBTARGET != "node_modules" ]; then
36 | cd $SUBTARGET
37 | run_retire_recurs
38 | cd ..
39 | fi
40 | done
41 | }
42 |
43 | DIR=`dirname $0`
44 | # cd "$DIR/targets/"
45 | cd "$DIR/test_targets/"
46 | ABS_DIR="$(pwd)"
47 |
48 | run_retire_recurs
49 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_1/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_1/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_1_nested/finding_1/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_1_nested/finding_1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_1_nested/finding_1/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_2/node_modules/cookie-signature/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cookie-signature",
3 | "version": "1.0.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cookie-signature": "1.0.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_2/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"cookie-signature","version":"1.0.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/134"],"severity":"medium","identifiers":{"advisory":"Timing attack vulnerability"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_3/node_modules/pivottable/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pivottable",
3 | "version": "1.4.0"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_3/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "pivottable": "1.4.0"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_3/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"pivottable","version":"1.4.0","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/139"],"severity":"high","identifiers":{"advisory":"XSS"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_f1/file_1.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI Tooltip 1.9.2
3 | */
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_f1/package.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/retirejs/targets/finding_f1/package.json
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_f1/report.json:
--------------------------------------------------------------------------------
1 | [{"file":"finding_f1/file_1.js","results":[{"version":"1.9.2","component":"jquery-ui-tooltip","detection":"filecontent","vulnerabilities":[{"info":["http://bugs.jqueryui.com/ticket/8859"],"severity":"high","identifiers":{"bug":"8859","summary":"Autocomplete cross-site scripting vulnerability"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_f1_nested/js_files/file_1.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI Tooltip 1.9.2
3 | */
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_f1_nested/package.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/retirejs/targets/finding_f1_nested/package.json
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/finding_f1_nested/report.json:
--------------------------------------------------------------------------------
1 | [{"file":"finding_f1_nested/js_files/file_1.js","results":[{"version":"1.9.2","component":"jquery-ui-tooltip","detection":"filecontent","vulnerabilities":[{"info":["http://bugs.jqueryui.com/ticket/8859"],"severity":"high","identifiers":{"bug":"8859","summary":"Autocomplete cross-site scripting vulnerability"}}]}]}]
2 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1-2/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3",
4 | "dependencies": {
5 | "cookie-signature": "1.0.3"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1-2/node_modules/cookie-signature/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cookie-signature",
3 | "version": "1.0.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1-2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1-2/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]},{"results":[{"component":"cookie-signature","version":"1.0.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/134"],"severity":"medium","identifiers":{"advisory":"Timing attack vulnerability"}}]}]},{"results":[{"component":"cookie-signature","version":"1.0.3","parent":{"component":"cli","version":"0.11.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]},"level":2,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/134"],"severity":"medium","identifiers":{"advisory":"Timing attack vulnerability"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123/node_modules/cookie-signature/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cookie-signature",
3 | "version": "1.0.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123/node_modules/pivottable/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pivottable",
3 | "version": "1.4.0"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cli": "0.11.3",
5 | "cookie-signature": "1.0.3",
6 | "pivottable": "1.4.0"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]},{"results":[{"component":"cookie-signature","version":"1.0.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/134"],"severity":"medium","identifiers":{"advisory":"Timing attack vulnerability"}}]}]},{"results":[{"component":"pivottable","version":"1.4.0","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/139"],"severity":"high","identifiers":{"advisory":"XSS"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123_2-1_3-1/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123_2-1_3-1/node_modules/cookie-signature/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cookie-signature",
3 | "version": "1.0.3",
4 | "dependencies": {
5 | "cli": "0.11.3"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123_2-1_3-1/node_modules/pivottable/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pivottable",
3 | "version": "1.4.0",
4 | "dependencies": {
5 | "cli": "0.11.3"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123_2-1_3-1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cli": "0.11.3",
5 | "cookie-signature": "1.0.3",
6 | "pivottable": "1.4.0"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123_2-1_3-1/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]},{"results":[{"component":"cookie-signature","version":"1.0.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/134"],"severity":"medium","identifiers":{"advisory":"Timing attack vulnerability"}}]}]},{"results":[{"component":"pivottable","version":"1.4.0","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/139"],"severity":"high","identifiers":{"advisory":"XSS"}}]}]},{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"pivottable","version":"1.4.0","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/139"],"severity":"high","identifiers":{"advisory":"XSS"}}]},"level":2,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]},{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"cookie-signature","version":"1.0.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/134"],"severity":"medium","identifiers":{"advisory":"Timing attack vulnerability"}}]},"level":2,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123_2-1_3-12/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123_2-1_3-12/node_modules/cookie-signature/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cookie-signature",
3 | "version": "1.0.3",
4 | "dependencies": {
5 | "cli": "0.11.3"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123_2-1_3-12/node_modules/pivottable/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pivottable",
3 | "version": "1.4.0",
4 | "dependencies": {
5 | "cli": "0.11.3",
6 | "cookie-signature": "1.0.3"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123_2-1_3-12/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cli": "0.11.3",
5 | "cookie-signature": "1.0.3",
6 | "pivottable": "1.4.0"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_123_2-1_3-12/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]},{"results":[{"component":"cookie-signature","version":"1.0.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/134"],"severity":"medium","identifiers":{"advisory":"Timing attack vulnerability"}}]}]},{"results":[{"component":"pivottable","version":"1.4.0","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/139"],"severity":"high","identifiers":{"advisory":"XSS"}}]}]},{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"pivottable","version":"1.4.0","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/139"],"severity":"high","identifiers":{"advisory":"XSS"}}]},"level":2,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]},{"results":[{"component":"cookie-signature","version":"1.0.3","parent":{"component":"pivottable","version":"1.4.0","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/139"],"severity":"high","identifiers":{"advisory":"XSS"}}]},"level":2,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/134"],"severity":"medium","identifiers":{"advisory":"Timing attack vulnerability"}}]}]},{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"cookie-signature","version":"1.0.3","parent":{"component":"pivottable","version":"1.4.0","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/139"],"severity":"high","identifiers":{"advisory":"XSS"}}]},"level":2,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/134"],"severity":"medium","identifiers":{"advisory":"Timing attack vulnerability"}}]},"level":3,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]},{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"cookie-signature","version":"1.0.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/134"],"severity":"medium","identifiers":{"advisory":"Timing attack vulnerability"}}]},"level":2,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1_2_3/finding_1/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1_2_3/finding_1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1_2_3/finding_1/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1_2_3/finding_2/node_modules/cookie-signature/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cookie-signature",
3 | "version": "1.0.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1_2_3/finding_2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cookie-signature": "1.0.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1_2_3/finding_2/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"cookie-signature","version":"1.0.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/134"],"severity":"medium","identifiers":{"advisory":"Timing attack vulnerability"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1_2_3/finding_3/node_modules/pivottable/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pivottable",
3 | "version": "1.4.0"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1_2_3/finding_3/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "pivottable": "1.4.0"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1_2_3/finding_3/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"pivottable","version":"1.4.0","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/139"],"severity":"high","identifiers":{"advisory":"XSS"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1f1/file_1.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI Tooltip 1.9.2
3 | */
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1f1/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1f1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_1f1/report.json:
--------------------------------------------------------------------------------
1 | [{"file":"finding_1f1/file_1.js","results":[{"version":"1.9.2","component":"jquery-ui-tooltip","detection":"filecontent","vulnerabilities":[{"info":["http://bugs.jqueryui.com/ticket/8859"],"severity":"high","identifiers":{"bug":"8859","summary":"Autocomplete cross-site scripting vulnerability"}}]}]},{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]}]
2 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_4/node_modules/uglify-js/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "uglify-js",
3 | "version": "2.4.0"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_4/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "uglify-js": "2.4.0"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_4/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"uglify-js","version":"2.4.0","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://github.com/mishoo/UglifyJS2/issues/751","https://github.com/tmcw/mdast-uglify-bug","https://nodesecurity.io/advisories/39"],"severity":"high"},{"info":["https://nodesecurity.io/advisories/48"],"severity":"medium"}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_5f5/file_5.js:
--------------------------------------------------------------------------------
1 | /* jQuery v1.8.0 */
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_5f5/node_modules/jquery/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery",
3 | "version": "1.8.0"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_5f5/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "jquery": "1.8.0"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_5f5/report.json:
--------------------------------------------------------------------------------
1 | [{"file":"findings_5f5/file_5.js","results":[{"version":"1.8.0","component":"jquery","detection":"filecontent","vulnerabilities":[{"info":["http://bugs.jquery.com/ticket/11290","http://research.insecurelabs.org/jquery/test/"],"severity":"medium","identifiers":{"bug":"11290","summary":"Selector interpreted as HTML"}},{"info":["https://github.com/jquery/jquery/issues/2432","http://blog.jquery.com/2016/01/08/jquery-2-2-and-1-12-released/"],"severity":"medium","identifiers":{"issue":"2432","summary":"3rd party CORS request may execute"}}]}]},{"results":[{"component":"jquery","version":"1.8.0","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/330"],"severity":"medium","identifiers":{"summary":"jquery_exceeding-stack-call-limit-dos"}},{"info":["https://nodesecurity.io/advisories/328"],"severity":"high","identifiers":{"summary":"jquery_xss"}},{"info":["https://nodesecurity.io/advisories/329"],"severity":"high","identifiers":{"summary":"jquery_xss-via-improper-selector-detection"}}]}]}]
2 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f12/file_12.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI Tooltip 1.9.2
3 | * sessvars ver 1.00
4 | */
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f12/package.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/retirejs/targets/findings_f12/package.json
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f12/report.json:
--------------------------------------------------------------------------------
1 | [{"file":"findings_f12/file_12.js","results":[{"version":"1.9.2","component":"jquery-ui-tooltip","detection":"filecontent","vulnerabilities":[{"info":["http://bugs.jqueryui.com/ticket/8859"],"severity":"high","identifiers":{"bug":"8859","summary":"Autocomplete cross-site scripting vulnerability"}}]},{"version":"1.00","component":"sessvars","detection":"filecontent","vulnerabilities":[{"info":["http://www.thomasfrank.se/sessionvars.html"],"severity":"low","identifiers":{"summary":"Unsanitized data passed to eval()"}}]}]}]
2 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f1_components_wo_vulnerabilities/file_1.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI - v1.9.0 - 2012-10-05
3 | * */
4 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f1_components_wo_vulnerabilities/node_modules/example.txt:
--------------------------------------------------------------------------------
1 | // No findings
2 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f1_components_wo_vulnerabilities/package.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/retirejs/targets/findings_f1_components_wo_vulnerabilities/package.json
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f1_components_wo_vulnerabilities/report.json:
--------------------------------------------------------------------------------
1 | [{"file":"findings_f1_components_wo_vulnerabilities/file_1.js","results":[{"version":"1.9.0","component":"jquery-ui-dialog","detection":"filecontent","vulnerabilities":[{"info":["http://bugs.jqueryui.com/ticket/6016","https://nvd.nist.gov/vuln/detail/CVE-2010-5312"],"severity":"medium","identifiers":{"CVE":["CVE-2010-5312"],"bug":"6016","summary":"Title cross-site scripting vulnerability"}},{"info":["https://github.com/jquery/api.jqueryui.com/issues/281","https://nvd.nist.gov/vuln/detail/CVE-2016-7103","https://snyk.io/vuln/npm:jquery-ui:20160721"],"severity":"high","identifiers":{"CVE":["CVE-2016-7103"],"bug":"281","summary":"XSS Vulnerability on closeText option"}}]},{"version":"1.9.0","component":"jquery-ui-autocomplete","detection":"filecontent"},{"version":"1.9.0","component":"jquery-ui-tooltip","detection":"filecontent"}]}]
2 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f1f1/file_1.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI Tooltip 1.9.2
3 | */
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f1f1/file_2.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI Tooltip 1.9.2
3 | */
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f1f1/package.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/retirejs/targets/findings_f1f1/package.json
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f1f1/report.json:
--------------------------------------------------------------------------------
1 | [{"file":"findings_f1f1/file_1.js","results":[{"version":"1.9.2","component":"jquery-ui-tooltip","detection":"filecontent","vulnerabilities":[{"info":["http://bugs.jqueryui.com/ticket/8859"],"severity":"high","identifiers":{"bug":"8859","summary":"Autocomplete cross-site scripting vulnerability"}}]}]},{"file":"findings_f1f1/file_2.js","results":[{"version":"1.9.2","component":"jquery-ui-tooltip","detection":"filecontent","vulnerabilities":[{"info":["http://bugs.jqueryui.com/ticket/8859"],"severity":"high","identifiers":{"bug":"8859","summary":"Autocomplete cross-site scripting vulnerability"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f1f2/file_1.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI Tooltip 1.9.2
3 | */
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f1f2/file_2.js:
--------------------------------------------------------------------------------
1 | /*
2 | * sessvars ver 1.00
3 | */
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f1f2/package.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/retirejs/targets/findings_f1f2/package.json
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f1f2/report.json:
--------------------------------------------------------------------------------
1 | [{"file":"findings_f1f2/file_1.js","results":[{"version":"1.9.2","component":"jquery-ui-tooltip","detection":"filecontent","vulnerabilities":[{"info":["http://bugs.jqueryui.com/ticket/8859"],"severity":"high","identifiers":{"bug":"8859","summary":"Autocomplete cross-site scripting vulnerability"}}]}]},{"file":"findings_f1f2/file_2.js","results":[{"version":"1.00","component":"sessvars","detection":"filecontent","vulnerabilities":[{"info":["http://www.thomasfrank.se/sessionvars.html"],"severity":"low","identifiers":{"summary":"Unsanitized data passed to eval()"}}]}]}]
2 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f3/file_3.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery UI Dialog 1.8.9
3 | */
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f3/package.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/retirejs/targets/findings_f3/package.json
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/findings_f3/report.json:
--------------------------------------------------------------------------------
1 | [{"file":"findings_f3/file_3.js","results":[{"version":"1.8.9","component":"jquery-ui-dialog","detection":"filecontent","vulnerabilities":[{"info":["http://bugs.jqueryui.com/ticket/6016"],"severity":"medium","identifiers":{"bug":"6016","summary":"Title cross-site scripting vulnerability"}},{"info":["https://github.com/jquery/api.jqueryui.com/issues/281","https://snyk.io/vuln/npm:jquery-ui:20160721"],"severity":"high","identifiers":{"bug":"281","summary":"XSS Vulnerability on closeText option"}}]}]}]
2 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/malformed/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/malformed/report.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/malformed_nested/finding_1/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/malformed_nested/finding_1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/malformed_nested/finding_1/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/malformed_nested/malformed/package.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/retirejs/targets/malformed_nested/malformed/package.json
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/malformed_nested/malformed/report.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/malformed_nested/zz_finding_1/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/malformed_nested/zz_finding_1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/malformed_nested/zz_finding_1/report.json:
--------------------------------------------------------------------------------
1 | [{"results":[{"component":"cli","version":"0.11.3","parent":{"component":"retirejs-test","version":""},"level":1,"vulnerabilities":[{"info":["https://nodesecurity.io/advisories/95"],"severity":"low","identifiers":{"advisory":"Arbitrary File Write"}}]}]}]
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/no_findings/node_modules/example.txt:
--------------------------------------------------------------------------------
1 | // No findings
2 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/no_findings/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "retirejs-test",
3 | "dependencies": {
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/no_findings/report.json:
--------------------------------------------------------------------------------
1 | []
--------------------------------------------------------------------------------
/spec/tasks/retirejs/targets/no_findings_no_package_json/example.txt:
--------------------------------------------------------------------------------
1 | // No findings
2 |
--------------------------------------------------------------------------------
/spec/tasks/retirejs/test_targets/README.md:
--------------------------------------------------------------------------------
1 | This is a placeholder directory for generating reports for new
2 | test targets.
3 |
--------------------------------------------------------------------------------
/spec/tasks/sfl/malformed_patterns_file.json:
--------------------------------------------------------------------------------
1 | // A non-JSON file
2 |
--------------------------------------------------------------------------------
/spec/tasks/sfl/sfl_patterns_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | require 'glue/tasks'
4 | require 'glue/tasks/sfl'
5 |
6 | describe "For Glue::SFL.patterns:" do
7 | before(:all) do
8 | @example_pattern = {
9 | "part" => "filename",
10 | "type" => "regex",
11 | "pattern" => "\\A\\.?(bash|zsh)rc\\z",
12 | "caption" => "Shell configuration file",
13 | "description" => "Shell configuration files might contain..."
14 | }
15 |
16 | @example_keys = @example_pattern.keys
17 | @valid_filepath_parts = %w[filename extension path]
18 | @valid_match_types = %w[match regex]
19 | end
20 |
21 | Glue::SFL.patterns.each do |pattern|
22 | context "the pattern #{pattern}" do
23 | it "has valid keys" do
24 | expect(pattern.keys).to eq(@example_keys)
25 | end
26 |
27 | it "has String values for all keys (or 'nil' for 'description')" do
28 | is_valid = pattern.all? do |key, value|
29 | value.is_a?(String) || (key == 'description' && value.nil?)
30 | end
31 |
32 | expect(is_valid).to eq(true)
33 | end
34 |
35 | it "has a valid pattern['part']" do
36 | expect(pattern['part']).to be_included_in(*@valid_filepath_parts)
37 | end
38 |
39 | it "has a valid pattern['type']" do
40 | expect(pattern['type']).to be_included_in(*@valid_match_types)
41 | end
42 | end
43 | end
44 |
45 | def be_included_in(first_value, *rest)
46 | # https://github.com/rspec/rspec-expectations/issues/760
47 | rest.inject(eq(first_value)) do |matcher, value|
48 | matcher.or eq(value)
49 | end
50 | end
51 | end
52 |
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/no_findings/example.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/no_findings/example.txt
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/no_findings_password_subdir/password/example.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/no_findings_password_subdir/password/example.txt
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/one_finding_extension_match/test.pkcs12:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/one_finding_extension_match/test.pkcs12
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/one_finding_extension_regex/test.keypair:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/one_finding_extension_regex/test.keypair
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/one_finding_filename_match/secret_token.rb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/one_finding_filename_match/secret_token.rb
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/one_finding_filename_regex/.id_rsa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/one_finding_filename_regex/.id_rsa
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/one_finding_path_regex/purple/accounts.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/one_finding_path_regex/purple/accounts.xml
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/two_findings/.id_rsa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/two_findings/.id_rsa
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/two_findings/example.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/two_findings/example.txt
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/two_findings/secret_token.rb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/two_findings/secret_token.rb
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/two_findings_difft_dirs/dir1/secret_token.rb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/two_findings_difft_dirs/dir1/secret_token.rb
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/two_findings_difft_dirs/dir2/secret_token.rb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/two_findings_difft_dirs/dir2/secret_token.rb
--------------------------------------------------------------------------------
/spec/tasks/sfl/targets/two_findings_one_file/password_backup.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/sfl/targets/two_findings_one_file/password_backup.txt
--------------------------------------------------------------------------------
/spec/tasks/snyk/README.md:
--------------------------------------------------------------------------------
1 | ## Snyk spec tests
2 |
3 | ### Overview of Snyk
4 |
5 | [Snyk](https://snyk.io/) scans a project's Node.js package dependencies,
6 | comparing package version numbers against
7 | [Snyk's database of known vulnerabilities](https://snyk.io/vuln).
8 |
9 | Snyk requires sign-up and an authentication token before it can be run.
10 | See their website for details. It can be run on open source projects for
11 | free, up to a set number of times per billing cycle.
12 |
13 | Once installed, to run Snyk locally from within a project's root folder, run:
14 | ```
15 | snyk test
16 | ```
17 |
18 | Snyk can also scan Ruby, Java, Scala, and Python dependencies.
19 | By default, if Snyk does not find a 'yarn.lock' or a 'package.json' file,
20 | then it will look for a 'Gemfile'. If none is found, it will look for a
21 | 'pom.xml'. And so on for the different languages. When it finds a
22 | package-management file that it recognizes, it stops searching further.
23 |
24 | In Glue, Snyk is only called on directories that have a 'package.json' file.
25 | Therefore Glue will only return Snyk results for Node.js package vulnerabilities.
26 |
27 | To replicate this behavior when calling Snyk directly from the command line from
28 | within a given project:
29 | ```
30 | snyk test --file=package.json
31 | ```
32 |
33 | Some other command line options when running Snyk locally:
34 | * `--json` - Outputs in json, with more detailed information than the default output.
35 | * `--dev` - Include dev dependencies. By default (and in Glue) dev dependencies are excluded.
36 |
37 | See [Snyk's CLI documentation](https://snyk.io/docs/using-snyk) for more info.
38 |
39 | ### The spec tests
40 |
41 | The specs do not call the actual Snyk API, for two reasons. First, because it would be too slow.
42 | Second (and more importantly), because we would quickly breach the limit for the
43 | number of times we can run Snyk for free per billing cycle.
44 |
45 | Instead, the specs rely on stubbing Glue's 'runsystem' method (which is responsible
46 | for calling CLI commands).
47 |
48 | In the specs, the return value of 'runsystem' is always a canned response.
49 | Either it will be a generic, minimal response, or it will be a snapshot of an
50 | actual Snyk report.
51 |
52 | The actual reports were generated via the script 'generate_reports.sh'.
53 | The targets of the spec tests were set up in a minimal way to produce non-trivial output.
54 | This required a 'package.json' file, a 'node_modules' folder with the package sub-folders,
55 | and a 'package.json' file within the package sub-folders. The 'package.json' files only needed
56 | the "dependencies" list. All extraneous information from the 'package.json' files was
57 | deleted, and the code for the packages themselves was not included.
58 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/generate_reports.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Runs Snyk on the contents of the 'targets' dir,
3 | # storing the output in 'report.json' within each target folder.
4 | # Filters the output through grep to delete lines with personal info.
5 | #
6 | # Include a 'SKIP.txt' file next to 'package.json' if you don't want snyk to run on that target.
7 |
8 | run_snyk_recurs ()
9 | {
10 | if [ -f package.json ] && [ ! -f SKIP.txt ]; then
11 | # pwd
12 | snyk test --json | grep -v "\"org\"\|\"__filename\"" > report.json
13 | fi
14 |
15 | for SUBTARGET in *
16 | do
17 | if [ -d $SUBTARGET ] && [ $SUBTARGET != "node_modules" ]; then
18 | cd $SUBTARGET
19 | run_snyk_recurs
20 | cd ..
21 | fi
22 | done
23 | }
24 |
25 | DIR=`dirname $0`
26 | cd "$DIR/targets/"
27 | run_snyk_recurs
28 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/finding_1/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/finding_1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "snyk-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/finding_1_nested/finding_1/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/finding_1_nested/finding_1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "snyk-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/finding_2/node_modules/cookie-signature/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cookie-signature",
3 | "version": "1.0.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/finding_2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "snyk-test",
3 | "dependencies": {
4 | "cookie-signature": "1.0.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/finding_2/report.json:
--------------------------------------------------------------------------------
1 | {
2 | "ok": false,
3 | "vulnerabilities": [
4 | {
5 | "title": "Non-Constant Time String Comparison",
6 | "credit": [
7 | ""
8 | ],
9 | "creationTime": "2016-08-04T03:44:13.904Z",
10 | "modificationTime": "2016-08-04T03:44:13.904Z",
11 | "publicationTime": "2016-08-29T00:00:00.000Z",
12 | "disclosureTime": "2014-01-28T00:00:00.000Z",
13 | "description": "## Overview\n['cookie-signature'](https://www.npmjs.com/package/cookie-signature) is a library for signing cookies.\n\nVersions before `1.0.4` of the library use the built-in string comparison mechanism, `===`, and not a time constant string comparison. As a result, the comparison will fail faster when the first characters in the token are incorrect. \nAn attacker can use this difference to perform a timing attack, essentially allowing them to guess the secret one character at a time.\n\n## Details\nYou can read more about timing attacks in Node.js on the Snyk blog: https://snyk.io/blog/node-js-timing-attack-ccc-ctf/\n\n## Remediation\nUpgrade to `1.0.4` or greater.\n\n## References\n- https://github.com/tj/node-cookie-signature/blob/master/History.md#104--2014-06-25\n- https://github.com/tj/node-cookie-signature/commit/39791081692e9e14aa62855369e1c7f80fbfd50e\n",
14 | "semver": {
15 | "vulnerable": "<=1.0.3",
16 | "unaffected": ">=1.0.4"
17 | },
18 | "CVSSv3": "CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N",
19 | "severity": "medium",
20 | "identifiers": {
21 | "CWE": [
22 | "CWE-208"
23 | ],
24 | "CVE": [],
25 | "NSP": 134,
26 | "ALTERNATIVE": [
27 | "SNYK-JS-COOKIESIGNATURE-10134"
28 | ]
29 | },
30 | "patches": [],
31 | "moduleName": "cookie-signature",
32 | "language": "js",
33 | "packageManager": "npm",
34 | "id": "npm:cookie-signature:20160804",
35 | "packageName": "cookie-signature",
36 | "cvssScore": 6.3,
37 | "alternativeIds": [
38 | "SNYK-JS-COOKIESIGNATURE-10134"
39 | ],
40 | "from": [
41 | "snyk-test@null",
42 | "cookie-signature@1.0.3"
43 | ],
44 | "upgradePath": [
45 | false,
46 | "cookie-signature@1.0.4"
47 | ],
48 | "version": "1.0.3",
49 | "name": "cookie-signature",
50 | "isUpgradable": true,
51 | "isPatchable": false,
52 | "parentDepType": "prod"
53 | }
54 | ],
55 | "dependencyCount": 1,
56 | "licensesPolicy": null,
57 | "isPrivate": true,
58 | "packageManager": "npm",
59 | "summary": "1 vulnerable dependency path",
60 | "filtered": {
61 | "ignore": [],
62 | "patch": []
63 | },
64 | "uniqueCount": 1
65 | }
66 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/finding_3/node_modules/pivottable/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pivottable",
3 | "version": "1.4.0"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/finding_3/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "snyk-test",
3 | "dependencies": {
4 | "pivottable": "1.4.0"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/finding_3/report.json:
--------------------------------------------------------------------------------
1 | {
2 | "ok": false,
3 | "vulnerabilities": [
4 | {
5 | "title": "Cross-site Scripting (XSS)",
6 | "credit": [
7 | "Todd Wolfson"
8 | ],
9 | "creationTime": "2016-08-17T15:13:32.564Z",
10 | "modificationTime": "2016-08-17T15:13:32.564Z",
11 | "publicationTime": "2016-08-17T15:13:32.564Z",
12 | "disclosureTime": "2016-08-17T15:13:32.564Z",
13 | "description": "## Overview\n[`PivotTable.js`](https://www.npmjs.com/package/pivottable) is a Javascript Pivot Table library with drag-and-drop functionality built on top of jQuery/jQueryUI.\n\nDue to a change from text to html functions in how JSON elements are rendered, a Cross-site scripting (XSS) vulnerability was introduced in version 1.4.0. This vulnerability remained in place until version 2.0.0.\n\nSource: _Node Security Project_\n\n## Remediation\nUpgrade to version 2.0.0 or later.\n\n## References\n- https://github.com/nicolaskruchten/pivottable/pull/401\n\n",
14 | "semver": {
15 | "vulnerable": ">=1.4.0 <2.0.0",
16 | "unaffected": ">=2.0.0"
17 | },
18 | "CVSSv3": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N",
19 | "severity": "high",
20 | "identifiers": {
21 | "CWE": [
22 | "CWE-80"
23 | ],
24 | "CVE": [],
25 | "NSP": 139,
26 | "ALTERNATIVE": [
27 | "SNYK-JS-PIVOTTABLE-10132"
28 | ]
29 | },
30 | "patches": [],
31 | "moduleName": "pivottable",
32 | "language": "js",
33 | "packageManager": "npm",
34 | "id": "npm:pivottable:20160817",
35 | "packageName": "pivottable",
36 | "cvssScore": 7.2,
37 | "alternativeIds": [
38 | "SNYK-JS-PIVOTTABLE-10132"
39 | ],
40 | "from": [
41 | "snyk-test@null",
42 | "pivottable@1.4.0"
43 | ],
44 | "upgradePath": [
45 | false,
46 | "pivottable@2.0.0"
47 | ],
48 | "version": "1.4.0",
49 | "name": "pivottable",
50 | "isUpgradable": true,
51 | "isPatchable": false,
52 | "parentDepType": "prod"
53 | }
54 | ],
55 | "dependencyCount": 1,
56 | "licensesPolicy": null,
57 | "isPrivate": true,
58 | "packageManager": "npm",
59 | "summary": "1 vulnerable dependency path",
60 | "filtered": {
61 | "ignore": [],
62 | "patch": []
63 | },
64 | "uniqueCount": 1
65 | }
66 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/findings_123_2-1_3-12/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/findings_123_2-1_3-12/node_modules/cookie-signature/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cookie-signature",
3 | "version": "1.0.3",
4 | "dependencies": {
5 | "cli": "0.11.3"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/findings_123_2-1_3-12/node_modules/pivottable/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pivottable",
3 | "version": "1.4.0",
4 | "dependencies": {
5 | "cli": "0.11.3",
6 | "cookie-signature": "1.0.3"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/findings_123_2-1_3-12/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "snyk-test",
3 | "dependencies": {
4 | "cli": "0.11.3",
5 | "cookie-signature": "1.0.3",
6 | "pivottable": "1.4.0"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/findings_1_2_3/finding_1/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/findings_1_2_3/finding_1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "snyk-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/findings_1_2_3/finding_2/node_modules/cookie-signature/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cookie-signature",
3 | "version": "1.0.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/findings_1_2_3/finding_2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "snyk-test",
3 | "dependencies": {
4 | "cookie-signature": "1.0.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/findings_1_2_3/finding_2/report.json:
--------------------------------------------------------------------------------
1 | {
2 | "ok": false,
3 | "vulnerabilities": [
4 | {
5 | "title": "Non-Constant Time String Comparison",
6 | "credit": [
7 | ""
8 | ],
9 | "creationTime": "2016-08-04T03:44:13.904Z",
10 | "modificationTime": "2016-08-04T03:44:13.904Z",
11 | "publicationTime": "2016-08-29T00:00:00.000Z",
12 | "disclosureTime": "2014-01-28T00:00:00.000Z",
13 | "description": "## Overview\n['cookie-signature'](https://www.npmjs.com/package/cookie-signature) is a library for signing cookies.\n\nVersions before `1.0.4` of the library use the built-in string comparison mechanism, `===`, and not a time constant string comparison. As a result, the comparison will fail faster when the first characters in the token are incorrect. \nAn attacker can use this difference to perform a timing attack, essentially allowing them to guess the secret one character at a time.\n\n## Details\nYou can read more about timing attacks in Node.js on the Snyk blog: https://snyk.io/blog/node-js-timing-attack-ccc-ctf/\n\n## Remediation\nUpgrade to `1.0.4` or greater.\n\n## References\n- https://github.com/tj/node-cookie-signature/blob/master/History.md#104--2014-06-25\n- https://github.com/tj/node-cookie-signature/commit/39791081692e9e14aa62855369e1c7f80fbfd50e\n",
14 | "semver": {
15 | "vulnerable": "<=1.0.3",
16 | "unaffected": ">=1.0.4"
17 | },
18 | "CVSSv3": "CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N",
19 | "severity": "medium",
20 | "identifiers": {
21 | "CWE": [
22 | "CWE-208"
23 | ],
24 | "CVE": [],
25 | "NSP": 134,
26 | "ALTERNATIVE": [
27 | "SNYK-JS-COOKIESIGNATURE-10134"
28 | ]
29 | },
30 | "patches": [],
31 | "moduleName": "cookie-signature",
32 | "language": "js",
33 | "packageManager": "npm",
34 | "id": "npm:cookie-signature:20160804",
35 | "packageName": "cookie-signature",
36 | "cvssScore": 6.3,
37 | "alternativeIds": [
38 | "SNYK-JS-COOKIESIGNATURE-10134"
39 | ],
40 | "from": [
41 | "snyk-test@null",
42 | "cookie-signature@1.0.3"
43 | ],
44 | "upgradePath": [
45 | false,
46 | "cookie-signature@1.0.4"
47 | ],
48 | "version": "1.0.3",
49 | "name": "cookie-signature",
50 | "isUpgradable": true,
51 | "isPatchable": false,
52 | "parentDepType": "prod"
53 | }
54 | ],
55 | "dependencyCount": 1,
56 | "licensesPolicy": null,
57 | "isPrivate": true,
58 | "packageManager": "npm",
59 | "summary": "1 vulnerable dependency path",
60 | "filtered": {
61 | "ignore": [],
62 | "patch": []
63 | },
64 | "uniqueCount": 1
65 | }
66 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/findings_1_2_3/finding_3/node_modules/pivottable/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pivottable",
3 | "version": "1.4.0"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/findings_1_2_3/finding_3/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "snyk-test",
3 | "dependencies": {
4 | "pivottable": "1.4.0"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/findings_1_2_3/finding_3/report.json:
--------------------------------------------------------------------------------
1 | {
2 | "ok": false,
3 | "vulnerabilities": [
4 | {
5 | "title": "Cross-site Scripting (XSS)",
6 | "credit": [
7 | "Todd Wolfson"
8 | ],
9 | "creationTime": "2016-08-17T15:13:32.564Z",
10 | "modificationTime": "2016-08-17T15:13:32.564Z",
11 | "publicationTime": "2016-08-17T15:13:32.564Z",
12 | "disclosureTime": "2016-08-17T15:13:32.564Z",
13 | "description": "## Overview\n[`PivotTable.js`](https://www.npmjs.com/package/pivottable) is a Javascript Pivot Table library with drag-and-drop functionality built on top of jQuery/jQueryUI.\n\nDue to a change from text to html functions in how JSON elements are rendered, a Cross-site scripting (XSS) vulnerability was introduced in version 1.4.0. This vulnerability remained in place until version 2.0.0.\n\nSource: _Node Security Project_\n\n## Remediation\nUpgrade to version 2.0.0 or later.\n\n## References\n- https://github.com/nicolaskruchten/pivottable/pull/401\n\n",
14 | "semver": {
15 | "vulnerable": ">=1.4.0 <2.0.0",
16 | "unaffected": ">=2.0.0"
17 | },
18 | "CVSSv3": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N",
19 | "severity": "high",
20 | "identifiers": {
21 | "CWE": [
22 | "CWE-80"
23 | ],
24 | "CVE": [],
25 | "NSP": 139,
26 | "ALTERNATIVE": [
27 | "SNYK-JS-PIVOTTABLE-10132"
28 | ]
29 | },
30 | "patches": [],
31 | "moduleName": "pivottable",
32 | "language": "js",
33 | "packageManager": "npm",
34 | "id": "npm:pivottable:20160817",
35 | "packageName": "pivottable",
36 | "cvssScore": 7.2,
37 | "alternativeIds": [
38 | "SNYK-JS-PIVOTTABLE-10132"
39 | ],
40 | "from": [
41 | "snyk-test@null",
42 | "pivottable@1.4.0"
43 | ],
44 | "upgradePath": [
45 | false,
46 | "pivottable@2.0.0"
47 | ],
48 | "version": "1.4.0",
49 | "name": "pivottable",
50 | "isUpgradable": true,
51 | "isPatchable": false,
52 | "parentDepType": "prod"
53 | }
54 | ],
55 | "dependencyCount": 1,
56 | "licensesPolicy": null,
57 | "isPrivate": true,
58 | "packageManager": "npm",
59 | "summary": "1 vulnerable dependency path",
60 | "filtered": {
61 | "ignore": [],
62 | "patch": []
63 | },
64 | "uniqueCount": 1
65 | }
66 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/malformed/package.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/snyk/targets/malformed/package.json
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/malformed/report.json:
--------------------------------------------------------------------------------
1 | Missing node_modules folder: we can't test without dependencies.
2 | Please run `npm install` first.
3 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/malformed_nested/finding_1/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/malformed_nested/finding_1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "snyk-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/malformed_nested/malformed/package.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/snyk/targets/malformed_nested/malformed/package.json
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/malformed_nested/malformed/report.json:
--------------------------------------------------------------------------------
1 | Missing node_modules folder: we can't test without dependencies.
2 | Please run `npm install` first.
3 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/malformed_nested/zz_finding_1/node_modules/cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cli",
3 | "version": "0.11.3"
4 | }
5 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/malformed_nested/zz_finding_1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "snyk-test",
3 | "dependencies": {
4 | "cli": "0.11.3"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/no_findings/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "snyk-test",
3 | "dependencies": {
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/no_findings/report.json:
--------------------------------------------------------------------------------
1 | {
2 | "ok": true,
3 | "vulnerabilities": [],
4 | "dependencyCount": 0,
5 | "licensesPolicy": null,
6 | "isPrivate": true,
7 | "packageManager": "npm",
8 | "summary": "No known vulnerabilities",
9 | "uniqueCount": 0
10 | }
11 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/no_findings_no_package_json/example.txt:
--------------------------------------------------------------------------------
1 | // No findings
2 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/snyk-sample-data/SKIP.txt:
--------------------------------------------------------------------------------
1 | The snyk cli should not be run on this target.
2 | The 'report.json' is a mildly-edited version of:
3 | https://github.com/snyk/snyk-to-html/blob/master/sample-data/test-report.json
4 |
5 | In the spec, Glue::Snyk.analyze will receive this file as input,
6 | and generate a list of findings from it.
7 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/snyk-sample-data/generate_report.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Grabs a set of sample data from Snyk's github.
3 |
4 | curl https://raw.githubusercontent.com/snyk/snyk-to-html/master/sample-data/test-report.json | grep -v "\"org\"\|\"__filename\"" > report.json
5 |
--------------------------------------------------------------------------------
/spec/tasks/snyk/targets/snyk-sample-data/package.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/snyk/targets/snyk-sample-data/package.json
--------------------------------------------------------------------------------
/spec/tasks/trufflehog/generate_reports.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Runs Trufflehog on the contents of the 'targets' dir and stores the output in 'results'.
3 | DIR=`dirname $0`
4 | TRUFFLEHOG="/home/glue/tools/truffleHog/truffleHog/truffleHog.py"
5 |
6 | for TARGET_PATH in "$DIR/targets/"*
7 | do
8 | TARGET=`basename $TARGET_PATH`
9 | # echo $TARGET
10 | # echo a > "$DIR/reports/$TARGET.json"
11 | python $TRUFFLEHOG --json $TARGET_PATH > "$DIR/reports/$TARGET.json"
12 | done
13 |
--------------------------------------------------------------------------------
/spec/tasks/trufflehog/reports/mult_findings.json:
--------------------------------------------------------------------------------
1 | {
2 | "sub_one_finding/example_m1.txt:3": "b8e407aed80782ce12a008a8c",
3 | "sub_two_findings/example_m2.txt:3": "b8e407aed80782ce12a008a8c",
4 | "sub_two_findings/example_m2.txt:8": "e52a81ad69857a8a7578f68b1a23"
5 | }
6 |
--------------------------------------------------------------------------------
/spec/tasks/trufflehog/reports/one_finding.json:
--------------------------------------------------------------------------------
1 | {
2 | "example.txt:3": "b8e407aed80782ce12a008a8c"
3 | }
4 |
--------------------------------------------------------------------------------
/spec/tasks/trufflehog/reports/zero_findings.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/spec/tasks/trufflehog/targets/mult_findings/sub_one_finding/example_m1.txt:
--------------------------------------------------------------------------------
1 | // This line has no issues
2 |
3 | // The following line will get flagged:
4 | Application.config.secret_token = 'b8e407aed80782ce12a008a8c'
5 |
6 | // This line has no issues either
7 |
--------------------------------------------------------------------------------
/spec/tasks/trufflehog/targets/mult_findings/sub_two_findings/example_m2.txt:
--------------------------------------------------------------------------------
1 | // This line has no issues
2 |
3 | // The following line will get flagged:
4 | Application.config.secret_token = 'b8e407aed80782ce12a008a8c'
5 |
6 | // This line has no issues either
7 |
8 | // The following line will get flagged as well:
9 | Application.config.another_secret_token = 'e52a81ad69857a8a7578f68b1a23'
10 |
--------------------------------------------------------------------------------
/spec/tasks/trufflehog/targets/mult_findings/sub_zero_findings/example_m0.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/trufflehog/targets/mult_findings/sub_zero_findings/example_m0.txt
--------------------------------------------------------------------------------
/spec/tasks/trufflehog/targets/one_finding/example.txt:
--------------------------------------------------------------------------------
1 | // This line has no issues
2 |
3 | // The following line will get flagged:
4 | Application.config.secret_token = 'b8e407aed80782ce12a008a8c'
5 |
6 | // This line has no issues either
7 |
--------------------------------------------------------------------------------
/spec/tasks/trufflehog/targets/zero_findings/example.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OWASP/glue/87033800b03330fa9b4a6ce3d11dc2a799f60919/spec/tasks/trufflehog/targets/zero_findings/example.txt
--------------------------------------------------------------------------------
/spec/tasks/zap/alerts.json:
--------------------------------------------------------------------------------
1 | {
2 | "alerts": [
3 | {
4 | "sourceid": "3",
5 | "other": "",
6 | "method": "GET",
7 | "evidence": "max-age=0",
8 | "pluginId": "10049",
9 | "cweid": "524",
10 | "confidence": "Medium",
11 | "wascid": "13",
12 | "description": "description",
13 | "messageId": "1",
14 | "url": "http://juiceshop/",
15 | "reference": "https://tools.ietf.org/html/rfc7234\nhttps://tools.ietf.org/html/rfc7231\nhttp://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html (obsoleted by rfc7234)",
16 | "solution": "solution",
17 | "alert": "Storable but Non-Cacheable Content",
18 | "param": "param",
19 | "attack": "",
20 | "name": "Storable but Non-Cacheable Content",
21 | "risk": "Medium",
22 | "id": "0"
23 | },
24 | {
25 | "sourceid": "3",
26 | "other": "",
27 | "method": "GET",
28 | "evidence": "",
29 | "pluginId": "10038",
30 | "cweid": "16",
31 | "confidence": "Medium",
32 | "wascid": "15",
33 | "description": "Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement or distribution of malware. CSP provides a set of standard HTTP headers that allow website owners to declare approved sources of content that browsers should be allowed to load on that page — covered types are JavaScript, CSS, HTML frames, fonts, images and embeddable objects such as Java applets, ActiveX, audio and video files.",
34 | "messageId": "1",
35 | "url": "http://localhost:3000/",
36 | "reference": "https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Introducing_Content_Security_Policy\nhttps://www.owasp.org/index.php/Content_Security_Policy\nhttp://www.w3.org/TR/CSP/\nhttp://w3c.github.io/webappsec/specs/content-security-policy/csp-specification.dev.html\nhttp://www.html5rocks.com/en/tutorials/security/content-security-policy/\nhttp://caniuse.com/#feat=contentsecuritypolicy\nhttp://content-security-policy.com/",
37 | "solution": "Ensure that your web server, application server, load balancer, etc. is configured to set the Content-Security-Policy header, to achieve optimal browser support: \"Content-Security-Policy\" for Chrome 25+, Firefox 23+ and Safari 7+, \"X-Content-Security-Policy\" for Firefox 4.0+ and Internet Explorer 10+, and \"X-WebKit-CSP\" for Chrome 14+ and Safari 6+.",
38 | "alert": "Content Security Policy (CSP) Header Not Set",
39 | "param": "",
40 | "attack": "",
41 | "name": "Content Security Policy (CSP) Header Not Set",
42 | "risk": "Low",
43 | "id": "1"
44 | }
45 | ]
46 | }
--------------------------------------------------------------------------------