by londons_explore · 6y ago · 0 comments
So why did this attacker choose such an obvious 'typo' rather than a subtle flaw in a large patch set?
And if you look at the "Scoring and Extra Points" section of http://underhanded-c.org/_page_id_5.html you will notice that it checks most of the boxes.
It is short, errors based on human perception (here = vs ==) are good enough, it is innocent looking under syntax highlighting, is is not platform dependent, and it even passes the "irony" check. It is just the plausible deniability that is not great, but it is still defensible with a lot of bad faith.
if ((fd = open(...)) != -1) {
/* do something with fd */
} else {
perror("open");
}
The compiler outputs a warning when you have something like "if (a = b)". If that's what you mean (it sometimes is), you have to write it "if ((a = b))" to silence the warning.while((i = getchar()) != EOF) putchar(i);
This type of thing seems to be "encouraged"...
Including a red herring to invite extra scrutiny doesn't seem wise if you're trying to hide something.