diff --git a/data/local_vulnerable_files.xml b/data/local_vulnerable_files.xml index 134456dc..d8dbd0a7 100644 --- a/data/local_vulnerable_files.xml +++ b/data/local_vulnerable_files.xml @@ -1,36 +1,30 @@ - + + + XSS in swfupload.swf @@ -70,4 +64,3 @@ ryandewhurst at gmail - diff --git a/data/local_vulnerable_files.xsd b/data/local_vulnerable_files.xsd new file mode 100644 index 00000000..c5074cf5 --- /dev/null +++ b/data/local_vulnerable_files.xsd @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/data/vuln.xsd b/data/vuln.xsd index e7eaa5f2..ea093fe2 100644 --- a/data/vuln.xsd +++ b/data/vuln.xsd @@ -24,6 +24,10 @@ + + + + @@ -58,7 +62,7 @@ - + diff --git a/lib/common_helper.rb b/lib/common_helper.rb index cbeb52fc..949b791d 100644 --- a/lib/common_helper.rb +++ b/lib/common_helper.rb @@ -43,6 +43,7 @@ WP_VERSIONS_FILE = DATA_DIR + "/wp_versions.xml" LOCAL_FILES_FILE = DATA_DIR + "/local_vulnerable_files.xml" VULNS_XSD = DATA_DIR + "/vuln.xsd" WP_VERSIONS_XSD = DATA_DIR + "/wp_versions.xsd" +LOCAL_FILES_XSD = DATA_DIR + "/local_vulnerable_files.xsd" WPSCAN_VERSION = "2.0" diff --git a/spec/xml_checks_spec.rb b/spec/xml_checks_spec.rb index 30b80440..b5db794e 100644 --- a/spec/xml_checks_spec.rb +++ b/spec/xml_checks_spec.rb @@ -23,20 +23,15 @@ describe "XML checks" do after :each do FileTest.exists?(@file).should be_true - if @xsd - xsd = Nokogiri::XML::Schema(File.read(@xsd)) - doc = Nokogiri::XML(File.read(@file)) + xsd = Nokogiri::XML::Schema(File.read(@xsd)) + doc = Nokogiri::XML(File.read(@file)) - errors = [] - xsd.validate(doc).each do |error| - errors << error.message - end - - errors.should === [] - else - expect { Nokogiri::XML(File.read(@file)) { |config| config.strict } }.to_not raise_error + errors = [] + xsd.validate(doc).each do |error| + errors << error.message end + errors.should === [] end it "check plugin_vulns.xml for syntax errors" do @@ -61,6 +56,6 @@ describe "XML checks" do it "check local_vulnerable_files.xml for syntax errors" do @file = LOCAL_FILES_FILE - @xsd = nil + @xsd = LOCAL_FILES_XSD end end \ No newline at end of file