Skip to content

Conversation

bcoe
Copy link
Contributor

@bcoe bcoe commented Aug 25, 2017

Problem Statement

We're looking for better ways at npm to mitigate typosquatting attacks based around popular package names.

The npx tool also has an issue open in which they're discussing using npm/npms.io's search engine to protect users from this category of attack, e.g.,

npx i babel-cl

Proposed Solution

Using npms.io's quality rankings, and ElasticSearch's fuzzy search functionality, this pull request introduces a new method search.similar that will return similar packages (including the package itself, as a note for implementers) if they meet an appropriate _score threshold, i.e.,

  • the package is popular.
  • and the package has a reasonably similar name.

CC: @zkat @rockbot

@coveralls
Copy link

coveralls commented Aug 25, 2017

Coverage Status

Coverage decreased (-0.7%) to 99.31% when pulling 9b84fed on typosquatting into 18a7469 on master.

@npms-io npms-io deleted a comment from coveralls Aug 25, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 99.31% when pulling 745d47a on typosquatting into 18a7469 on master.

@satazor
Copy link
Member

satazor commented Aug 26, 2017

Looks great!

@satazor satazor merged commit 383f168 into master Aug 26, 2017
@satazor satazor deleted the typosquatting branch August 26, 2017 04:02
@satazor
Copy link
Member

satazor commented Aug 26, 2017

Ping me tomorrow to launch a new version. I'm currently replying from the phone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants