26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/sastbox-sdk/severity_calculator.rb', line 26
def attempt_to_determine_severity(issue)
text = "#{issue[:title]} #{issue[:description]}".downcase.gsub(/[^a-z ]/, ' ')
level = :undefined
critical = ['command exec', 'cmd exec', 'command inj', 'cmd inj', 'code inj', 'code exec',
'file inclusion', 'dangerous send', 'insecure deserialization']
high = ['xss', 'cross site scripting', 'sqli', 'sql injection', 'insecure url',
'file manipulation', 'file access', 'file disclosure', 'idor', 'xpath inj',
'weak cipher', 'weak crypto', 'insecure cipher', 'insecure crypto', 'insecure encryption',
'broken cipher', 'broken crypto', 'weak hash', 'insecure hash', 'broken hash',
'pathtraversal', 'path traversal', 'xxe', 'xml external entities']
medium = ['mass assignment', 'secret keyword',
'hard coded pass', 'hardcoded pass', 'pass hardcoded', 'password hardcoded',
'password hard coded', 'secret hardcoded',
'session fixation', 'security misconfiguration', 'vulnerable component',
'header injection', 'csrf', 'cross site request forgery',
'toctou', 'session setting', 'response splitting'
]
low = ['open redirect', 'resource leak', 'format validation',
'information disclosure', 'logging', 'logger', 'stacktrace', 'stack trace',
'null pointer deref']
info = []
if level == :undefined
level = :critical if severity_pattern_found?(critical, text)
end
if level == :undefined
level = :high if severity_pattern_found?(high, text)
end
if level == :undefined
level = :medium if severity_pattern_found?(medium, text)
end
if level == :undefined
level = :low if severity_pattern_found?(low, text)
end
if level == :undefined
level = :info if severity_pattern_found?(info, text)
end
level
end
|