From f4a6674eedaa8f3c3ed5d93df45fb7be76432988 Mon Sep 17 00:00:00 2001 From: erwanlr Date: Thu, 16 Apr 2020 10:06:28 +0200 Subject: [PATCH] Better code related to CVSS --- lib/wpscan/vulnerability.rb | 4 +--- spec/fixtures/db/vuln_api/wordpresses/381.json | 6 ++++-- wpscan.gemspec | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/wpscan/vulnerability.rb b/lib/wpscan/vulnerability.rb index 214edef2..013ecb31 100644 --- a/lib/wpscan/vulnerability.rb +++ b/lib/wpscan/vulnerability.rb @@ -16,14 +16,12 @@ module WPScan end end - cvss = { score: json_data['cvss_risk_score'], vector: json_data['cvss_vector'] } if json_data['cvss_risk_score'] - new( json_data['title'], references: references, type: json_data['vuln_type'], fixed_in: json_data['fixed_in'], - cvss: cvss + cvss: json_data['cvss']&.symbolize_keys ) end end diff --git a/spec/fixtures/db/vuln_api/wordpresses/381.json b/spec/fixtures/db/vuln_api/wordpresses/381.json index b43bb22e..71b60b26 100644 --- a/spec/fixtures/db/vuln_api/wordpresses/381.json +++ b/spec/fixtures/db/vuln_api/wordpresses/381.json @@ -10,8 +10,10 @@ "vuln_type" : "SQLI", "published_date" : null, "fixed_in" : null, - "cvss_risk_score": "5.4", - "cvss_vector": "VECTOR" + "cvss": { + "score": "5.4", + "vector": "VECTOR" + } }, { "references" : { diff --git a/wpscan.gemspec b/wpscan.gemspec index d5d03934..66cd2273 100644 --- a/wpscan.gemspec +++ b/wpscan.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.executables = ['wpscan'] s.require_paths = ['lib'] - s.add_dependency 'cms_scanner', '~> 0.9.0' + s.add_dependency 'cms_scanner', '~> 0.10.0' s.add_development_dependency 'bundler', '>= 1.6' s.add_development_dependency 'memory_profiler', '~> 0.9.13'