Skip to content

[bug] ReDoS 风险(正则表达式拒绝服务) #90

Description

@Misaka477

step-realtime-cli 版本

1.0.0

Node 版本 & OS

Node 24.16.0 / Linux (Fedora 44)

复现步骤

  1. 模型在 grep 工具参数中传入恶意正则如 (a+)+b
  2. new RegExp(pattern) 被调用
  3. 针对特定输入匹配时,正则引擎陷入 catastrophic backtracking
  4. Node.js 事件循环被阻塞

期望行为

正则执行应有超时机制(如使用 re2 或基于 Worker 的超时封装)

实际行为

恶意正则可导致进程长时间无响应

日志 / 堆栈

截图(可选)

No response

自检

  • 我已搜索 existing issues,确认这不是重复问题
  • 我已阅读 CONTRIBUTING.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    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