Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

It is a well known vulnerability that a properly altered compiler binary can transfer itself to new binaries of the compiler, and still be entirely absent from the source code.

But how real is this possibility? Has there been any attempt to audit binaries in available compilers (gcc for instance) to detect such self-replicating vulnerabilities?

share|improve this question
    
One way to carry out such an audit would be to compile the same source with multiple different compilers (e.g. compile gcc with gcc and Intel's icc) then run static analysis tools on the resulting binaries to see where (if ever) their logic differs. –  Michael Aug 5 '13 at 17:39

1 Answer 1

up vote 6 down vote accepted

It is not actually "well known". The story comes from a classic must-read article from Ken Thompson. Though it was implemented at that time as a demonstration, it would be challenging to do it on a larger scale.

The main problem here is about software updates. For the malicious binary chunk to be reinjected in the compiler, should the compiler be recompiled with itself, that code must know where, precisely, it should hook itself. And this may change between versions of the compiler. When a GCC developer makes some changes in the source code, he may unwillingly break the hooking mechanism of the hypothetical replicating virus, and he would not know it. But future changes by developers cannot be predicted, let alone be accounted for in a virus which must then work in an autonomous manner.

Or, said otherwise, succeeding at writing a piece of (malicious) code which resists more than 20 years of updates and overhauling of a software as complex as GCC, would be a remarkable engineering feat, and I doubt mankind as a whole knows enough about computers to achieve that. Yet.

In the old Thompson situation, the C compiler software was not changed, only recompiled, and that made the whole thing easy (a fun and philosophically challenging eye-opener, but still technically easy).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.