Typosquat

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Nov 6, 2026

Check dependency names against popular package names at small edit distance.

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

离线 MCP 服务器,将项目 package.json 中的依赖名与内置的热门 npm 包名列表比对,标记可能的误植域名(typosquat)依赖。

可以做什么
  • 检查项目依赖名是否为可能的 typosquat,返回判定结果、计数、发现项和摘要。
  • 读取指定路径 package.json 中的 dependencies、devDependencies、peerDependencies 和 optionalDependencies。
  • 标记去除分隔符后与热门包名相同、编辑距离为 1,或长度 9 以上且编辑距离为 2 的依赖名,并给出其相似的热门包名。
适用场景
适合在审查陌生或新增的 npm 依赖列表时,安装前做一次快速、确定性的相似包名初筛。它只是初步信号,不是安全审计。
运行要求
通过 npx 或 Docker 镜像以 stdio 在本地运行;未声明认证、API 密钥或环境变量。需要一个待检查的 package.json,且完全离线工作。
安装前请注意
发现项只是相似性信号,并非恶意意图的证据,合法包也可能与热门包仅一字之差。热门包名列表是固定快照,会随时间过时;组合型抢注、同形字或位翻转抢注以及多数作用域伎俩无法检出。它只读取名称,不检查包内容、维护者或下载历史。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Typosquat,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

typosquat

A typosquat checker for a dependency list. It reads the package.json of a project, collects every dependency name from dependencies, devDependencies, peerDependencies and optionalDependencies, and compares each name against a bundled list of popular npm package names. A dependency that is not itself a popular package but closely resembles one is flagged as a possible typosquat, with the popular package it resembles named as evidence.

The check is fully offline and deterministic: no network calls, no timestamps, findings sorted by dependency name.

Install

sh
npx @reneturcios/typosquat check .

Or install it globally:

sh
npm install -g @reneturcios/typosquattyposquat check .

CLI

text
typosquat check [path] [--json]typosquat mcptyposquat --version
  • check [path]: check the project at path (a directory containing a package.json, or a direct path to a package.json file). Defaults to the current directory. Add --json for the machine readable report.
  • mcp: run the MCP server over stdio.
  • --version: print the version.

Exit codes: 0 when the verdict is CLEAR, 1 when the verdict is SUSPECT, 2 for usage errors and for a missing or invalid package.json.

Example human output:

text
typosquat 0.1.0Target: .Verdict: SUSPECTDependencies checked: 5Flagged: 1Summary: Checked 5 dependencies; 1 flagged as possible typosquats.Findings:- [HIGH] DISTANCE-1: Dependency "axioss" resembles popular package "axios" (edit distance 1) (evidence: axios)

MCP

The MCP server exposes one tool:

  • check_typosquat with a path argument. It returns the same report as the CLI --json output: tool name, version, target, verdict, counts (depsChecked, flagged), findings and a summary.

Matching rules

Names are normalized by lowercasing before comparison. A dependency that is itself in the popular list is never flagged. For every other dependency, the strongest matching rule wins:

  • SEPARATOR-SQUAT (high severity): the dependency name equals a popular name once hyphens, underscores and dots are stripped from both names, but the raw names differ. Example: node_fetch vs node-fetch.
  • DISTANCE-1 (high severity): Levenshtein edit distance 1 from a popular name. Example: axioss vs axios.
  • DISTANCE-2 (medium severity): Levenshtein edit distance 2 from a popular name whose length is 9 or more characters. Short names are excluded at distance 2 because too many unrelated short names sit within two edits of each other. Example: typescrpit vs typescript.

Scope confusion is not checked: an unscoped dependency that equals only the unscoped part of a scoped popular name (for example client vs @prisma/client) is too weak a signal to flag.

Verdict

  • CLEAR: no dependency resembled a popular package name.
  • SUSPECT: at least one dependency was flagged.

Limits

  • The popular package list is a snapshot dated 2026-10-25, written from knowledge of the npm ecosystem. It will drift: new packages become popular and old ones fade, and a snapshot cannot track that.
  • Edit distance catches typos, not every squatting style. It does not catch combosquats (a popular name combined with an extra word, such as axios-helper), homoglyph or bit squats, or scope tricks beyond the separator rule above.
  • The checker reads names only. It does not inspect package contents, maintainers, download counts or publish history, so it cannot judge malicious intent.
  • A flag is a resemblance, not an accusation. Legitimate packages can sit one edit away from a popular name. Treat every finding as a prompt to look, not as proof of wrongdoing.

License

MIT

来源:README.md,提交 739267b

工具

1

check_typosquat

Check a repo's dependency names against a bundled snapshot of popular npm package names: any dependency at edit distance 1 from a popular name (distance 2 for names of 9+ chars) that is not itself the popular package is flagged as a possible typosquat, with the popular name it resembles. Verdict CLEAR or SUSPECT.

输入参数path必填

版本历史

1
  1. v0.1.0最新Oct 30, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分