예제 #1
0
 def testVersion2(self):
     definitions["jquery"]["vulnerabilities"].append(
         {"atOrAbove": "10.0.0-*", "below": "10.0.1"})
     result = retire.scan_uri(
         "https://ajax.googleapis.com/ajax/libs/jquery/10.0.0.beta.2/jquery.min.js",
         definitions)
     self.assertTrue(retire.is_vulnerable(result))
예제 #2
0
 def testVersion1(self):
     definitions["jquery"]["vulnerabilities"].append(
         {"below": "10.0.0.beta.2"})
     result = retire.scan_uri(
         "https://ajax.googleapis.com/ajax/libs/jquery/10.0.0/jquery.min.js",
         definitions)
     self.assertFalse(retire.is_vulnerable(result))
예제 #3
0
 def testVersion9(self):
     definitions["jquery"]["vulnerabilities"] = [{"below": "10.0.0.beta.2"}]
     result = retire.scan_uri(
         "https://ajax.googleapis.com/ajax/libs/jquery/10.0.0.rc.1/jquery.min.js", definitions)
     self.assertFalse(retire.is_vulnerable(result))
예제 #4
0
 def testfilename6(self):
     result = retire.scan_filename("jquery-1.6.0-rc.1.js")
     self.assertTrue(retire.is_vulnerable(result))
예제 #5
0
 def testfilename4(self):
     result = retire.scan_filename("jquery-1.12.1.js")
     self.assertFalse(retire.is_vulnerable(result))
예제 #6
0
 def testhash4(self):
     definitions["jquery"]["extractors"]["hashes"][hash] = "1.12.1"
     result = retire.scan_file_content(content)
     self.assertFalse(retire.is_vulnerable(result))
예제 #7
0
 def testhash1(self):
     global content, hash
     definitions["jquery"]["extractors"]["hashes"][hash] = "1.8.1"
     result = retire.scan_file_content(content)
     self.assertTrue(retire.is_vulnerable(result))
예제 #8
0
 def testuri5(self):
     result = retire.scan_uri(
         "https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js")
     self.assertTrue(retire.is_vulnerable(result))
예제 #9
0
 def test6(self):
     result = retire.scan_file_content("a = 1; /*! jQuery v1.4 asdasd ")
     self.assertTrue(retire.is_vulnerable(result))
예제 #10
0
 def testuri5(self):
     result = retire.scan_uri(
         "https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js")
     self.assertTrue(retire.is_vulnerable(result))
예제 #11
0
 def test4(self):
     result = retire.scan_file_content("/*! jQuery v1.12.1 asdasd ")
     self.assertFalse(retire.is_vulnerable(result))
예제 #12
0
 def testVersion8(self):
     definitions["jquery"]["vulnerabilities"] = [{"below": "10.0.0"}]
     result = retire.scan_uri(
         "https://ajax.googleapis.com/ajax/libs/jquery/10.0.0.rc.1/jquery.min.js",
         definitions)
     self.assertTrue(retire.is_vulnerable(result))
예제 #13
0
 def testVersion4(self):
     definitions["jquery"]["vulnerabilities"] = [{"below": "1.9.0b1"}]
     result = retire.scan_uri(
         "https://ajax.googleapis.com/ajax/libs/jquery/1.9.0rc1/jquery.min.js",
         definitions)
     self.assertFalse(retire.is_vulnerable(result))
예제 #14
0
 def test4(self):
     result = retire.scan_file_content("/*! jQuery v1.12.1 asdasd ")
     self.assertFalse(retire.is_vulnerable(result))
예제 #15
0
 def testhash4(self):
     definitions["jquery"]["extractors"]["hashes"][hash] = "1.12.1"
     result = retire.scan_file_content(content)
     self.assertFalse(retire.is_vulnerable(result))
예제 #16
0
 def test6(self):
     result = retire.scan_file_content("a = 1; /*! jQuery v1.4 asdasd ")
     self.assertTrue(retire.is_vulnerable(result))
예제 #17
0
 def testfilename2(self):
     result = retire.scan_filename("jquery-2.0.0.js")
     self.assertTrue(retire.is_vulnerable(result))
예제 #18
0
 def testhash1(self):
     global content, hash
     definitions["jquery"]["extractors"]["hashes"][hash] = "1.8.1"
     result = retire.scan_file_content(content)
     self.assertTrue(retire.is_vulnerable(result))
예제 #19
0
 def testfilename3(self):
     result = retire.scan_filename("jquery-1.12.0.js")
     self.assertFalse(retire.is_vulnerable(result))
예제 #20
0
 def testfilename2(self):
     result = retire.scan_filename("jquery-2.0.0.js")
     self.assertTrue(retire.is_vulnerable(result))
예제 #21
0
 def testfilename6(self):
     result = retire.scan_filename("jquery-1.6.0-rc.1.js")
     self.assertTrue(retire.is_vulnerable(result))