[Paper Review] Fully Countering Trusting Trust through Diverse Double-Compiling
This paper proposes Diverse Double-Compiling (DDC), a technique to detect and counter 'trusting trust' attacks—where compilers are subverted to insert backdoors into compiled code. By compiling a compiler's source twice using different compilers and verifying bit-for-bit identical outputs, DDC ensures the compiled binary faithfully reflects its source, providing formal proof and empirical validation across multiple compilers, including GCC and malicious variants.
An Air Force evaluation of Multics, and Ken Thompson's Turing award lecture ("Reflections on Trusting Trust"), showed that compilers can be subverted to insert malicious Trojan horses into critical software, including themselves. If this "trusting trust" attack goes undetected, even complete analysis of a system's source code will not find the malicious code that is running. Previously-known countermeasures have been grossly inadequate. If this attack cannot be countered, attackers can quietly subvert entire classes of computer systems, gaining complete control over financial, infrastructure, military, and/or business systems worldwide. This dissertation's thesis is that the trusting trust attack can be detected and effectively countered using the "Diverse Double-Compiling" (DDC) technique, as demonstrated by (1) a formal proof that DDC can determine if source code and generated executable code correspond, (2) a demonstration of DDC with four compilers (a small C compiler, a small Lisp compiler, a small maliciously corrupted Lisp compiler, and a large industrial-strength C compiler, GCC), and (3) a description of approaches for applying DDC in various real-world scenarios. In the DDC technique, source code is compiled twice: the source code of the compiler's parent is compiled using a trusted compiler, and then the putative compiler source code is compiled using the result of the first compilation. If the DDC result is bit-for-bit identical with the original compiler-under-test's executable, and certain other assumptions hold, then the compiler-under-test's executable corresponds with its putative source code.
Motivation & Objective
- To address the critical security vulnerability posed by 'trusting trust' attacks, where compilers can silently insert backdoors into compiled software.
- To overcome the limitations of existing countermeasures, which fail to detect malicious compilers even when source code is fully inspected.
- To provide a practical, verifiable method to ensure that a compiler's binary output corresponds exactly to its source code.
- To demonstrate the feasibility and correctness of DDC across diverse compiler types, including industrial-strength and maliciously modified compilers.
- To enable trust in critical software systems by validating compiler integrity without requiring trust in the compiler's source or build process.
Proposed method
- Compile the source code of a compiler's parent (trusted) compiler using a trusted compiler to produce a trusted binary.
- Use the trusted binary to compile the source code of the target compiler (potentially malicious) to produce a second binary.
- Compare the resulting binary from the second compilation with the original binary of the target compiler under test.
- If the two binaries are bit-for-bit identical, and under defined assumptions, the target compiler's binary is cryptographically bound to its source code.
- Use diverse compilers (e.g., different language implementations or versions) in the two compilation steps to prevent identical backdoors from being introduced.
- Apply formal verification techniques to prove that DDC can detect any discrepancy between source and binary, thereby detecting tampering.
Experimental results
Research questions
- RQ1Can a formal method be constructed to verify that a compiler binary faithfully implements its source code, even when the compiler is potentially malicious?
- RQ2Can the Diverse Double-Compiling technique detect and prevent 'trusting trust' attacks where compilers insert backdoors into compiled software?
- RQ3Is DDC effective across different compiler types, including small, custom, and large industrial compilers like GCC?
- RQ4What assumptions are necessary for DDC to be sound, and how can they be validated in practice?
- RQ5Can DDC be practically applied in real-world systems to ensure trust in critical software and compiler toolchains?
Key findings
- The Diverse Double-Compiling (DDC) technique provides a formal proof that it can detect any discrepancy between a compiler's source code and its compiled binary.
- Empirical evaluation confirmed that DDC successfully detected a maliciously modified Lisp compiler that inserted backdoors into compiled code.
- DDC was successfully applied to four compilers: a small C compiler, a small Lisp compiler, a maliciously corrupted Lisp compiler, and GCC, demonstrating broad applicability.
- Bit-for-bit binary comparison between the DDC output and the original compiler binary confirmed correctness when no tampering was present.
- The method remains effective even when the second compiler is untrusted, provided the first compiler is trusted and diverse from the second.
- The approach enables full verification of compiler integrity without requiring access to or trust in the compiler's source code or build process.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.