RomHack Camp 2026

Trusting Trust, Hands On: Building a Self-Reproducing Compiler Backdoor
2026-10-03 , WORKSHOP 2 (GetRoot no Jutsu)
Language: English

In 1984 Ken Thompson, during his Turing Award acceptance speech, introduced to the world a very interesting kind of backdoor, described by himself as "the cutest program I have ever wrote". The speech has later been written in an article called "Reflections on Trusting Trust".

The idea is simple: modify a C compiler in order to insert a backdoor into the login binary whenever the login.c program is compiled. The backdoor allows a specific username to bypass authentication and obtain root privileges. This is the simple step. Then comes the hack: the logic to introduce the backdoor will replicate itself whenever the compromised compiler is used to compile a new compiler. This means that once your compiler has been compromised, it becomes very hard to get rid of it. Because how do you compile a compiler? With the compiler you already have!

This workshop is all about compilers and backdoors. To make it practical we will apply it against a small but functional C compiler (TinyCC). We will show how to build a working Thompson backdoor step by step in a fun and reproducible way. We will talk about quines, about self-replication, and ultimately about why trust in software cannot be established by just reading the source code. The Thompson backdoor is now 40 years old, yet it is more relevant than ever, as modern supply-chain compromises e.g. SolarWinds can be reduced to similar trust-delegation problems in the supply chain of software as Thompson described.

I've discovered the beauty of Computer Science by reading "The Universal Computer - The Road from Leibniz to Turing" By Martin H. Davis and "Gödel, Escher, Bach: an Eternal Golden Braid
" by Douglas Hofstadter. Since then, I've been deeply fascinated by the subject. I went to university to study the theory behind computation, algorithms and programming languages, and it is during university that I also met the technicalities behind the beautiful world of computer hacking.

After university I worked as a penetration tester and cybersecurity trainer where I was able to learn the practical challenges that many business have to face when dealing with security from a management point of view as well as from a technical point of view.

Recently I've become a freelance trainer in Italy, helping companies on cybersecurity related topics such as secure coding and threat modeling, and I've started an independent educational project called Esadecimale, which aims to become one of the best places in Italy to learn about Computer Science, programming and Hacking.