Package Typosquatting Checker (npm and PyPI)

Paste package.json or requirements.txt and see which dependency names are suspiciously close to a popular package, how they differ and how risky the near miss is.

Działa w Twojej przeglądarce. Twoje pliki nigdy nie opuszczają urządzenia. Zobacz, jak to sprawdzić

…

Jak to zrobić

  1. 1
    Paste dependencies

    Paste a manifest or lockfile, or type one name per line, or load a sample.

  2. 2
    Choose the registry

    Keep the detected registry or switch between npm and PyPI.

  3. 3
    Set the threshold

    Move the slider to decide from which score a name is flagged.

  4. 4
    Review matches

    Read the technique and detail for each flagged name and open the registry page.

  5. 5
    Mark trusted names

    Add names you have verified to the trusted box to silence them.

  6. 6
    Export

    Download the CSV with every name, score and lookalike target.

O tym narzędziu

Typosquatting on package registries is simple: an attacker publishes a package whose name is one keystroke away from a popular one, such as lodahs for lodash or reqeusts for requests, and waits for someone to mistype an install command or copy a bad snippet. Malicious packages of this kind are found on npm and PyPI every week, and they usually run code at install time. This checker compares each dependency name in your manifest with a bundled list of about 300 widely used npm and PyPI packages. It looks for one-character edits and swapped letters, visual lookalikes such as rn for m or a zero for o, names that differ only in separators, popular names with an extra prefix or suffix such as -js or python-, and scope tricks on npm such as @angu1ar/core or a scoped package flattened into an unscoped name. Each match gets a technique, an explanation and a risk score from 0 to 100, and names you have already checked can be marked as trusted.

Techniques the checker looks for

One character changed, added or removed is the most common pattern (expres, axois). Adjacent swapped letters score higher because they are a frequent typing slip (lodahs). Visual lookalikes use characters that look the same in many fonts: rn and m, vv and w, 0 and o, 1 and l, cl and d. Separator tricks differ only in a hyphen, underscore or dot; on PyPI those are treated as the same project by PEP 503 normalisation, so the score is low there, while on npm crossenv and cross-env are different packages. Affix tricks add words such as js, node, py, python, cli, dev or official to a popular name. On npm the checker also flags a lookalike scope, a popular unscoped name published under an unknown scope, and a scoped package name copied without its scope.

The risk score

Each technique has a base score, from 30 for PyPI separator variants to 92 for lookalike npm scopes, and the score is weighted by how popular the imitated package is, because attackers aim at the most downloaded names. The highest-scoring match decides the name's score. The default threshold of 50 hides most weak matches; move the slider to see more or fewer.

False positives

Many legitimate packages have names close to popular ones: preact and react, lodash-es and lodash, react-native and react. Names that are themselves on the popular list are never flagged, and the trusted box lets you silence a name you have verified. The point is to make you look at the registry page for a handful of names, not to block installs automatically.

Limits

The check is about spelling only. It does not query npm or PyPI, does not know download counts, publishers or package contents, and cannot tell whether a package is malicious. The popular-package list is a snapshot and much shorter than the registries. Use it alongside registry provenance, lockfiles, npm audit signatures, and tools that analyse package behaviour.

Przykład z rozwiązaniem

A package.json lists nine dependencies. express, react-dom and axios are popular names and pass. lodahs scores 85 as swapped letters of lodash. rnoment scores 88 as a visual lookalike of moment (rn reads as m). crossenv scores 75: on npm it is a different package from cross-env, and a real malicious crossenv was removed from npm in 2017. electorn scores 59 for swapped letters of electron. @angu1ar/core scores 64 for a lookalike scope of @angular/core. node-fetch-js scores 51 as node-fetch with an extra suffix. Six names exceed the default threshold of 50 and each comes with a link to its registry page.

W skrócie

Najczęstsze pytania

Which inputs are accepted?

package.json, package-lock.json, requirements.txt style lines with version pins, or simply one package name per line. The registry is detected from the format, and you can switch it.

Does a high score mean the package is malicious?

No. It means the name is very close to a popular one. Open the registry page, check the publisher, repository, downloads and age, and compare with the package you meant.

Why are separator differences scored low for PyPI?

PyPI normalises names, so python_dateutil and python-dateutil point to the same project. On npm they would be two different packages.

Why is a real package of mine flagged?

Some legitimate packages have similar names. Add it to the trusted names box once you have checked it, and it will no longer be flagged.

Does the checker contact npm or PyPI?

No. All comparisons run in the browser against a bundled list, so nothing about your dependencies leaves your device.

Can I check names before installing them?

Yes. Type the names you are about to install, one per line, and pick the registry before running the install command.

Całkowicie za darmoBez opłat i rejestracji
Pliki zostają prywatneWszystko działa w Twojej przeglądarce
Łatwo w Twoim językuDostępne w wielu językach