Skip to content

[security] npm audit 漏洞清理(生产路径 ethers→ws + dev 工具链 critical)持续跟踪 #89

Description

@jhfnetboy

持续跟踪 issue。来源:2026-06-19 CI 红因排查(Security Audit job)。npmmirror 不支持 audit 端点,用 --registry=https://registry.npmjs.org 跑。

现状(npm audit)

  • 全部:40 漏洞(1 critical, 11 high, 27 moderate, 1 low)
  • 仅生产依赖--omit=dev):20 漏洞(10 high, 10 moderate),主因 ethers → ws

分类与风险评估

  1. 生产路径(ethers → ws,20 漏洞)
    • ws 漏洞(内存泄露 / DoS)主要在 WebSocket 连接路径;aNode 用 HTTP JsonRpcProvider,不走 ethers 的 WebSocketProvider → 实际利用面低,但审计仍红。
    • 处理选项:① 迁移 viem(彻底,见 tech-debt/viem issue,viem 无 ws 依赖);或 ② npm overrides 把 ws 钉到安全版本(治标,需验证 ethers 兼容)。
  2. dev / 构建工具链(其余 ~20 漏洞,含 1 critical @babel/core 任意文件读、picomatch/ajv ReDoS 等)
    • 只在 CI / 本地构建期用(jest/babel/eslint 传递依赖),不在生产运行时路径 → 风险低。
    • critical @babel/core 需升级 jest/babel 工具链,动作较大,单独评估。

建议

  • 不阻塞功能开发;Security Audit 作为非必需 CI(当前 UNSTABLE 不挡合并)。
  • 生产路径优先随 viem 迁移 一并解决(关联 tech-debt issue)。
  • dev 工具链 critical 单独排期升级 jest/babel。
  • npm audit fix(非 force,不 breaking)可修一部分,但会大改 lockfile,需跑全测验证后单独 PR。

跟踪清单

  • 生产路径 ws via ethers(→ viem 迁移 / overrides)
  • dev critical @babel/core(升 jest/babel)
  • 评估 npm audit fix 非 force 的安全子集 PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions