For this specifically, youâre already downloading code, compiling it to a binary, and running that binary. Downloading and running a binary is no more problematic, as you still have to trust the distribution, unless youâre in the habit of auditing the actual code youâve downloaded.
Said cache would definitely want to be the one providing the compiled binaries rather than trusting uploaders to send the correct one, so that you only have to trust one source instead of many, but you still have to trust the distributer.
I donât see how downloading a binary is any more dangerous than downloading the code and compiling it (other than local CPU time). If the host is complicated (knock on wood), they can alter either. If hashes are used to prevent this from a separate source, they prevent either, or if from the same source, neither.
Yes, downloading unsandboxed code and running it is a security risk, and itâs one thatâs only solved by trusting the source. But the risks are the same for pre-compiled or not. You can even stick in a verification that the pre-compiled binary is the same as what you get building the code when you audit it, if youâre actually auditing the code. If itâs been built already, a trusted source confirms itâs built correctly, what would you benefit from building it again?
(This is assuming itâs being built with the same flags of course, if you have a rare configuration youâd just build it locally.)
TL;DR: assuming reproducible builds, what risk does downloading a hash-verified binary have that a hash-verified source doesnât? As far as I can tell, the trust problem is identical to both of them.