[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B6AXFCTXTMCGVDJFHTQ1MG":3,"skill-same:01M7B6AXFCTXTMCGVDJFHTQ1MG":84},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":13,"repositoryHtmlUrl":51,"repositoryHomepageUrl":6,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":53,"install":54,"resources":67},"01M7B6AXFCTXTMCGVDJFHTQ1MG","detecting-typosquatting-packages-in-npm-pypi",null,"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.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-typosquatting-packages-in-npm-pypi\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-typosquatting-packages-in-npm-pypi\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: detecting-typosquatting-packages-in-npm-pypi\ndescription: 'Detects typosquatting attacks in npm and PyPI package registries by\n  analyzing package name similarity using Levenshtein distance and other string metrics,\n  examining publish date heuristics to identify recently created packages mimicking\n  established ones, and flagging download count anomalies where suspicious packages\n  have disproportionately low usage compared to their legitimate targets. The analyst\n  queries the PyPI JSON API and npm registry API to gather package metadata for automated\n  comparison. Activates for requests involving package typosquatting detection, dependency\n  confusion analysis, malicious package identification, or software supply chain threat\n  hunting in package registries.\n\n  '\ndomain: cybersecurity\nsubdomain: supply-chain-security\ntags:\n- typosquatting\n- npm\n- pypi\n- supply-chain\n- package-security\n- Levenshtein\n- dependency-confusion\n- malicious-packages\nversion: 1.0.0\nauthor: mukul975\nlicense: Apache-2.0\nnist_csf:\n- GV.SC-01\n- GV.SC-03\n- GV.SC-06\n- GV.SC-07\nmitre_attack:\n- T1195.001\n- T1195.002\n- T1608.001\n- T1554\n---\n# Detecting Typosquatting Packages in npm and PyPI\n\n## When to Use\n\n- Auditing project dependencies to identify packages whose names are suspiciously similar to popular libraries\n- Proactively scanning package registries for newly published packages that may be typosquats of your organization's packages\n- Investigating a suspected supply chain compromise where a developer installed a misspelled package name\n- Building automated monitoring that alerts when new packages appear with names close to critical dependencies\n- Assessing the risk profile of unfamiliar packages before adding them to a project's dependency tree\n\n**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.\n\n## Prerequisites\n\n- Python 3.9+ with `requests` and `python-Levenshtein` (or `rapidfuzz`) packages installed\n- Network access to `https:\u002F\u002Fpypi.org\u002Fpypi\u002F\u003Cpackage>\u002Fjson` (PyPI JSON API) and `https:\u002F\u002Fregistry.npmjs.org\u002F\u003Cpackage>` (npm registry API)\n- A list of popular or critical packages to monitor (e.g., top 1000 PyPI packages, organization's dependency list)\n- Understanding of common typosquatting patterns: character omission, transposition, insertion, substitution, and hyphen\u002Funderscore manipulation\n\n## Workflow\n\n### Step 1: Build the Target Package Watchlist\n\nEstablish the set of legitimate packages to monitor for typosquats:\n\n- **Extract project dependencies**: Parse `requirements.txt`, `Pipfile.lock`, `package.json`, or `package-lock.json` to extract all direct and transitive dependency names\n- **Include popular packages**: Supplement with high-value targets from the top 1000 PyPI downloads (available from `https:\u002F\u002Fhugovk.github.io\u002Ftop-pypi-packages\u002F`) or top npm packages by download count\n- **Add organization packages**: Include any packages published by your organization that attackers might target with typosquats to intercept internal installations\n- **Normalize names**: PyPI treats hyphens, underscores, and periods as equivalent (PEP 503 normalization: `re.sub(r\"[-_.]+\", \"-\", name).lower()`). npm package names are case-sensitive but scoped packages use `@scope\u002Fname` format. Normalize before comparison.\n\n### Step 2: Generate Candidate Typosquat Names\n\nProduce potential typosquat variants for each target package:\n\n- **Character omission**: Remove each character one at a time (`requests` -> `rquests`, `requets`, `reqests`)\n- **Character transposition**: Swap adjacent characters (`requests` -> `erquests`, `rqeuests`, `reques ts`)\n- **Character substitution**: Replace characters with keyboard-adjacent keys using a QWERTY distance map (`requests` -> `rrquests`, `requesta`)\n- **Character insertion**: Insert common characters at each position (`requests` -> `rrequests`, `reqquests`)\n- **Separator manipulation**: For hyphenated names, try removing, doubling, or replacing separators (`my-package` -> `mypackage`, `my--package`, `my_package`)\n- **Common prefix\u002Fsuffix attacks**: Prepend or append common strings (`python-requests`, `requests-python`, `requests2`, `requests-lib`)\n\n### Step 3: Query Registry APIs for Candidate Packages\n\nCheck whether generated candidate names actually exist in the registry:\n\n- **PyPI JSON API**: Send `GET https:\u002F\u002Fpypi.org\u002Fpypi\u002F\u003Ccandidate>\u002Fjson` 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).\n- **npm registry API**: Send `GET https:\u002F\u002Fregistry.npmjs.org\u002F\u003Ccandidate>` with `Accept: application\u002Fjson`. Extract: `name`, `description`, `dist-tags.latest`, `time.created`, `time.modified`, `maintainers`, and `versions`.\n- **Rate limiting**: PyPI has no published rate limits but respect reasonable request rates (1-2 requests\u002Fsecond). npm registry returns `429` when rate limited; implement exponential backoff.\n- **Batch optimization**: For large candidate lists, parallelize requests with connection pooling (`requests.Session`) and limit concurrency to avoid triggering abuse protections.\n\n### Step 4: Analyze Package Metadata for Suspicion Signals\n\nScore each existing candidate package against multiple heuristic signals:\n\n- **Levenshtein distance**: Calculate the edit distance between the candidate name and the target. Packages with distance 1-2 from a popular package are high-priority suspects. Historical analysis shows 18 of 40 known typosquats had Levenshtein distance of 2 or less from their targets.\n- **Publish date recency**: Compare the candidate's first publish date against the target's. A package created years after its near-namesake is more suspicious. Flag packages created within the last 90 days that are similar to packages published years ago.\n- **Download count disparity**: Compare weekly downloads. Legitimate similarly-named packages typically have comparable or explainable download counts. A package with 50 downloads versus its near-namesake with 5 million downloads is suspicious. PyPI download stats are available via BigQuery (`pypistats.org\u002Fapi\u002F`); npm provides download counts at `https:\u002F\u002Fapi.npmjs.org\u002Fdownloads\u002Fpoint\u002Flast-week\u002F\u003Cpackage>`.\n- **Author and maintainer analysis**: Check if the candidate package author matches the legitimate package author. Different authors for near-identical names increase suspicion.\n- **Description similarity**: Compare package descriptions. Typosquats frequently copy or closely paraphrase the target package description to appear legitimate.\n- **Version count**: Legitimate packages typically have many versions over time. A package with only 1-2 versions and a name similar to a popular package is suspicious.\n- **Repository URL analysis**: Check if the candidate links to the same repository as the target (likely legitimate fork\u002Fmirror) or has no repository URL (suspicious).\n\n### Step 5: Score, Rank, and Report Findings\n\nCombine signals into a composite risk score and generate an actionable report:\n\n- **Weighted scoring**: Assign weights to each signal. Example: Levenshtein distance 1 = 40 points, Levenshtein distance 2 = 25 points, created \u003C 90 days ago = 15 points, download ratio \u003C 0.001 = 15 points, different author = 10 points, single version = 5 points. Total score out of 100.\n- **Threshold classification**: Score >= 70: HIGH risk (likely typosquat), 40-69: MEDIUM risk (requires manual review), \u003C 40: LOW risk (likely legitimate)\n- **Generate report**: For each flagged package, include the target it mimics, all signal values, the composite score, direct links to both packages on the registry, and a recommendation (block, investigate, or allow)\n- **Actionable output**: Produce a blocklist of flagged package names that can be imported into package manager deny-lists, CI\u002FCD policy engines, or artifact repository proxy rules\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Typosquatting** | Registering a package name that closely resembles a popular package, exploiting common typos to trick developers into installing malicious code |\n| **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 |\n| **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 |\n| **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 |\n| **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 |\n| **Combosquatting** | A variant of typosquatting where attackers prepend or append common words to a package name (e.g., `requests-security`, `python-requests`) |\n| **StarJacking** | An attack where a typosquat package links its repository URL to the legitimate package's GitHub repository to inflate apparent credibility |\n\n## Tools & Systems\n\n- **PyPI JSON API**: REST API at `https:\u002F\u002Fpypi.org\u002Fpypi\u002F\u003Cpackage>\u002Fjson` returning package metadata including name, author, versions, upload timestamps, and project URLs\n- **npm Registry API**: REST API at `https:\u002F\u002Fregistry.npmjs.org\u002F\u003Cpackage>` returning package metadata including maintainers, version history, creation timestamps, and distribution info\n- **python-Levenshtein \u002F rapidfuzz**: Python libraries for fast string distance computation, supporting Levenshtein, Damerau-Levenshtein, Jaro-Winkler, and other similarity metrics\n- **pypistats.org API**: Provides download statistics for PyPI packages, enabling download count comparison between suspected typosquats and their targets\n- **npm download counts API**: Endpoint at `https:\u002F\u002Fapi.npmjs.org\u002Fdownloads\u002Fpoint\u002F\u003Cperiod>\u002F\u003Cpackage>` providing download statistics for npm packages\n\n## Common Scenarios\n\n### Scenario: Auditing a Python Project for Typosquatted Dependencies\n\n**Context**: 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.\n\n**Approach**:\n1. Parse `requirements.txt` and `Pipfile.lock` to extract all 87 direct and transitive dependencies\n2. Generate typosquat candidates for each dependency using character omission, transposition, substitution, and separator manipulation, producing approximately 2,400 candidate names\n3. Query the PyPI JSON API for each candidate, finding 34 that actually exist as published packages\n4. Score each existing candidate: 3 packages score above 70 (HIGH risk) with Levenshtein distance 1, created within the last 60 days, single version, and fewer than 100 downloads\n5. Manual review confirms 2 of the 3 are malicious typosquats containing obfuscated code that exfiltrates environment variables during installation\n6. Block the malicious packages in the organization's artifact proxy, report to PyPI for takedown via `security@pypi.org`, and add all 87 dependencies to the ongoing monitoring watchlist\n7. Implement the detection agent as a scheduled CI job that runs weekly and alerts on new HIGH-risk findings\n\n**Pitfalls**:\n- Not normalizing PyPI package names per PEP 503 before comparison, causing missed matches between hyphenated and underscored variants\n- Setting the Levenshtein distance threshold too low (only 1) and missing typosquats at distance 2 that use double substitutions\n- Relying solely on name similarity without checking metadata signals, leading to high false positive rates on legitimately similar package names\n- Not accounting for npm scoped packages (`@scope\u002Fname`) which have different naming rules than unscoped packages\n- Querying the registries too aggressively and getting rate-limited or IP-blocked\n\n## Output Format\n\n```\n## Typosquatting Detection Report\n\n**Scan Date**: 2026-03-19\n**Registry**: PyPI\n**Packages Monitored**: 87\n**Candidates Generated**: 2,412\n**Candidates Found in Registry**: 34\n**Flagged as Suspicious**: 5\n\n### HIGH Risk (Score >= 70)\n\n| Suspect Package | Target Package | Levenshtein | Created | Downloads | Score |\n|----------------|---------------|-------------|---------|-----------|-------|\n| reqeusts       | requests      | 1           | 2026-02-28 | 43     | 92    |\n| requsets       | requests      | 1           | 2026-03-01 | 12     | 88    |\n| numpyy         | numpy         | 1           | 2026-01-15 | 67     | 78    |\n\n### Recommendation\n- BLOCK: reqeusts, requsets, numpyy (add to artifact proxy deny-list)\n- REPORT: Submit malware reports to security@pypi.org with package names and evidence\n- MONITOR: Continue weekly scans for the full dependency watchlist\n```\n","# Detecting Typosquatting Packages in npm and PyPI\n\n## When to Use\n\n- Auditing project dependencies to identify packages whose names are suspiciously similar to popular libraries\n- Proactively scanning package registries for newly published packages that may be typosquats of your organization's packages\n- Investigating a suspected supply chain compromise where a developer installed a misspelled package name\n- Building automated monitoring that alerts when new packages appear with names close to critical dependencies\n- Assessing the risk profile of unfamiliar packages before adding them to a project's dependency tree\n\n**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.\n\n## Prerequisites\n\n- Python 3.9+ with `requests` and `python-Levenshtein` (or `rapidfuzz`) packages installed\n- Network access to `https:\u002F\u002Fpypi.org\u002Fpypi\u002F\u003Cpackage>\u002Fjson` (PyPI JSON API) and `https:\u002F\u002Fregistry.npmjs.org\u002F\u003Cpackage>` (npm registry API)\n- A list of popular or critical packages to monitor (e.g., top 1000 PyPI packages, organization's dependency list)\n- Understanding of common typosquatting patterns: character omission, transposition, insertion, substitution, and hyphen\u002Funderscore manipulation\n\n## Workflow\n\n### Step 1: Build the Target Package Watchlist\n\nEstablish the set of legitimate packages to monitor for typosquats:\n\n- **Extract project dependencies**: Parse `requirements.txt`, `Pipfile.lock`, `package.json`, or `package-lock.json` to extract all direct and transitive dependency names\n- **Include popular packages**: Supplement with high-value targets from the top 1000 PyPI downloads (available from `https:\u002F\u002Fhugovk.github.io\u002Ftop-pypi-packages\u002F`) or top npm packages by download count\n- **Add organization packages**: Include any packages published by your organization that attackers might target with typosquats to intercept internal installations\n- **Normalize names**: PyPI treats hyphens, underscores, and periods as equivalent (PEP 503 normalization: `re.sub(r\"[-_.]+\", \"-\", name).lower()`). npm package names are case-sensitive but scoped packages use `@scope\u002Fname` format. Normalize before comparison.\n\n### Step 2: Generate Candidate Typosquat Names\n\nProduce potential typosquat variants for each target package:\n\n- **Character omission**: Remove each character one at a time (`requests` -> `rquests`, `requets`, `reqests`)\n- **Character transposition**: Swap adjacent characters (`requests` -> `erquests`, `rqeuests`, `reques ts`)\n- **Character substitution**: Replace characters with keyboard-adjacent keys using a QWERTY distance map (`requests` -> `rrquests`, `requesta`)\n- **Character insertion**: Insert common characters at each position (`requests` -> `rrequests`, `reqquests`)\n- **Separator manipulation**: For hyphenated names, try removing, doubling, or replacing separators (`my-package` -> `mypackage`, `my--package`, `my_package`)\n- **Common prefix\u002Fsuffix attacks**: Prepend or append common strings (`python-requests`, `requests-python`, `requests2`, `requests-lib`)\n\n### Step 3: Query Registry APIs for Candidate Packages\n\nCheck whether generated candidate names actually exist in the registry:\n\n- **PyPI JSON API**: Send `GET https:\u002F\u002Fpypi.org\u002Fpypi\u002F\u003Ccandidate>\u002Fjson` 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).\n- **npm registry API**: Send `GET https:\u002F\u002Fregistry.npmjs.org\u002F\u003Ccandidate>` with `Accept: application\u002Fjson`. Extract: `name`, `description`, `dist-tags.latest`, `time.created`, `time.modified`, `maintainers`, and `versions`.\n- **Rate limiting**: PyPI has no published rate limits but respect reasonable request rates (1-2 requests\u002Fsecond). npm registry returns `429` when rate limited; implement exponential backoff.\n- **Batch optimization**: For large candidate lists, parallelize requests with connection pooling (`requests.Session`) and limit concurrency to avoid triggering abuse protections.\n\n### Step 4: Analyze Package Metadata for Suspicion Signals\n\nScore each existing candidate package against multiple heuristic signals:\n\n- **Levenshtein distance**: Calculate the edit distance between the candidate name and the target. Packages with distance 1-2 from a popular package are high-priority suspects. Historical analysis shows 18 of 40 known typosquats had Levenshtein distance of 2 or less from their targets.\n- **Publish date recency**: Compare the candidate's first publish date against the target's. A package created years after its near-namesake is more suspicious. Flag packages created within the last 90 days that are similar to packages published years ago.\n- **Download count disparity**: Compare weekly downloads. Legitimate similarly-named packages typically have comparable or explainable download counts. A package with 50 downloads versus its near-namesake with 5 million downloads is suspicious. PyPI download stats are available via BigQuery (`pypistats.org\u002Fapi\u002F`); npm provides download counts at `https:\u002F\u002Fapi.npmjs.org\u002Fdownloads\u002Fpoint\u002Flast-week\u002F\u003Cpackage>`.\n- **Author and maintainer analysis**: Check if the candidate package author matches the legitimate package author. Different authors for near-identical names increase suspicion.\n- **Description similarity**: Compare package descriptions. Typosquats frequently copy or closely paraphrase the target package description to appear legitimate.\n- **Version count**: Legitimate packages typically have many versions over time. A package with only 1-2 versions and a name similar to a popular package is suspicious.\n- **Repository URL analysis**: Check if the candidate links to the same repository as the target (likely legitimate fork\u002Fmirror) or has no repository URL (suspicious).\n\n### Step 5: Score, Rank, and Report Findings\n\nCombine signals into a composite risk score and generate an actionable report:\n\n- **Weighted scoring**: Assign weights to each signal. Example: Levenshtein distance 1 = 40 points, Levenshtein distance 2 = 25 points, created \u003C 90 days ago = 15 points, download ratio \u003C 0.001 = 15 points, different author = 10 points, single version = 5 points. Total score out of 100.\n- **Threshold classification**: Score >= 70: HIGH risk (likely typosquat), 40-69: MEDIUM risk (requires manual review), \u003C 40: LOW risk (likely legitimate)\n- **Generate report**: For each flagged package, include the target it mimics, all signal values, the composite score, direct links to both packages on the registry, and a recommendation (block, investigate, or allow)\n- **Actionable output**: Produce a blocklist of flagged package names that can be imported into package manager deny-lists, CI\u002FCD policy engines, or artifact repository proxy rules\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Typosquatting** | Registering a package name that closely resembles a popular package, exploiting common typos to trick developers into installing malicious code |\n| **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 |\n| **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 |\n| **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 |\n| **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 |\n| **Combosquatting** | A variant of typosquatting where attackers prepend or append common words to a package name (e.g., `requests-security`, `python-requests`) |\n| **StarJacking** | An attack where a typosquat package links its repository URL to the legitimate package's GitHub repository to inflate apparent credibility |\n\n## Tools & Systems\n\n- **PyPI JSON API**: REST API at `https:\u002F\u002Fpypi.org\u002Fpypi\u002F\u003Cpackage>\u002Fjson` returning package metadata including name, author, versions, upload timestamps, and project URLs\n- **npm Registry API**: REST API at `https:\u002F\u002Fregistry.npmjs.org\u002F\u003Cpackage>` returning package metadata including maintainers, version history, creation timestamps, and distribution info\n- **python-Levenshtein \u002F rapidfuzz**: Python libraries for fast string distance computation, supporting Levenshtein, Damerau-Levenshtein, Jaro-Winkler, and other similarity metrics\n- **pypistats.org API**: Provides download statistics for PyPI packages, enabling download count comparison between suspected typosquats and their targets\n- **npm download counts API**: Endpoint at `https:\u002F\u002Fapi.npmjs.org\u002Fdownloads\u002Fpoint\u002F\u003Cperiod>\u002F\u003Cpackage>` providing download statistics for npm packages\n\n## Common Scenarios\n\n### Scenario: Auditing a Python Project for Typosquatted Dependencies\n\n**Context**: 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.\n\n**Approach**:\n1. Parse `requirements.txt` and `Pipfile.lock` to extract all 87 direct and transitive dependencies\n2. Generate typosquat candidates for each dependency using character omission, transposition, substitution, and separator manipulation, producing approximately 2,400 candidate names\n3. Query the PyPI JSON API for each candidate, finding 34 that actually exist as published packages\n4. Score each existing candidate: 3 packages score above 70 (HIGH risk) with Levenshtein distance 1, created within the last 60 days, single version, and fewer than 100 downloads\n5. Manual review confirms 2 of the 3 are malicious typosquats containing obfuscated code that exfiltrates environment variables during installation\n6. Block the malicious packages in the organization's artifact proxy, report to PyPI for takedown via `security@pypi.org`, and add all 87 dependencies to the ongoing monitoring watchlist\n7. Implement the detection agent as a scheduled CI job that runs weekly and alerts on new HIGH-risk findings\n\n**Pitfalls**:\n- Not normalizing PyPI package names per PEP 503 before comparison, causing missed matches between hyphenated and underscored variants\n- Setting the Levenshtein distance threshold too low (only 1) and missing typosquats at distance 2 that use double substitutions\n- Relying solely on name similarity without checking metadata signals, leading to high false positive rates on legitimately similar package names\n- Not accounting for npm scoped packages (`@scope\u002Fname`) which have different naming rules than unscoped packages\n- Querying the registries too aggressively and getting rate-limited or IP-blocked\n\n## Output Format\n\n```\n## Typosquatting Detection Report\n\n**Scan Date**: 2026-03-19\n**Registry**: PyPI\n**Packages Monitored**: 87\n**Candidates Generated**: 2,412\n**Candidates Found in Registry**: 34\n**Flagged as Suspicious**: 5\n\n### HIGH Risk (Score >= 70)\n\n| Suspect Package | Target Package | Levenshtein | Created | Downloads | Score |\n|----------------|---------------|-------------|---------|-----------|-------|\n| reqeusts       | requests      | 1           | 2026-02-28 | 43     | 92    |\n| requsets       | requests      | 1           | 2026-03-01 | 12     | 88    |\n| numpyy         | numpy         | 1           | 2026-01-15 | 67     | 78    |\n\n### Recommendation\n- BLOCK: reqeusts, requsets, numpyy (add to artifact proxy deny-list)\n- REPORT: Submit malware reports to security@pypi.org with package names and evidence\n- MONITOR: Continue weekly scans for the full dependency watchlist\n```\n",{"name":5,"tags":24,"author":33,"domain":34,"license":14,"version":35,"nist_csf":36,"subdomain":41,"description":42,"mitre_attack":43},[25,26,27,28,29,30,31,32],"typosquatting","npm","pypi","supply-chain","package-security","Levenshtein","dependency-confusion","malicious-packages","mukul975","cybersecurity","1.0.0",[37,38,39,40],"GV.SC-01","GV.SC-03","GV.SC-06","GV.SC-07","supply-chain-security","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.\n",[44,45,46,47],"T1195.001","T1195.002","T1608.001","T1554","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-typosquatting-packages-in-npm-pypi","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill detecting-typosquatting-packages-in-npm-pypi",{"tool":60,"command":61},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill detecting-typosquatting-packages-in-npm-pypi",{"tool":63,"command":64},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill detecting-typosquatting-packages-in-npm-pypi","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-typosquatting-packages-in-npm-pypi\u002FSKILL.md",true,[68,72,78],{"path":69,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fapi-reference.md","REFERENCE","参考文档",5615,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-typosquatting-packages-in-npm-pypi\u002Freferences\u002Fapi-reference.md",{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"scripts\u002Fagent.py","SCRIPT","脚本",20241,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-typosquatting-packages-in-npm-pypi\u002Fscripts\u002Fagent.py",[85,93,100,107,114,121],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":89,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":89,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":89,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":89,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":89,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":89,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]