Class: WPScan::Vulnerability

Inherits:
CMSScanner::Vulnerability
  • Object
show all
Includes:
References
Defined in:
lib/wpscan/vulnerability.rb

Overview

Specific implementation

Class Method Summary collapse

Methods included from References

#references_urls, #wpvulndb_ids, #wpvulndb_url, #wpvulndb_urls

Class Method Details

.load_from_json(json_data) ⇒ Vulnerability

Parameters:

  • json_data (Hash)

Returns:



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/wpscan/vulnerability.rb', line 10

def self.load_from_json(json_data)
  references = { wpvulndb: json_data['id'].to_s }

  if json_data['references']
    references_keys.each do |key|
      references[key] = json_data['references'][key.to_s] if json_data['references'].key?(key.to_s)
    end
  end

  new(
    json_data['title'],
    references: references,
    type: json_data['vuln_type'],
    fixed_in: json_data['fixed_in'],
    introduced_in: json_data['introduced_in'],
    cvss: json_data['cvss']&.symbolize_keys
  )
end