Advertisement
Guest User

Result

a guest
Feb 26th, 2018
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.60 KB | None | 0 0
  1. (venv) vaibhav@vaibhav-HP-Notebook:~/coala1/coala-bears/tests/python/requirements$ pytest
  2. ============================= test session starts ==============================
  3. platform linux -- Python 3.5.2, pytest-3.4.1, py-1.5.2, pluggy-0.6.0
  4. rootdir: /home/vaibhav/coala1/coala-bears, inifile: setup.cfg
  5. plugins: xdist-1.22.1, timeout-1.2.1, forked-0.2, env-0.6.2, cov-2.5.1
  6. timeout: 35.0s method: signal
  7. collected 14 items                                                            
  8.  
  9. PinRequirementsBearTest.py ....                                          [ 28%]
  10. PySafetyBearTest.py .....                                                [ 64%]
  11. PySafetyBearWithoutMockTest.py F....                                     [100%]
  12.  
  13. =================================== FAILURES ===================================
  14. _________________ PySafetyBearTest.test_with_cve_vulnerability _________________
  15.  
  16. self = <tests.python.requirements.PySafetyBearWithoutMockTest.PySafetyBearTest testMethod=test_with_cve_vulnerability>
  17.  
  18.     def test_with_cve_vulnerability(self):
  19.         file_name = 'requirement.txt'
  20.         file_contents = load_testfile(file_name)
  21.         self.maxDiff = None
  22.         self.check_results(
  23.             self.uut,
  24.             file_contents,
  25.             [Result.from_values('PySafetyBear',
  26.                 'bottle<0.12.10 is vulnerable to CVE-2016-9964 and your project is using 0.10.0.',
  27.                 file =get_testfile_path(file_name),
  28.                 line=1,
  29.                 column=9,
  30.                 end_line=1,
  31.                 end_column=15,
  32.                 severity=RESULT_SEVERITY.NORMAL,
  33.                 )],
  34. >           filename=get_testfile_path(file_name))
  35.  
  36. PySafetyBearWithoutMockTest.py:47:
  37. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  38. ../../../../venv/lib/python3.5/site-packages/coalib/testing/LocalBearTestHelper.py:264: in check_results
  39.     sorted(bear_output), sorted(results))
  40. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  41.  
  42. self = <tests.python.requirements.PySafetyBearWithoutMockTest.PySafetyBearTest testMethod=test_with_cve_vulnerability>
  43. observed_result = [<Result object(id=0x6492086769ca49578e4ffd83a78198fa, origin='PySafetyBear', affected_code=(<SourceRange object(start...ulnerable to CVE-2016-9964 and your project is using 0.10.0.', aspect=NoneType, applied_actions={}) at 0x7fc2fe42c0f0>]
  44. expected_result = [<Result object(id=0xc582638777584692b3352be3088ead2e, origin='PySafetyBear', affected_code=(<SourceRange object(start...ulnerable to CVE-2016-9964 and your project is using 0.10.0.', aspect=NoneType, applied_actions={}) at 0x7fc2fe432da0>]
  45.  
  46.     def assertComparableObjectsEqual(self, observed_result, expected_result):
  47.         if len(observed_result) == len(expected_result):
  48.             messages = ''
  49.             for observed, expected in zip(observed_result, expected_result):
  50.                 if (isinstance(observed, Comparable)
  51.                     and isinstance(expected, Comparable)) and (
  52.                             type(observed) is type(expected)):
  53.                     for attribute in type(observed).__compare_fields__:
  54.                         try:
  55.                             self.assertEqual(
  56.                                 getattr(observed, attribute),
  57.                                 getattr(expected, attribute),
  58.                                 msg='{} mismatch.'.format(attribute))
  59.                         except AssertionError as ex:
  60.                             messages += (str(ex) + '\n\n')
  61.                 else:
  62.                     self.assertEqual(observed_result, expected_result)
  63.             if messages:
  64. >               raise AssertionError(messages)
  65. E               AssertionError: 'redirect() in bottle.py in bottle 0.12.10[133 chars]all.' != ''
  66. E               - redirect() in bottle.py in bottle 0.12.10 doesn't filter a "\r\n" sequence, which leads to a CRLF attack, as demonstrated by a redirect("233\r\nSet-Cookie: name=salt") call.
  67. E               +
  68. E                : additional_info mismatch.
  69.  
  70. ../../../../venv/lib/python3.5/site-packages/coalib/testing/LocalBearTestHelper.py:132: AssertionError
  71. ===================== 1 failed, 13 passed in 19.24 seconds =====================
  72. (venv) vaibhav@vaibhav-HP-Notebook:~/coala1/coala-bears/tests/python/requirements$ coala --bears PySafetyBear --files requirement.txt -V --flush-cache
  73. [WARNING][19:42:23] Default coafile '.coafile' not found!
  74. Here's what you can do:
  75. * add `--save` to generate a config file with your current options
  76. * add `-I` to suppress any use of config files
  77.  
  78. [DEBUG][19:42:23] Registered VCS backend: git
  79. [DEBUG][19:42:23] Registered VCS backend: hg
  80. [DEBUG][19:42:24] Registered VCS backend: svn
  81. [DEBUG][19:42:24] Registered VCS backend: bzr
  82. [DEBUG][19:42:24] Platform Linux -- Python 3.5.2, coalib 0.12.0.dev99999999999999
  83. [DEBUG][19:42:24] The file cache was successfully flushed.
  84. Executing section cli...
  85. [WARNING][19:42:24] No files matching '/home/vaibhav/coala1/coala-bears/tests/python/requirements/requirement.txt' were found. If this rule is not required, you can remove it from section [cli] in your .coafile to deactivate this warning.
  86. [DEBUG][19:42:24] Files that will be checked:
  87.  
  88. (venv) vaibhav@vaibhav-HP-Notebook:~/coala1/coala-bears/tests/python/requirements$ cd PySafety_test_files/^C^Cou may use the `--flush-cache` flag to see them.
  89. (venv) vaibhav@vaibhav-HP-Notebook:~/coala1/coala-bears/tests/python/requirements$ cd PySafety_test_files/
  90. (venv) vaibhav@vaibhav-HP-Notebook:~/coala1/coala-bears/tests/python/requirements/PySafety_test_files$ coala --bears PySafetyBear --files requirement.txt -V --flush-cache
  91. [WARNING][19:42:47] Default coafile '.coafile' not found!
  92. Here's what you can do:
  93. * add `--save` to generate a config file with your current options
  94. * add `-I` to suppress any use of config files
  95.  
  96. [DEBUG][19:42:48] Registered VCS backend: git
  97. [DEBUG][19:42:48] Registered VCS backend: hg
  98. [DEBUG][19:42:48] Registered VCS backend: svn
  99. [DEBUG][19:42:48] Registered VCS backend: bzr
  100. [DEBUG][19:42:48] Platform Linux -- Python 3.5.2, coalib 0.12.0.dev99999999999999
  101. [DEBUG][19:42:48] The file cache was successfully flushed.
  102. Executing section cli...
  103. [DEBUG][19:42:48] Files that will be checked:
  104. /home/vaibhav/coala1/coala-bears/tests/python/requirements/PySafety_test_files/requirement.txt
  105. [DEBUG][19:42:49] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
  106. [DEBUG][19:42:49] Running bear PySafetyBear...
  107. [DEBUG][19:42:49] Starting new HTTPS connection (1): raw.githubusercontent.com
  108. [DEBUG][19:42:49] https://raw.githubusercontent.com:443 "GET /pyupio/safety-db/master/data/insecure.json HTTP/1.1" 200 5290
  109. [DEBUG][19:42:49] Starting new HTTPS connection (1): raw.githubusercontent.com
  110. [DEBUG][19:42:50] https://raw.githubusercontent.com:443 "GET /pyupio/safety-db/master/data/insecure_full.json HTTP/1.1" 200 53183
  111.  
  112. requirement.txt
  113. [   1] bottle==0.10.0
  114. **** PySafetyBear [Section: cli | Severity: NORMAL] ****
  115. !    ! bottle<0.12.10 is vulnerable to CVE-2016-9964 and your project is using 0.10.0.
  116. [    ] *0. Do (N)othing
  117. [    ]  1. (O)pen file
  118. [    ]  2. Print (M)ore info
  119. [    ]  3. Add (I)gnore comment
  120. [    ] Enter number (Ctrl-D to exit): 2
  121. redirect() in bottle.py in bottle 0.12.10 doesn't filter a "\r\n" sequence, which leads to a CRLF attack, as demonstrated by a redirect("233\r\nSet-Cookie: name=salt") call.
  122. [    ] The action was executed successfully.
  123. [    ] *0. Do (N)othing
  124. [    ]  1. (O)pen file
  125. [    ]  2. Print (M)ore info
  126. [    ]  3. Add (I)gnore comment
  127. [    ] Enter number (Ctrl-D to exit):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement