deepstate
deepstate copied to clipboard
running deepstate with config file -> types recognition bug
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.