Regex Safety Audit

io.github.tylerscomic-lab由 GitHub 账号 tylerscomic-lab 发布v1.0.0更新于 Oct 24, 2026

Detects catastrophic-backtracking (ReDoS) regex risk via AST parsing, with JS-safe rewrites.

发布方自己的服务:audit.domains - Domain Valuation

已验证Streamable HTTP可网页运行开发者工具安全与监控

概览

AI 生成的概览

通过 AST 解析审计正则表达式的灾难性回溯(ReDoS)风险,并给出 JavaScript 安全的改写建议。

可以做什么
将正则表达式解析为手写 AST,在不执行模式本身的情况下检测灾难性回溯(ReDoS)风险。可识别嵌套无界量词、重复组内的歧义选择以及反向引用。analyze_redos_risk 返回风险等级、带原因的各项发现以及 JavaScript 相关注意事项;generate_attack_string 生成候选概念验证输入和带硬性子进程超时的 Node 代码片段;suggest_safe_rewrite 给出具体的 JS 安全改写,或在无法机械修复时如实说明。
适用场景
适合在审查或加固 JavaScript 代码中的正则表达式时使用,尤其是希望进行结构化 ReDoS 检测而非字符串启发式判断的场景。适用于安全审查、代码审计以及需要为被标记的模式提供安全改写或有界概念验证测试的流程。若只需测试模式是否匹配,则不太适用。
运行要求
远程 streamable HTTP 端点 OAuth 身份验证。未声明任何软件包、环境变量或请求头。README 说明也可通过 npm install 和 node server.js 自托管,这需要 Node.js。
安装前请注意
托管端点需要 OAuth 身份验证。README 提到有免费额度以及每月 7 美元的 Pro 方案,可能涉及付费使用。generate_attack_string 会生成概念验证输入和一段 Node 代码片段,供在本地运行;针对真正灾难性的模式运行正是硬性子进程超时所要控制的场景,因此请谨慎对待生成的代码片段。未声明任何密钥或环境变量。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Regex Safety Audit,将其添加到工作区。
  2. 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.tylerscomic-lab%2Fregex-safety-audit-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。

{
  "mcpServers": {
    "regex-safety-audit": {
      "type": "http",
      "url": "https://regex-safety-audit-mcp.mcpize.run/mcp"
    }
  }
}

README

regex-safety-audit-mcp

[License: MIT] [Live on MCPize]

An MCP server that parses a regex into a real hand-written AST to detect catastrophic-backtracking (ReDoS) risk — without ever executing the pattern itself. A ReDoS scanner that runs the regex it's scanning would be able to hang itself; this one never calls new RegExp(...).test() on anything.

What it catches

Nested unbounded quantifiers ((a+)+), ambiguous alternation inside a repeated group ((a|ab)+), and backreferences — the three shapes behind almost every real-world ReDoS incident. Detection is structural (a real parser, not regex-on-regex string heuristics), verified against the canonical literature examples during testing.

The JS-specific trap

Generic ReDoS advice tells you to wrap the offending group in an atomic group or use a possessive quantifier. JavaScript has neither. analyze_redos_risk says so explicitly, and suggest_safe_rewrite gives the actual JS-safe fix (collapsing redundant nesting, or restructuring with a negated character class) instead of advice that would 400 as a syntax error if you tried it.

Tools

analyze_redos_risk

Full structural analysis. Returns a risk level, every finding with its exact reason, and the JS atomic-group/ possessive-quantifier caveat.

generate_attack_string

For a flagged pattern, generates candidate proof-of-concept inputs at a few sizes, plus a ready-to-run Node snippet that times the match with a hard OS-level subprocess timeout — so testing a genuinely catastrophic regex can't hang your own test process either.

suggest_safe_rewrite

Concrete rewritten pattern for the mechanically-fixable shapes; honest "no mechanical fix, here's what to change by hand" for the ones that aren't.

Use it

Hosted (recommended): MCPize — free tier, $7/mo Pro.

Self-host:

bash
npm installnode server.js

Part of a small suite

mcp-schema-audit-mcp, cron-schedule-audit-mcp, claude-cost-audit-mcp.

License

MIT

来源:README.md,提交 12fa26e

工具

0
该服务器需要登录,因此 SourceWeft 无法在没有账号的情况下读取其工具,也未收录。已连接账号所能看到的内容可能因账号及其权限而异。

版本历史

1
  1. v1.0.0最新Sep 16, 2026

评分

已满足适用检查项的 85%

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

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Audit 集成