Closed g-les closed 5 months ago
I'm unsure why it's only present when scanning directories, but the line it's panicking on was fixed a few commits back. This was fixed in https://github.com/VirusTotal/yara-x/commit/48d799dd4f50502237ebd535657a3417e536324f.
It just hasn't made it into a new release yet :smile:
@latonis as you already noticed, the main issue reported here is already fixed, but while investigating I've found another issue.
The program panics at this line: https://github.com/VirusTotal/yara-x/blob/44cb51772f540e6508d08b17d142d69188375d75/lib/src/modules/macho/parser.rs#L980
That's because prefix.to_str().unwrap()
is converting a string read from the file to UTF-8, but the string may contain data that is not valid UTF-8.
This issue is reproducible while scanning file: c931a1ded68d7222467726f30144ecd54a9882458ac99275e930136391afce67
By the way, the reason why the panic only occurs while scanning directories is because the file causing the panic is not the reported one, but some other file in the same directory.
Hi gang
was testing use of
macho
module to detect RPaths and would regularly get a Panic when scanning over directories, but no issue on individual files. It looks like panic is coming from https://github.com/VirusTotal/yara-x/blob/main/lib/src/modules/macho/parser.rs#L321here is the error
Full logs, on
yara-x-cli 0.4.0