News for hackers. Stuff that matters.
Re:Malicious Python Packages Replace Crypto Addresses in Dev... by yunruse on Monday November 07, 2022 @03:01PM (#33511522)
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 :)

Re:Malicious Python Packages Replace Crypto Addresses in Dev... by louislang on Monday November 07, 2022 @03:06PM (#33511615)
This 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.

Re:Malicious Python Packages Replace Crypto Addresses in Dev... by hinkley on Monday November 07, 2022 @03:49PM (#33512228)
I 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?

Re:Malicious Python Packages Replace Crypto Addresses in Dev... by chrisshroba on Monday November 07, 2022 @04:27PM (#33512748)
I think you may have intended to respond to this comment? [1]

[1] https://news.ycombinator.com/item?id=33512203

Re:Malicious Python Packages Replace Crypto Addresses in Dev... by hinkley on Monday November 07, 2022 @08:19PM (#33514862)
Similar 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...

Re:Malicious Python Packages Replace Crypto Addresses in Dev... by tikkabhuna on Monday November 07, 2022 @03:53PM (#33512272)
Products like Nexus Firewall[0] have settings to block suspicious packages.

[0] https://blog.sonatype.com/sonatype-releases-new-nexus-firewa...