<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 9, 2024, 10:57 Andreas Schwab <<a href="mailto:schwab@linux-m68k.org" rel="noreferrer noreferrer noreferrer" target="_blank">schwab@linux-m68k.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Apr 09 2024, <a href="mailto:anderson.jonathonm@gmail.com" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">anderson.jonathonm@gmail.com</a> wrote:<br>
<br>
> - This xz backdoor injection unpacked attacker-controlled files and ran them during `configure`. Newer build systems implement a build abstraction (aka DSL) that acts similar to a sandbox and enforces rules (e.g. the only code run during `meson setup` is from `meson.build` files and CMake). Generally speaking the only way to disobey those rules is via an "escape" command (e.g. `run_command()`) of which there are few. This reduces the task of auditing the build scripts for sandbox-breaking malicious intent significantly, only the "escapes" need investigation and they which should(tm) be rare for well-behaved projects.<br>
<br>
Just like you can put your backdoor in *.m4 files, you can put them in<br>
*.cmake files.</blockquote></div></div><div dir="auto"><br></div><div dir="auto">CMake has its own sandbox and rules and escapes (granted, much more of them). But regardless, the injection code would be committed to the repository (point 2) and would not hold up to a source directory mounted read-only (point 3).</div><div dir="auto"><br></div><div dir="auto">If your build system is Meson, you can easily consider CMake code to be an escape and give it a little more auditing attention. Or just avoid shipping CMake scripts entirely, they are are rarely necessary.</div><div dir="auto"><br></div><div dir="auto">-Jonathon</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>