Telemetry scrubber: case-insensitive mysql rule redacts an attached port (-P3306) and lets a real password survive in the same command
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- mysql, typescript
调研方向
从server/src/telemetry/scrub.ts开始,检查 mysql 凭据规则及其相邻的 sshpass 规则。为混合使用-P3306和-phunter2的命令、小写且连写的-p3306以及mysql -p database添加测试;确认端口和数据库名称得以保留,同时实际凭据会被隐藏。
由索引模型根据 Issue 内容生成。
描述
Summary
In server/src/telemetry/scrub.ts, the tool-anchored mysql credential rule keeps the i flag:
[
/(\bmysql(?:dump)?\b(?:[^|;&\\\r\n]|\\[\s\S])*?(?:[ \t]|\\\r?\n)-p)("[^"]*"|'[^']*'|[^\s'"-]\S*)/gi,
(_m, lead) => `${lead}${REDACTED}`,
],
i makes (?:[ \t])-p match the uppercase attached port form -P3306 (mysql's syntax for --port attached to a single dash). Because the g continuation after the first match never sees another \bmysql\b anchor, a real password later in the same command line is not redacted.
Repro (upstream tree at e8bb2736)
scrubCommand("mysql -h db -P3306 -phunter2 app")
→ "mysql -h db -P[REDACTED] -phunter2 app"
The port is redacted as if it were a secret, and the actual password -phunter2 survives into OTLP export — contrary to the module header's stated priority ("a secret that survived costs a rotation") and to the sibling sshpass rule, which is deliberately case-sensitive with the comment "Case matters here: -P is sshpass's prompt".
Suggested fix
Drop i from the mysql rule (/gi → /g), matching the sshpass rule's convention:
mysql -h db -P3306 -phunter2 app→mysql -h db -P3306 -p[REDACTED] app- lowercase
-p3306(attached password form) is still redacted mysqldump -phunter2 dbunchanged
Tests worth pinning: the mixed -P/-p command above, the lowercase attached form, and mysql -p database (space form = interactive prompt, database name must not be redacted).
Context: we hit this in a downstream deployment while extending coverage for SSHPASS=… sshpass -e and docker <global-options> login -p …; the case-sensitivity divergence was found by a full-scope review pass. Happy to send a PR if wanted.
- 主要语言
- TypeScript
- 星标
- 6.6k
- 派生
- 914
- 平均合并
- 22 小时 44 分钟
- 30 天内合并 PR
- 137
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CopilotKit/OpenBot 的其他 Issue
-
Wrong key location at startup可能已有人在做 @charan-rathore 于 3 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 68/100
CopilotKit/OpenBot#800 ·
维护者通常 1 天内回复
-
setup-learning.ts fails on Windows with "spawn npx.cmd EINVAL"可能已有人在做 @Caldas 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 80/100
CopilotKit/OpenBot#792 ·
维护者通常 1 天内回复
-
Remote AG-UI Bots can't use the browser in chat: `computer_*` calls refused as "unavailable for this headless turn"可能已有人在做 @charan-rathore 于 2 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
CopilotKit/OpenBot#804 ·
维护者通常 1 天内回复
-
难度 4/5 一周以上 新手友好度 22/100
CopilotKit/OpenBot#786 ·
维护者通常 1 天内回复
-
server/tests leaks database connections: 55 files open a pool and never close it可能已有人在做 @adamsiwiec1 于 5 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 70/100
CopilotKit/OpenBot#785 ·
维护者通常 1 天内回复
查看 CopilotKit/OpenBot 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
mobile-next/mobile-mcp#526 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 1/5 1 小时以内 新手友好度 73/100
redhat-developer/rhdh-plugin-export-overlays#4470 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
anthropics/anthropic-sdk-typescript#1273 ·
维护者通常 10 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
DietrichGebert/ponytail#1206 ·
维护者通常 2 天内回复