by n2d4 · 3y ago · 0 comments
In Git itself maybe, but many tools and developers rely on or automatically assume that commit hashes are collision resistant. For example from the GitHub Actions docs:
> Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
https://docs.github.com/en/actions/security-guides/security-...
You can shift some of the blame to the user if something goes terribly wrong, but at least partly it's also the tool's fault. Git's security is a footgun that is hardly productive.
Believe me, if Git were fundamentally broken, the issue would've been fixed already. It's in that "uncanny valley" of security issues, where it's bad enough to cause damage, but not bad enough to get people to stop what they're doing and fix it.
Solution seems to be don't. Use the tool as the tool was intended.
Traditionally a lot of the usefulness from tools comes from people doing things that were not intended. The modern web springs to mind, it was a terrible hack in the grand old IE days.
It is better for tools to have obvious failure modes.
Make tools better and safer when there are good opportunities.
But this assumption was proven wrong infinite many times already.
Shouting RTFM didn't help, even after decades of doing so.
Actually it's getting worse.
Copy'n'paste form Stackoverflow without understanding anything was likely only a warmup. Now we're going to get AI generated code.