Commit bd3ab49999771918b51ff01d038cc649eb7ba65b

Authored by Christian Herdtweck
1 parent 5bd15a27

unittest: test extended msodde CSV formula

Showing 1 changed file with 11 additions and 0 deletions
tests/msodde/test_csv.py
... ... @@ -131,6 +131,17 @@ class TestCSV(unittest.TestCase):
131 131 self.assertTrue(have_start_line) # ensure output was complete
132 132 return result
133 133  
  134 + def test_regex(self):
  135 + """ check that regex captures other ways to include dde commands
  136 +
  137 + from http://www.exploresecurity.com/from-csv-to-cmd-to-qwerty/ and/or
  138 + https://www.contextis.com/blog/comma-separated-vulnerabilities
  139 + """
  140 + kernel = "cmd|'/c calc'!A0"
  141 + for wrap in '={0}', '@SUM({0})', '"={0}"', '+{0}', '-{0}':
  142 + cmd = wrap.format(kernel)
  143 + self.assertNotEqual(msodde.CSV_DDE_FORMAT.match(cmd), None)
  144 +
134 145  
135 146 # just in case somebody calls this file as a script
136 147 if __name__ == '__main__':
... ...