You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was browsing the LunarVim source code, and happened upon the the snapshot.json file, which at this time of writing uses 7-digit commit hashes. It seems like these are formatted as such by the lockfile update script, here and here.
There's a nice blog post about the dangers of using short commit hashes. tl;dr GitHub returns 404 when there is an ambiguous commit hash, so it's quite easy to set up a DOS-attack on any system relying on 7-digit hashes, simply by forking any lvim core plugin repo and pushing a commit with the same first 7 digits.
Now, someone's LunarVim update failing is probably not the end of the world in the grand scheme of things. And GitHub may have done things since 2019 to protect repos from such an attack. So maybe it doesn't really matter that LunarVim uses 7-digit hashes. But is there any good reason for using a 7-digit hash?
Disclaimer: I don't actually use/daily-drive LunarVim myself---I just noticed this while investigating a versioning-related bug, and happened to recently come upon that blog post while studying the design of nixpkgs.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was browsing the LunarVim source code, and happened upon the the
snapshot.json
file, which at this time of writing uses 7-digit commit hashes. It seems like these are formatted as such by the lockfile update script, here and here.There's a nice blog post about the dangers of using short commit hashes. tl;dr GitHub returns 404 when there is an ambiguous commit hash, so it's quite easy to set up a DOS-attack on any system relying on 7-digit hashes, simply by forking any lvim core plugin repo and pushing a commit with the same first 7 digits.
Now, someone's LunarVim update failing is probably not the end of the world in the grand scheme of things. And GitHub may have done things since 2019 to protect repos from such an attack. So maybe it doesn't really matter that LunarVim uses 7-digit hashes. But is there any good reason for using a 7-digit hash?
Disclaimer: I don't actually use/daily-drive LunarVim myself---I just noticed this while investigating a versioning-related bug, and happened to recently come upon that blog post while studying the design of nixpkgs.
Beta Was this translation helpful? Give feedback.
All reactions