For me this is much less “OMG how could they be so careless” and much more “There but for the grace of a diligent set of testers go I”
If you wanted 10x better, you could throw in some code that exhibits undefined (but known on major compilers) behavior, or super subtle C issues. Even a simple if statement in C forces all kinds of wonderful promotions and type conversions which can truncate, wrap, and drastically change values in ways that even most C developers aren’t aware.
I encourage folks to go check out the “underhanded C contest” before suggesting that this bug is a backdoor.
*The person who found this, Peter, is indeed insanely good.
Or do like WEP and recycle your one time pads. Lots of subtle design flaws one can introduce that generally get spotted in blackbox testing, and not in code.
If I were to put a backdoor into this code, I’d want the following properties:
- tricky to spot in code review
- virtually undiscoverable via current best-of-breed fuzzing
- tricky to spot in network captures or any type of IDS
This bug passes #2 (unless you’ve got a state-aware network fuzzer and panic() in the right places), but fails on the other two.
But who knows, maybe this was a low-investment effort and it paid off for some time, with a trivial-to-exploit (IE no mem corruption) bug they knew would eventually be retired?