3 ms·
>Timestamps are one of the biggest offenders >Nondeterministic codegen is just scary. Why not focus on deterministic codegen only? Caring about some metadata
by charcircuit 3y ago
>Timestamps are one of the biggest offenders
>Nondeterministic codegen is just scary.
Why not focus on deterministic codegen only? Caring about some metadata changing does not seem to be as useful from a security perspective.
- Quekid5 3y ago> Caring about some metadata changing does not seem to be as useful from a security perspective. If the metadata were neatly separated from the executable portions of an artifact then it indeed wouldn't be too much of an issue[1], but it often isn't. It sometimes gets embedded into strings and other places in the executable itself where it theoretically could have an impact on the runtime (and of course makes executable signatures unreliable, etc.). Without that separation comparing two potentially-the-same executables becomes equivalent to the Halting Problem. [1] You could sign only portions of the executable, for example... but such signature schemes are brittle and error-prone in practice, so best avoided. So you'd ideally want any and all metadata totally separate from the executable.
- charcircuit 3y ago>where it theoretically could have an impact on the runtime If there is a backdoor in the code there is a backdoor regardless of if there is an extra timestamp that exists.
- rocqua 3y agoIn order to trust signed binaries, it is very valuable to be able to verify a binary came from some source. This way anyone who signs modified code can be caught. This is especially easy with open source projects. Incidentally, Debian is working very hard on deterministic builds.
- charcircuit 3y ago>it is very valuable to be able to verify a binary came from some source. Code signatures have already existed for decades and do not require reproducable builds.
- bheadmaster 3y agoYes, but reproducible builds allow anyone to rebuild the code and verify that the compiled binary release corresponds to the upstream source code. Without deterministic builds, it's possible for the attacker to switch the compiled binary release and sign it with a stolen key with nobody noticing.
- chii 3y agobut if your threat model includes the key being stolen as a potential threat, then signing with said key would then be meaningless.
- rocqua 3y agoIt really limits the value of a stolen or leaked key. Similarly it limits the amount of trust you need in the key holder. If the NSA could steal a debian key (or coerce a packager), without deterministic builds, they could put a backdoor in a popular Debian package with barely any chance of getting caught. Deterministic builds make it much easier to detect this. That makes the value of such a stolen/coerced key much lower. Making it much less likely this gets attempted, and likely stopping anyone who used to try this attack.
- nonrandomstring 3y agoNo. In the latter case the "upstream source code" is the key, and the compiler is the functional transformation under scrutiny. Think of a triangle where we want two fixed (trustworthy) points to ascertain the third. Here our trusted principles are a repository (better multiple repositories) of source code, and a deterministic executable from someone who has already compiled using a known good compiler.
- bheadmaster 3y agoPerhaps, but with deterministic builds, anyone can read the source code, recompile, verify integrity of the signed code, and even sign it themselves as a confirmation of its integrity. The more (independent) signatures there are, the more you can trust the precompiled binary.
- eru 3y agoIf you can get your binaries bit-for-bit identical, any idiot (read: even a computer) can tell they are the same. If you have to make exceptions for some metadata, all of a sudden there's judgement and smarts involved. And judgement can go wrong.
- charcircuit 3y agoWhen a lot of software is mostly reproducible it may be easier to make the matching logic smarter instead of needing to chase down every possible build variation in every single application on Earth. >And judgement can go wrong. Which is why it is important to have a good design and threat model.
- eru 3y agoIn practice, chasing down the build variations has been proven workable with a good track record. See eg https://reproducible-builds.org/ https://reproducible-builds.org/
- charcircuit 3y ago>workable That page has progress reports that are 8.5 years old and the project is not close to be done. There are still thousands of Debian packages to go.
- eru 3y agoDefinitely, and they only have a limited pool of manpower. However, at least the problems with this approach are all in one direction: Bits differing might be due to an actual attack or because of weird compiler issues, but if you get the bits to be identical, you know that no funny business is going on. The proposal to have more complicated rules doesn't have this upside. And you still need to make sure that the things that actually matter are the same (like instructions in your binaries), even if you successfully separated out irrelevant metadata changes.