Note that the qualification of “no runtime” is not made in the claim. I presume that is inferred because the cross-compilation makes dynamic (during runtime) evaluation tricky. That is not applicable to “single platform” though.
Dynamic cross-compilation evaluation is tricky, but static evaluation, while less accurate, still works well. Meaning that you analyse the resultant binary for a) strings analysis b) library calls analysis c) a combination of other methods that are more use-case specific (like Ransomware will always try to contact a controlling server using (often) domain name generation until it finds a hit (response). This is because the attacker needs the symmetric key or he cannot reverse the encryption after the ransom is paid. Very similar means will be used for gaining a backdoor into compiled code for remote exploitation.
Unfortunately the 99% accurate behavioural analysis malware detector I worked on (as a team effort mind you) is fenced off and costs a couple of hundred thousand dollars as part of a security suite for corporations.
Obviously I don’t have all the answers though and the discussion on the implementation details is ongoing at https://internals.rust-lang.org/t/security-fence-for-crates/8005/35?u=drizztvd
I have the same question about the crate granularity analysis there - I have some ideas on how to do this there. (it is where the similarity of my prior experience versus this problem set ends).
I should note that I’m also being cheeky with my challenge to @bgeron (but trying to stay on the right side of respectful). I don’t mean to shoot all his comments down, just the ones that come with “cannot be done” and “basically only possible” - which is a great way to set yourself up for being proven wrong in life. My managers thought the malware analzer wil work like… 60% of the time, and not work at all on new classes of malware. Then, I think it was WannaCry, came out and bam!!! the behavioural analsis with trained deep neural net caught it dispite being a ‘new class of malware’ according to the definition used by the system (I could be mistaken on the name of the malware, but the idea remains true).