5 ms·
It's not quite as bad as it sounds: I don't think even the NSA has people smart enough to insert code into a compiler which will add backdoors to software which
by cperciva 13y ago
It's not quite as bad as it sounds: I don't think even the NSA has people smart enough to insert code into a compiler which will add backdoors to software which didn't yet exist when the compiler was written.
If you're paranoid, use software written in the past 5 years and compile it on a system running FreeBSD 4.1 off a CD which you've had in your closet for the past decade.
- bvttf 13y agoI knew I was keeping all those discs for a reason!
- AnIrishDuck 13y ago> I don't think even the NSA has people smart enough to insert code into a compiler which will add backdoors to software which didn't yet exist when the compiler was written. I doubt such a thing is possible given the current state of the art in program analysis. Even if it were possible, it's hard to imagine it being undetectable (e.g. it would probably cause massive slowdowns in compilation). > If you're paranoid, use software written in the past 5 years and compile it on a system running FreeBSD 4.1 off a CD which you've had in your closet for the past decade. If you have a trusted compiler, you can bootstrap any non-trusted one [1]. That said, I suspect implementing diverse double-compiling to build any nontrivial system would take significant work. 1. http://www.dwheeler.com/trusting-trust/ http://www.dwheeler.com/trusting-trust/
- russellsprouts 13y agoIt's better than that -- you don't have to trust either compiler, just that they both don't have the same backdoor.
- sillysaurus2 13y agoI don't think even the NSA has people smart enough to insert code into a compiler which will add backdoors to software Really? Why wouldn't they? That's one of the most valuable attack vectors, precisely because it's so difficult. I wouldn't have guessed the NSA had people smart enough to break Windows Update's encryption using a brand-new cryptographic technique that also required several hundred thousand dollars of machine time to execute, but it happened nonetheless. We have to start thinking ahead, e.g. by making deterministic builds a standard procedure: https://blog.torproject.org/blog/deterministic-builds-part-one-cyberwar-and-global-compromise https://blog.torproject.org/blog/deterministic-builds-part-o...
- ajross 13y ago> Why wouldn't they? That's one of the most valuable attack vectors, precisely because it's so difficult. If this logic made any sense then we should just give up, as their megabit-scale quantum computers have already cracked all keys on the planet. My guess is you forgot the bit of the sentence you clipped.
- sillysaurus2 13y agoDeterministic builds do more than merely defend against the Trusting Trust attack (what you and cperciva are dismissing as a flight of fancy equivalent to worrying about megabit-scale quantum computers in 2013) --- they also prevent compromised open-source binaries, a much more serious and realistic attack vector. So we need to start implementing deterministic builds into every major open source project if we're even pretending like we care about putting up resistance to what's going on. If Tor browser can do it in just a few weekends, then so can we for mainstream Firefox, and hopefully eventually Ubuntu.
- quasque 13y ago> I wouldn't have guessed the NSA had people smart enough to break Windows Update's encryption using a brand-new cryptographic technique that also required several hundred thousand dollars of machine time to execute, but it happened nonetheless. That's rather unsettling. Do you have any further information on this?
- tedunangst 13y agoThat's the "telephone game" retelling of the Flame virus.
- ivanr 13y agosillysaurus2 is talking about the Flame malware, which used a previously unknown MD5 collision attack technique: http://blog.cryptographyengineering.com/2012/06/flame-certificates-collisions-oh-my.html http://blog.cryptographyengineering.com/2012/06/flame-certif... Why are you finding it unsettling? I think that's exactly what the NSA do: stay ahead of everyone else and take advantage of what they know. In this case, a different MD5 collision attack technique was invented by Marc Stevens at about the same time frame, so you couldn't even say that [whoever wrote Flame] was ahead by a lot. I have found it more interesting that they knew about the Microsoft design errors that they exploited to break the update mechanism. And, of course, wondered if the design errors were not forced.
- _quasimodo 13y agoI dont think it is as hard as it it sounds. Consider, for example, hooking all fclose function calls and testing on every call whether * you have write permission on the file, * its an object file, * its in an architecture your exploit supports, * it uses the fclose function (or the corresponding system call, if it is linked statically) * and your exploit is not already present. If those conditions are true, hook the fclose calls in the object file before actually closing it, otherwise just close it normally.
- PeterisP 13y agoIf I understand your proposal correctly, it would be found out almost immediately, as file checksums would be altered and quite a few places do check them.
- _quasimodo 13y agoMy idea was that, if you have an object file open with write permissions, you can assume that it has been created/modified anyway, and people will expect the checksum to change. Of course this does not work if the checksum is calculated before the file is closed by your backdoored compiler.
- atmosx 13y agoGood, so don't give them ideas.
- MacsHeadroom 13y ago>don't think even the NSA has people smart enough to insert code into a compiler which will add backdoors to software which didn't yet exist when the compiler was written. Oddly enough, that is almost exactly how the Flame malware worked. It injected itself into a compiler, causing the compiler to silently compile malicious code into custom firmware being compiled for nuclear reactor control equipment. So at least one state actor has done just that at least once.
- harrytuttle 13y agoGCC's optimiser does some crazy shit sometimes including removing necessary code in -O3. Perhaps some of that crazy could be related? As for using FreeBSD 4.1 off a CD in your closet, I recently set up an NT4 machine with SP2 (requirement!) that was to be used entirely offline. Surprisngly it booted and works fine on a brand new Intel chipset H61 based machine with an SSD in it (graphics are stuck at 800x600x16 but that's a requirement too).