4 ms·
Given that these attacks target simple typos on high-download packages, is there no avenue for repositories to implement an “are you sure you want to download t
by yunruse 4y ago
Given that these attacks target simple typos on high-download packages, is there no avenue for repositories to implement an “are you sure you want to download this” feature? Some heuristic on the Levenshtein distance and download count, say on the top 100, would go a long way to preventing these kind of attacks.
(With some --ignore-typo-suggestion just in case of automated edge-cases, of course :)
- louislang 4y agoThis would be an incredibly useful feature, I think. It was part of the motivation for our sandbox, honestly. It should mostly operate as a pass through the the various package managers - but with some extra security checks. In this way a `phylum npm install <pkgName>` would perform the typosquat checks _and_ limit access to system resources. You can even alias this as `alias npm="phylum npm"` so that it's easier for the user.
- hinkley 4y agoI participated in some Freenet architecture discussions when they were still trying to take the prototype to a practical implementation. There was some talk even back then about how opaque hashes are to the human mind and that we might be better off using phrase mnemonics instead. Particularly useful I would think for transcription errors like this, malicious or accidental. The problem is that the information density of replacing hex with words is quite low, on the order of 14 bits per word, but much longer than the four letters needed to represent 16 bits in hex, which is itself a lot less dense than base64. You’d need 12 words to uniquely identify a sha-1 hash and most modern algorithms are less dense than that. But it would be harder to trick someone. Maybe there’s some sort of 5:4 coding system that’s easier for humans to scan, still to be discovered out there?
- chrisshroba 4y agoI think you may have intended to respond to this comment? [1] [1] https://news.ycombinator.com/item?id=33512203 https://news.ycombinator.com/item?id=33512203
- hinkley 4y agoSimilar observation, posted at the same time. I just have a bit more context. Eyeballs glaze over looking at hex or base64 identifiers. It's a shame that in practice you likely can't use something that the eyes don't gloss over because you lose too much density in the process. I'm happy to be proven wrong by someone who finds something in the middle. Preferably without using emojis...
- tikkabhuna 4y agoProducts like Nexus Firewall[0] have settings to block suspicious packages. [0] https://blog.sonatype.com/sonatype-releases-new-nexus-firewall-policy-to-secure-software-supply-chains-from-dependency-confusion-attacks https://blog.sonatype.com/sonatype-releases-new-nexus-firewa...