landave
Remote: Yes (flexible)
Willing to relocate: Yes
Technologies: C/C++, Java, OpenCL, Python, X86/X86_64, Haskell, IDA Pro, Git, Linux, Windows
Résumé/CV: https://landave.io/, https://www.linkedin.com/in/landave/, detailed CV upon request
Email: blog+hn |[at]| landave |[dot]| io
Hi, I am Dave. I just defended my PhD thesis in cryptography at ETH Zurich. I am broadly interested in systems and software security, vulnerability research, reverse engineering, exploitation, fuzzing, static/dynamic analysis, and cryptography. I really like finding and exploiting vulnerabilities in commercial security products such as anti-virus or endpoint security software. In the past few years, I was awarded around 150 bug bounties in total by companies such as Avast, Bitdefender, F-Secure, Avira, Kaspersky, and others. A small selection of these findings are documented on my blog https://landave.io/.
Feel free to reach out :).
Bitdefender: UPX Unpacking Featuring Ten Memory Corruptions
I wonder how hard it would be to take legal action (in particular to stop them from doing this altogether, as opposed to just taking down a single article). The site appears to be hosted in Russia[5]. From a quick glance over the Wikipedia page[6], it seems to me that Russian copyright law is quite similar to copyright law in most developed countries.
[1]: https://movaxbx.**/2018/06/05/f-secure-anti-virus-remote-cod...
[2]: https://movaxbx.**/2018/05/04/7-zip-from-uninitialized-memor...
[3]: https://movaxbx.**/2018/05/04/7-zip-multiple-memory-corrupti...
[4]: https://movaxbx.**/2018/05/04/bitdefender-heap-buffer-overfl...
However, F-Secure applies several patches to harden 7-Zip and to fix bugs that are not yet fixed in the public 7-Zip version. So it is not clear whether it is always such a good idea to do this.
F-Secure Anti-Virus: Remote Code Execution via Solid RAR Unpacking
If I recall correctly, Igor once said that he tested the new VS compiler and it produced neither smaller nor faster executables. I believe there was almost no difference.
[0]: https://landave.io/2018/01/7-zip-multiple-memory-corruptions...
Byte marker[NHeader::kMarkerSize];
RINOK(ReadStream_FALSE(stream, marker, NHeader::kMarkerSize));
if (memcmp(marker, kMarker, NHeader::kMarkerSize) == 0)
m_Position += NHeader::kMarkerSize;
else
{
if (searchHeaderSizeLimit && *searchHeaderSizeLimit == 0)
return S_FALSE;
RINOK(stream->Seek(m_StreamStartPosition, STREAM_SEEK_SET, NULL));
RINOK(FindSignatureInStream(stream, kMarker, NHeader::kMarkerSize,
searchHeaderSizeLimit, arcStartPos));
m_Position = arcStartPos + NHeader::kMarkerSize;
RINOK(stream->Seek(m_Position, STREAM_SEEK_SET, NULL));
}
7-Zip finds the magic number if it appears within some searchHeaderSizeLimit, i.e., the file does not need to start (at offset 0) with the magic number. For example, 7-Zip will extract a RAR file which begins with [00 52 61 72 21 1A 07 00] (instead of [52 61 72 21 1A 07 00]) just fine.If you really cannot avoid implementing something like this, you should inspect the 7-Zip code in order to be 100% sure that the magic number detection in your filter is identical (or matches a superset) to the one from 7-Zip.
But honestly, I don't think we will ever see a 7-Zip with /GS or CFG. Not only would this cost about 1% in binary size, it would cost an additional 1% in runtime performance loss. Additionally, it would require compiling 7-Zip with a modern compiler like VS2017. You're just asking for too much.
ASLR was primarily disabled because Igor wanted to strip the relocation from the binaries in order to save about 0.5-1% in file size. I have discussed this with him, and convinced him to enabled full ASLR for 7-Zip 18.05.
So now we have 7-Zip 18.05 with full ASLR and DEP. Stack canaries (/GS) are still disabled though.
1. Some people mentioned that this would "only affect RAR files" and it would be safe to extract 7z files with 7-Zip prior to version 18.05. This is wrong, because 7-Zip detects the file type from the magic numbers at the beginning of the file. So the exploit can be renamed to 'exploit.7z' and it works just as well.
On /r/sysadmin, someone even mentioned that a temporary solution might be to block RAR files. By the same argument, this is unlikely to be effective.
2. Almost all versions prior to 18.05 are affected. I manually checked version 15.05 and 17.01, and they are definitely affected.
3. Not only 7-Zip itself is affected, but essentially all software that uses 7z.dll as library to extract files. This includes various anti-virus software. However, exploitation may be more difficult (though not impossible) if ASLR&DEP is properly enabled (on all modules).
7-Zip: From Uninitialized Memory to Remote Code Execution
7-Zip: From Uninitialized Memory to Remote Code Execution
Stack canaries might cause a slight performance hit, but it is usually below one percent, since it creates only a small cost per function call for a fraction of all functions.
It may be that the blog post is difficult to understand simply because I have written it poorly...
I admit that this is confusing, so I'll probably try to rephrase this.