Detects typosquatting attacks in npm and PyPI package registries by analyzing package name similarity using Levenshtein distance and other string metrics, examining publish date heuristics to identify recently created packages mimicking established ones, and flagging download count anomalies where suspicious packages have disproportionately low usage compared to their legitimate targets. The analyst queries the PyPI JSON API and npm registry API to gather package metadata for automated comparison. Activates for requests involving package typosquatting detection, dependency confusion analysis, malicious package identification, or software supply chain threat hunting in package registries.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versiondetecting-typosquatting-packages-in-npm-pypiExecute the skills CLI command in your project's root directory to begin installation:
Fetches detecting-typosquatting-packages-in-npm-pypi from mukul975/Anthropic-Cybersecurity-Skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate detecting-typosquatting-packages-in-npm-pypi. Access via /detecting-typosquatting-packages-in-npm-pypi in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
8.6K
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
8.6K
stars
| name | detecting-typosquatting-packages-in-npm-pypi |
| description | 'Detects typosquatting attacks in npm and PyPI package registries by analyzing package name similarity using Levenshtein distance and other string metrics, examining publish date heuristics to identify recently created packages mimicking established ones, and flagging download count anomalies where suspicious packages have disproportionately low usage compared to their legitimate targets. The analyst queries the PyPI JSON API and npm registry API to gather package metadata for automated comparison. Activates for requests involving package typosquatting detection, dependency confusion analysis, malicious package identification, or software supply chain threat hunting in package registries. ' |
| domain | cybersecurity |
| subdomain | supply-chain-security |
| tags | - typosquatting - npm - pypi - supply-chain - package-security - Levenshtein - dependency-confusion - malicious-packages |
| version | 1.0.0 |
| author | mukul975 |
| license | Apache-2.0 |
| nist_csf | - GV.SC-01 - GV.SC-03 - GV.SC-06 - GV.SC-07 |
Do not use as the sole determination of malicious intent; name similarity alone does not prove a package is malicious. Do not use for bulk automated takedown requests without manual review of flagged packages. Do not use against private registries without authorization.
requests and python-Levenshtein (or rapidfuzz) packages installedhttps://pypi.org/pypi/<package>/json (PyPI JSON API) and https://registry.npmjs.org/<package> (npm registry API)Establish the set of legitimate packages to monitor for typosquats:
requirements.txt, Pipfile.lock, package.json, or package-lock.json to extract all direct and transitive dependency nameshttps://hugovk.github.io/top-pypi-packages/) or top npm packages by download countre.sub(r"[-_.]+", "-", name).lower()). npm package names are case-sensitive but scoped packages use @scope/name format. Normalize before comparison.Produce potential typosquat variants for each target package:
requests -> rquests, requets, reqests)requests -> erquests, rqeuests, reques ts)requests -> rrquests, requesta)requests -> rrequests, reqquests)my-package -> mypackage, my--package, my_package)python-requests, requests-python, requests2, requests-lib)Check whether generated candidate names actually exist in the registry:
GET https://pypi.org/pypi/<candidate>/json for each candidate. A 200 response means the package exists; 404 means it does not. Extract from the response: info.name, info.version, info.author, info.summary, info.home_page, info.project_urls, and releases (keyed by version with upload_time_iso_8601 timestamps).GET https://registry.npmjs.org/<candidate> with Accept: application/json. Extract: name, description, dist-tags.latest, time.created, time.modified, maintainers, and versions.429 when rate limited; implement exponential backoff.requests.Session) and limit concurrency to avoid triggering abuse protections.Score each existing candidate package against multiple heuristic signals:
pypistats.org/api/); npm provides download counts at https://api.npmjs.org/downloads/point/last-week/<package>.Combine signals into a composite risk score and generate an actionable report:
| Term | Definition |
|---|---|
| Typosquatting | Registering a package name that closely resembles a popular package, exploiting common typos to trick developers into installing malicious code |
| Levenshtein Distance | The minimum number of single-character edits (insertions, deletions, substitutions) required to transform one string into another; the primary metric for measuring name similarity |
| Dependency Confusion | A broader supply chain attack where attackers publish malicious packages to public registries with names matching private internal packages, exploiting package manager resolution order |
| PEP 503 Normalization | The Python packaging specification that treats hyphens, underscores, and periods as equivalent in package names, meaning my-package, my_package, and my.package resolve to the same package |
| QWERTY Distance | A keyboard-layout-aware distance metric measuring how far apart two keys are on a standard keyboard, used to detect substitutions from adjacent key mistyping |
| Combosquatting | A variant of typosquatting where attackers prepend or append common words to a package name (e.g., requests-security, python-requests) |
| StarJacking | An attack where a typosquat package links its repository URL to the legitimate package's GitHub repository to inflate apparent credibility |
https://pypi.org/pypi/<package>/json returning package metadata including name, author, versions, upload timestamps, and project URLshttps://registry.npmjs.org/<package> returning package metadata including maintainers, version history, creation timestamps, and distribution infohttps://api.npmjs.org/downloads/point/<period>/<package> providing download statistics for npm packagesContext: A security team discovers that a developer's workstation was compromised after installing a Python package. The incident response team needs to audit all project dependencies for potential typosquats and establish ongoing monitoring.
Approach:
requirements.txt and Pipfile.lock to extract all 87 direct and transitive dependencies[email protected], and add all 87 dependencies to the ongoing monitoring watchlistPitfalls:
@scope/name) which have different naming rules than unscoped packages## Typosquatting Detection Report
**Scan Date**: 2026-03-19
**Registry**: PyPI
**Packages Monitored**: 87
**Candidates Generated**: 2,412
**Candidates Found in Registry**: 34
**Flagged as Suspicious**: 5
### HIGH Risk (Score >= 70)
| Suspect Package | Target Package | Levenshtein | Created | Downloads | Score |
|----------------|---------------|-------------|---------|-----------|-------|
| reqeusts | requests | 1 | 2026-02-28 | 43 | 92 |
| requsets | requests | 1 | 2026-03-01 | 12 | 88 |
| numpyy | numpy | 1 | 2026-01-15 | 67 | 78 |
### Recommendation
- BLOCK: reqeusts, requsets, numpyy (add to artifact proxy deny-list)
- REPORT: Submit malware reports to [email protected] with package names and evidence
- MONITOR: Continue weekly scans for the full dependency watchlist
Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
mukul975/Anthropic-Cybersecurity-Skills
mukul975/Anthropic-Cybersecurity-Skills
mukul975/Anthropic-Cybersecurity-Skills
mukul975/Anthropic-Cybersecurity-Skills
mukul975/Anthropic-Cybersecurity-Skills
mukul975/Anthropic-Cybersecurity-Skills
We added detecting-typosquatting-packages-in-npm-pypi from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
detecting-typosquatting-packages-in-npm-pypi fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
detecting-typosquatting-packages-in-npm-pypi reduced setup friction for our internal harness; good balance of opinion and flexibility.
Keeps context tight: detecting-typosquatting-packages-in-npm-pypi is the kind of skill you can hand to a new teammate without a long onboarding doc.
detecting-typosquatting-packages-in-npm-pypi has been reliable in day-to-day use. Documentation quality is above average for community skills.
Useful defaults in detecting-typosquatting-packages-in-npm-pypi — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
I recommend detecting-typosquatting-packages-in-npm-pypi for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
Registry listing for detecting-typosquatting-packages-in-npm-pypi matched our evaluation — installs cleanly and behaves as described in the markdown.
detecting-typosquatting-packages-in-npm-pypi is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Useful defaults in detecting-typosquatting-packages-in-npm-pypi — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
showing 1-10 of 65