Earlier quoted context omitted.
:= Still seems easy to overlook at a cursory glance.
What db48x neglected to mention is that some of those languages also featured assignment as strictly a statement; it could not be a subexpression. As in: fun(x := 42); (* syntax error in Pascal *) x := 42; (* OK *) x = 42; (* hopefully a statement with no effect warning *) If assignment is a statement, it's possible to use the same token. Classic BASIC: 10 X = 5 20 IF X = 5 GOTO 10 This doesn't cause the C problem of…
The Linux Backdoor Attempt of 2003 (2013)
101–110 of 144 posts
Re: The Linux Backdoor Attempt of 2003 (2013)
#102This is an obvious backdoor attempt, as the code doesn't make sense otherwise. Yet, the attempt was far too unsubtle and underspecific for agencies such as the NSA. The payoff was low compared to the possibilities - local privilege escalations were a dime-a-dozen. Worse, agencies such as the NSA have two missions: offence and defence. Adding in backdoors helps the offensive mission, but hurts the defensive mission, s…
> 2) It was a warning shot from some Western agency meaning "tighten up your security". That's an interesting theory that'd certainly make for a powerful message. Has anything like that been done before or is there any precedence for Western agencies to do these sorts of things covertly?
Re: The Linux Backdoor Attempt of 2003 (2013)
#103Earlier quoted context omitted.
It is not so easy, it is a contest, and they show you the winners. 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…
now I'm wondering if syntax highlighting shouldn't somehow make an assignment inside an if statement (and the variants) a bright red, or something like that.
Re: The Linux Backdoor Attempt of 2003 (2013)
#104Re: The Linux Backdoor Attempt of 2003 (2013)
#105Earlier quoted context omitted.
now I'm wondering if syntax highlighting shouldn't somehow make an assignment inside an if statement (and the variants) a bright red, or something like that.
It should really be forbidden by the compiler these days, or at least a very loud warning.
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.Re: The Linux Backdoor Attempt of 2003 (2013)
#106ITT: everyone pretending they've never burned hours troubleshooting only to find a stupid `=` instead of a `==`.
We’ve all been there! /s
Re: The Linux Backdoor Attempt of 2003 (2013)
#107There should be safe guards against such errors. Even with approval, the reviewer may not notice it. Which brings up the question: how many more root-based backdoors are there now in the source code?
Unfortunately in C and its derivatives, the safeguards would have to be external tools (static analysis, linters); it's a perfectly valid statement in code. I wouldn't mind if languages simply mark assignments in conditions as errors. It's clever code, but clever code should be avoided in critical systems. And in general, I guess.
if let userID = 0 {}
vs if userID == 0 {}
The let syntax makes this error more obvious.Re: The Linux Backdoor Attempt of 2003 (2013)
#108Earlier quoted context omitted.
If memory serves me right the CVS bug was originally discovered and exploited by a member of an infamous file sharing site. After descriptions(?) of that bug were leaked in underground circles, an east European hacker wrote up his own exploit for it. This second exploit was eventually traded for hatorihanzo.c, a kernel exploit, which was also a 0-day at the time. The recipient of the hatorihanzo.c then tried to backd…
This sounds like a very interesting tale. Are there more details written somewhere? How close to first-person is your source of information?
Re: The Linux Backdoor Attempt of 2003 (2013)
#109ITT: everyone pretending they've never burned hours troubleshooting only to find a stupid `=` instead of a `==`.