Ken Thompson implements compiler backdoor demo
In his 1983 Turing Award lecture (published 1984), Ken Thompson described an experiment he likely implemented years earlier at Bell Labs. He modified the Unix C compiler (cc) binary to insert a backdoor into the login program during compilation.
Story
Thompson's "trusting trust" attack moved the backdoor out of the source file and into the compiler binary. The login program could look clean. The compiler that built it could still put the trap back.
The first trigger recognized source for login and emitted extra code that accepted a chosen password. The second trigger recognized source for the C compiler and emitted a new compiler that preserved both triggers. Recompilation did not cleanse the system. It reproduced the compromise.
The uncomfortable part is that every visible artifact can look reasonable. The login source is clean, the compiler source is clean after the bootstrap, and the compiler binary is the only place the knowledge survives. Verification has to reach below the text developers normally review.
The attack was an experiment, not a public distribution incident with known victims. Its force is in the model. Source review is not enough when the tool that reads the source is already hostile.
Modern build security keeps returning to this point. Bootstrapping, reproducible builds, signed provenance, and diverse double-compilation all answer the same old question: who compiled the compiler?
Affected Artifacts
Unix C Compiler (Bell Labs Experiment)
- Observed
- 1983-07-01 to 1983-08-01
- Compromised Versions
- Unknown
- Fixed
- Not listed
- Evidence
- mirror: cs.cmu.edu/~rdriley/487/papers/Thompson_1984_ReflectionsonTrustingTrust.pdf, mirror: wiki.c2.com, observable: unix:/usr/bin/cc, observable: unix:/bin/login
- Affected Bell Labs Unix compiler version is historical/internal and not recorded as a precise package version.
Incident Context
- Motive
- Experimentation Notoriety
- Attribution
- Maintainer
- Cause
- Sabotage
- Transitive
- Yes
- Actor
- Author
External References
Source record: oss/attacks/cpp/meta.yaml