The 2015 Underhanded C Contest Has Begun
Xcott Craver writes: The 8th Underhanded C Contest is now underway. The goal of the Underhanded C Contest is to write C code that is as readable, clear, innocent and straightforward as possible, but which performs some malicious function that is not obvious from looking at the source code. This year's challenge is based on a real problem in joint development for nuclear treaty verification, and the prize is $1000.
So, pretty much any C program will be competitive here.
Clearly this contest must be in someway related to Systemd but I find no mention in TFA
Isn't all C++ underhanded?
My C++ programmer buddies swear that the language was designed by a team of masochists who had a poor sense of humor and anger management issues.
Just cruising through this digital world at 33 1/3 rpm...
I'm trying to remember where I first saw this function (I think it's a pretty common example for security coding seminars):
int passwordCompare(char* enteredPassword, char* validPassword) {
int i;
for (i = 0; (len(enteredPassword) > i) && (enteredPassword[i] == validPassword[i]; ++i) {
}
if (len(enteredPassword) == i) { /* true */ /* false */
return -1;
}
else {
return 0;
}
}
but, I would imagine that it would qualify as an example for the contest. I don't think it was originally designed to be malicious, but more of a coding error.
I would expect most of the entries in the contest would be of this variety, something that a (new) coder has put in that works for basic test cases, but has a serious flaw...
Mimetics Inc. Twitter
that fits this bill. Code that I swore up and down covered all corner cases for input but with enough fuzzing could be coaxed into crashing.
Nah, it shows how everything is probably loaded with backdoors, including your compiler, bios, firmware, and your operating system.
This contest concerns underhanded C, not C++. There would be little point in an underhanded C++ contest.
C is a trivially simple language, with a very small syntax and a very narrow set of semantics. As a result, you have to work pretty hard to make ordinary C contain hidden functionality --- usually this requires abusing the C preprocessor, because the C grammar itself doesn't provide much room for hiding things.
C++ is at the other end of the complexity scale, being the language with the largest syntax and the most extremely complex semantics of any programming language on the planet. It took that crown from Ada many decades ago, and it hasn't stopped growing since.
Because of C++'s huge size in every respect, C++ programmers tend to develop their own preferred subsets of the language, and they stick with that subset throughout their lives. There's nothing wrong with that (indeed, it's probably the only way of working with C++), but it has the consequence that one person's clear C++ is another person's incomprehensible C++.
That makes writing underhanded C++ a rather pointless exercise.
@anon: 'This contest shows how Linux is probably loaded with backdoors.'
And closed source is free of backdoors as we can never see the source code?
If this were the underhanded Perl contest, I would trust that $1000 prize to be woth ten Benjamins.
Let us all set back and appreciate the scariest bit of C code ever written:
main( ) {
printf("hello, world");
}
Laws are rules for the court, but merely a bottom bar to hit for life. Think beyond laws in your actions always.
Only US$1,000.00? That's useless. For those who study the history of code (in any klanguage, but especially C [or microcode]), this could be a meaningful challenge. But only if we're talking six figures. At least the really smart people I've been blessed to associate with are worth it.
"The great thing about multitasking is that several things can go wrong at once." -me