VirusTotal / yara-python

The Python interface for YARA
http://virustotal.github.io/yara/
Apache License 2.0
646 stars 179 forks source link

Segmentation fault caused by integer overflow #196

Closed vlaci closed 2 years ago

vlaci commented 2 years ago

The issue is caused by yr_re_fast_exec overflowing and returning a negative length which is used to build a Python bytes object here: https://github.com/VirusTotal/yara-python/blob/7e19b740b301c097609a42930338498324d130c8/yara-python.c#L929 The object creation fails later PY_DECREF trips because the refcount would go negative.

The original issue is fixed by https://github.com/VirusTotal/yara/pull/1615, so updating the yara submodule would fix this issue too.