I think my jaw actually dropped when I read the details of this security alert: Opera *nixed by security bug
First of all, it's exactly the same problem that was reported for Firefox two months ago. Don't these guys read security alerts even in their own arena?
But even more annoying is that this shouldn't have happened to either of them: the "bug" was misusing or allowing backticks to be passed through to the shell. That's just stupid, and is rookie programmer stuff: if you need to use backticks yourself, you have to rigorously sanitize anything you might put between them (a good general rule is simply "don't do that, period"), and if you are passing ANYTHING to a shell, you need to examine what you are passing and strip out backticks always.
There's no excuse for not doing that. People have been warning new programmers about backticks for years; do a Google search for "shell security backticks" and you'll see what I mean. This is basic level stuff, and it is beyond incredible that it bit these guys. I would like to charitably assume that this was just an error of sloppiness; because it was "just a shell script" programmers who darn well do know better just didn't look very closely. But it's still disturbing, isn't it?
Maybe this points up a problem in current security reporting: the lack of a shame factor. If your app gets bit because of an obscure timing bug in the kernel, you certainly have my sympathy and I don't feel like somebody should be slapping you up the side of your head. But this kind of dumb mistake? Sheesh, the people responsible ought to be sent to the corner with a dunce hat for a few minutes.
Security advisories just report the facts without editorial comment other than perhaps a severity rating. Maybe they should also start having a "Duh!" rating: a buffer overflow exploit would be a "Duh!" of 10, not filtering backticks would get you the same, while an obscure bit misinterpretation in a tcp header might only be a 2 score. This one might be a 20 because of the same thing biting Firefox before them. Maybe the threat of an embarassing "Duh!" rating would cause more careful code review.
Oh well. We all make mistakes. I have been yanked out of a sound sleep by a dream in which I think I've done something really stupid in a cgi script, and at least once that was true (fortunately my error was never exploited). Opera is a great browser in spite of this lapse. Hopefully these slip ups will cause all programmers to look more closely at their own code and we won't have more of this kind of nonsense. I do think a "Duh!" rating might help encourage that.
Got something to add? Send me email.
More Articles by Anthony Lawrence © 2009-11-07 Anthony Lawrence