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 分