deepstate icon indicating copy to clipboard operation
deepstate copied to clipboard

running deepstate with config file -> types recognition bug

Open GrosQuildu opened this issue 5 years ago • 0 comments

Deepstate allows to use config file instead of command line arguments:

https://github.com/trailofbits/deepstate/blob/614e677b11a24b274ffc8fcc41d1cfd324dfbda4/bin/deepstate/core/base.py#L102-L104

https://github.com/trailofbits/deepstate/blob/614e677b11a24b274ffc8fcc41d1cfd324dfbda4/bin/deepstate/core/base.py#L131-L132

https://github.com/trailofbits/deepstate/blob/614e677b11a24b274ffc8fcc41d1cfd324dfbda4/bin/deepstate/core/base.py#L176-L177

For parsing uses configparser. But the lib doesn't recognize daty types. So if we specify i.e. timeout = 36000 it will be parsed as string and crash fuzzers at startup:

https://github.com/trailofbits/deepstate/blob/614e677b11a24b274ffc8fcc41d1cfd324dfbda4/bin/deepstate/core/fuzz.py#L478

Traceback (most recent call last):
  File "~/.virtualenvs/deepstate/lib/python3.7/site-packages/deepstate-0.1-py3.7.egg/deepstate/core/fuzz.py", line 479, in _run
    stdout, stderr = self.proc.communicate(timeout=self.timeout if self.timeout != 0 else None)
  File "/usr/lib/python3.7/subprocess.py", line 934, in communicate
    endtime = _time() + timeout
TypeError: unsupported operand type(s) for +: 'float' and 'str'

Found when tried to run https://github.com/trailofbits/deepstate-test-suite/blob/master/tests/json/config.ini

We may switch to different config file format (YAML?) or, probably better, use argparse to recognize types of arguments we pull from config file.

GrosQuildu avatar Jan 27 '20 19:01 GrosQuildu