I like the original Ken Thompson sneakiness in C (<a href="http://electronicdesign.com/dev-tools/thompson-ritchie-and-kernighan-fathers-c" rel="nofollow">http://electronicdesign.com/dev-tools/thompson-ritchie-and-k...</a>):<p>"Also in his Turing Award lecture, he described how he had incorporated a backdoor security hole in the original UNIX C compiler. To do this, the C compiler recognized when it was recompiling itself and the UNIX login program. When it recompiled itself, it modified the compiler so the compiler backdoor was included. When it recompiled the UNIX login program, the login program would allow Thompson to always be able to log in using a fixed set of credentials."
OpenBSD specifically modified malloc() a few years ago to prevent this sort of sneakiness (<a href="http://www.tw.openbsd.org/papers/eurobsdcon2009/otto-malloc.pdf" rel="nofollow">http://www.tw.openbsd.org/papers/eurobsdcon2009/otto-malloc....</a> [pdf]). So they route their malloc() calls through mmap() which returns randomized pages, and free() immediately returns memory to the kernel rather than leaving it mapped in the current process.<p>I'd be surprised if these changes haven't made it into FreeBSD, but afaik Linux doesn't work this way (by default, anyway).
It also makes the assumption that it's a little-endian system. On a big-endian system, the high order byte of the timestamp would be modified, which would probably be too obvious.
"In C/C++, you can use bugs in one part of a program to cause trouble in another. That’s pretty darn underhanded."<p>I would argue every language has that property. But with C/C++ being so closely tied to the ABI of the machine perhaps they are more underhanded than others. But to me, this branding does feel a bit unfair.<p>Still, a fun contest and an interesting read.
Looking at the source, this is where the alarm bells should go off in a reviewer's head:<p><pre><code> memcpy(filter->buffer, output->piu_text_utf8, sizeof(output->piu_text_utf8));
</code></pre>
1. memcpy is less safe than memmove and strncpy. strncpy should be used.<p>2. The two character arrays should use the same constant in defining their length, and that constant should be used both in the struct definitions and here in the copy operation.<p>3. The code is written in C in spite of it being 2014 at the time.