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 於 3 天前認領。 未關閉
難度 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 於 6 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 70/100
CopilotKit/OpenBot#785 ·
維護者通常 1 天內回覆
查看 CopilotKit/OpenBot 的全部 Issue
相似的 Issue
-
frontend
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 86/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
ranxianglei/billion-context#4172 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
awslabs/threat-composer#362 ·
維護者通常 1 天內回覆
-
Area/Cloud Needs Triage Type/Bug
難度 1/5 1-3 小時 新手友好度 86/100
wso2/product-integrator#2847 ·
維護者通常 1 天內回覆