by micouay on 10/17/22, 3:53 PM with 159 comments
by burntsushi on 10/17/22, 4:01 PM
(I'm the author of ripgrep.)
by woodruffw on 10/17/22, 5:26 PM
by richdodd on 10/18/22, 11:04 AM
I also squatted `memap` and `memap2` for the same reasons.
I wonder if there is an algorithmic way to decide when two crate names are 'near' each other. Then, if you added a crate with `cargo add` and there is another similarly-named crate with much higher usage, a warning could be emitted.
*EDIT* I know there's already https://en.wikipedia.org/wiki/Levenshtein_distance, but I wonder if there is a better measure that looks at e.g. keyboard layouts and likely typos. I'm sure there will have been research done on this.
by samatman on 10/17/22, 6:38 PM
That way "ripgrep" could include "rg", searching cargo for "rg" brings back "ripgrep", not a second package named "rg", and an install could tell the user the correct name for any attempt to install it.
This also covers typo-squats, so there would be no need for packages like "memap".
Obviously this represents a low-effort vector for massive squatting, so maintainers would need to be responsible for preventing that, and could add some typos themselves, being the ones which see the request for the mis-typed packages.
by mherdeg on 10/17/22, 6:44 PM
by micouay on 10/17/22, 3:53 PM
println!("You meant to install ripgrep: type `cargo uninstall rg` followed by `cargo install ripgrep`");
by jfk13 on 10/17/22, 5:52 PM
Not sure how to feel about this... on an individual-package level, it seems a sensible enough idea, but if it becomes a widespread practice, the namespace could get really cluttered.
by filereaper on 10/17/22, 7:06 PM
This installs a library by some authors not affiliated with AWS.
Instead of: `pip install awscli`
Which is what you expect.
by noswi on 10/17/22, 5:23 PM
I can't believe that a good way to see what's inside is to make a rust project, add the crate and then go searching around the local filesystem.
by remram on 10/17/22, 5:22 PM
This one just depends on the correct `scikit-learn` package though.
by fregante on 10/18/22, 3:33 AM
https://github.com/fregante/npm-helpful-typosquatting
Here’s what it looks like: https://www.npmjs.com/package/webext
by typon on 10/17/22, 8:22 PM
by rpigab on 10/18/22, 8:48 AM
I love Python but pip/pypi and imports always felt wierd to me because of namespaces, package names, special imports "as", etc., maybe this is a bias because I started using them when I was younger and now I'm more experienced, I already know how to use most package managers.
BTW Ripgrep is awesome, I'm learning Rust and it's an inspiration to me, thanks burntsushi!
by chlorion on 10/18/22, 12:09 AM
I can imagine for example, importing keys from only the authors that I think I can trust, and passing a flag to cargo that only allows using those packages for cargo install or cargo add.
In this case I think just checking the top level crates signature (and not dependencies) would be enough to mitigate a lot of issues including typo squatting.
by ashishbijlani on 10/18/22, 5:03 AM
by underyx on 10/17/22, 5:29 PM
by worewood on 10/17/22, 7:39 PM
by thombles on 10/17/22, 9:55 PM
by benreesman on 10/17/22, 8:48 PM
by seanw444 on 10/17/22, 5:04 PM
by bmn__ on 10/18/22, 6:40 AM
by debacle on 10/17/22, 7:09 PM
Edit: Because I'm on a Zoom call that will never end.
"ripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern. By default, ripgrep will respect gitignore rules and automatically skip hidden files/directories and binary files."
by c7DJTLrn on 10/17/22, 7:19 PM
by totorovirus on 10/18/22, 5:16 AM
by low_tech_punk on 10/18/22, 3:23 AM
by secondcoming on 10/17/22, 8:53 PM
by notorandit on 10/18/22, 6:30 AM