I should tease apart two things:


Yes, the general issue is the ability to link and run arbitrary libs at compile time. That’s the main point below, a concern we had that appears to be arising in the wild for languages that went down that path.


But, secondarily, I thought it’s also related to the narrower issue of Trusting Trust attacks because Thompson’s initial approach required a specially-crafted compiler binary that already carried the malicious code, whereas the ability to execute arbitrary libraries at compile time (esp. malicious ones that can do introspection) could give a new vector to inject Trusting Trust attacks… the compiler can be totally pristine, but comes with a launchpad to let you provide the malicious code later. No?




From: JF Bastien <cxx@jfbastien.com>
Sent: Saturday, May 15, 2021 3:34 PM
To: sg7@lists.isocpp.org
Cc: Hana Dusíková <hanicka@hanicka.net>; Chandler Carruth <chandlerc@gmail.com>; Herb Sutter <hsutter@microsoft.com>
Subject: Re: [SG7] Thompson Turing lecture


It's not really the same issue: trusting trust is about the compiler changing the code it's compiling (including changing a compiler it's compiling to continue having this behavior), whereas the Rust thing is that macros can execute arbitrary Rust including networking code. The Rust problem is equivalent to putting arbitrary code in your makefile. It's something that you could sandbox and disallow (say, by running the compiler in a container). Whereas trusting trust is very hard to detect because the compiler's output binary is what's been compromised and you can't easily tell.


On Sat, May 15, 2021 at 3:24 PM Herb Sutter via SG7 <sg7@lists.isocpp.org> wrote:

Below, I emailed the “Trusting Trust” reference during our SG7 session on Circle in Prague, because SG7 was in the middle of discussing concerns about Circle’s approach of linking arbitrary libraries and executing them at compile time.


Since yesterday, I noticed the following tweets about Rust…


Tony “Abolish ICE” Arcieri 🦀 on Twitter: "Exfiltrating secrets with @rustlang macros: leveraging macro expansion in IDEs to exfiltrate secrets without compiling the code or even opening a file https://t.co/M2qhsfaLdX" / Twitter


Ralf (RPW) on Twitter: "„Open innocent_app in VSCode*, and the contents of your .ssh/id_rsa file will be sent over TCP to localhost:8080. You don't even need to open any files in the project!“ https://t.co/eKx2CWrirD" / Twitter


Björk on Twitter: "@hankadusikova ... Wait, what? You can do compile-time I/O (networking) in Rust, or is this because of plugins executing arbitrary code? https://t.co/soA3bD9vT2" / Twitter


David "Bear Feeder" Pollak🐈 on Twitter: "Oh crap! This will be 2021’s side channel attack… guess we have to run our compilers in containers with no network access…" / Twitter


This sounds a lot like the same issue… is it?


(Ah, I just saw Hana’s tweet before hitting Send – yup, sounds like it is the same issue, thank you Hana.)




From: Herb Sutter
Sent: Thursday, February 13, 2020 7:59 AM
To: sg7@lists.isocpp.org
Subject: Thompson Turing lecture



As we we think about extensible compilers and JITs, this is a classic paper worth remembering about supply chain issues with just ordinary closed compilers.




SG7 mailing list