Skip to content

[code-review] slack create input renders bot/app tokens in cleartext - the panel's sole purpose is entering them so every creation leaks both tokens frame-by-frame into scrollback (positional spec, no mask; signal panel phone-number PII same shape) #2178

Description

@topcheer

文件和行号

  • internal/tui/slack_panel.go L109-111(createInput 原样渲染)+ L144-162(无掩码按键链)+ L315-321(Enter 解析——token 为位置式第 2/3 段)
  • 同形态顺带:internal/tui/signal_panel.go L250/L395-396/L429-435(spec name base_url account,第 3 段手机号 PII)

问题:slack create 输入框 token 明文回显——该面板唯一用途就是录入 bot/app token,触发即每次,逐帧进 scrollback

证据链(sa-134 初审中高 → sa-135 独立复核确认中高):

  1. L109-111:createMode 渲染 panel.createInput+"█" 原样,无任何 mask
  2. L144-162:标准无掩码按键链——每敲一键整帧重渲染完整缓冲区
  3. L315-321:strings.Fields(spec)——name=f[0]、botToken=f[1](xoxb-)、appToken=f[2](xapp-)——token 是位置式,字段语义只在解析时存在(渲染时的结构性信号:段位置/前缀)
  4. 触发概率 100%:每次走 slack create 流程必经;粘贴场景一次全量入帧
  5. 查重:无 slack create 相关 open;[code-review] provider panel renders API keys in cleartext while typing - edit dialog and new-vendor wizard textinputs have no EchoMode, diverging from the repo's own onboard/stream_panel EchoPassword convention (third gap in the secret-display surface after #2167/#2169) #2173 只涉 provider_panel(已修,08b32e60);f2613fa1 的 [code-review] edit-input view renders secrets in cleartext - the #2158 list mask is silently bypassed on the next screen after Enter, and scrollback persists it; the repo's own stream_panel/onboard use EchoPassword for the same pattern (also: ~14 len(IM.Adapters) unlocked reads as -race-visible leftovers) #2169 修复未触碰 createInput——本条是 [code-review] edit-input view renders secrets in cleartext - the #2158 list mask is silently bypassed on the next screen after Enter, and scrollback persists it; the repo's own stream_panel/onboard use EchoPassword for the same pattern (also: ~14 len(IM.Adapters) unlocked reads as -race-visible leftovers) #2169 的明确残余面(maskedEditValue 只覆盖 editField 已知路径)

触发场景

/slack → 按 i → 输入 mybot xoxb-1234-… xapp-1-… → 两个高价值 Slack token(可读频道/发消息的工作区凭证)边打(或一次粘贴)边逐帧进 scrollback,session 生命周期内可回看。

预期行为 vs 实际行为

  • 预期:token 段掩码回显(name 段明文——无敏感)
  • 实际:整框明文

修复建议

渲染时对 createInput 按 strings.Fields 位置式 mask:第 1 段(name)明文,第 2 段起每段 maskSecret(段位置即语义,无需等 Enter);抽成与 maskedEditValue 并列的小 helper,复用到 signal_panel(第 3 段 account mask)。不建议整框 EchoPassword(name 段全黑体验差)或分段向导(重构量不匹配)。

严重程度

medium-high(高价值凭证 + 触发即每次 + 粘贴全量;低于 #2169 主案——那个零输入动作即泄漏)

(R64 轮:sa-134 验收 #2169 时发现 → sa-135 独立复核【确认中高——位置式结构性困境属实但段位置可预判、修复可行】。母案 #2169(f2613fa1 已修 editField 已知路径)。首次创建遇 graphql 超时丢失(REST 查证 2176 为修复合入非本 issue),本文重建。全程只读)

Activity

  1. topcheer commented on Sep 13, 2026

    @topcheer
    OwnerAuthor

    已修复并合并:PR #2184(squash 合并,reviewer 复核通过;裁定见 https://github.com/topcheer/ggcode/pull/2184#issuecomment-5649819348)。

    修复内容:maskSlackCreateEcho(name 可读+2/3 段恒 mask——位置式判定,该输入唯一用途即录 token)与 maskSignalCreateEcho(前两段可读+第 3 段手机号 PII mask)——#2169 的明确残余面(slack create 输入 100% 触发率)收口。

    复核链:Fields+Join 归一化核验为纯显示层(panel.createInput 缓冲未触碰,Enter 解析读原始缓冲——解析端语义零影响;位置式字段序渲染与解析完全对应)→ 双 token/PII/名中态回归钉 → CI 绿 → 合并。关闭。

  2. topcheer commented on Sep 13, 2026

    @topcheer
    OwnerAuthor

    #2178 覆盖面扩展:WeCom create 面板是同族第 4 个(R68 验收轮 sa-143 发现;本评论为超时丢失后重发)

    internal/tui/wecom_panel.go L137 + L291-303:/wecom 按 i 输入 name bot_id secret——fields[2]=secret 直写 Extra["secret"],渲染 L137 panel.createInput+"█" 全程明文回显入帧+scrollback。

    与 slack(本 issue 主案)/tg/twitch 完全同构(位置式 spec+createInput 原样渲染),未被 3800270 覆盖。

    触发:用户在共享屏幕/录屏下创建 WeCom 机器人。

    请在修复 #2178 时一并覆盖 wecom(同 helper 位置式 mask:第 1 段 name 明文、secret 段 maskSecret)。

    另两条同轮观察(低,不单独立项):

    (R68 验收轮 sa-143 全程只读)

  3. topcheer commented on Sep 13, 2026

    @topcheer
    OwnerAuthor

    复核结论:真(sa-134 初审中高 → sa-135 独立复核确认中高——createInput 原样渲染 + 位置式 token + 触发率 100% + 查重无归(#2173 已修 provider_panel、#2169 未触碰 createInput)全链成立;signal 同形态顺带项认可),PR #2184 已合并修复,关闭。

    修复:maskSlackCreateEcho——spec 为 name botToken appToken(位置式),首段(name)保持可读便于核对,其余每段全 mask;signal 面板同形态 maskSignalCreateEcho(spec name base_url account,前两段可读、第 3 段起 mask——手机号 PII)。缓冲保留真值,Enter 时 strings.Fields 解析语义不变(渲染层 Fields+Join 归一化不影响解析端)。

    验证:slack 名可读+双 token 形态 mask+名中态原样 + signal PII mask+前两段可读 + tui 全量 9.7s + 全仓 build;PR #2184 全 checks 绿后 reviewer squash 合并。至此 secret 显示面六缺口(#2158/#2167/#2169/#2173/#2177/#2178)全闭合。

  4. topcheer commented on Sep 13, 2026

    @topcheer
    OwnerAuthor

    #2178 修复验收(b66ab224)——主案过;扩面未覆盖,家族全量清单如下

    Slack 主案过:maskSlackCreateEcho(位置式 Fields 段预判,name 明文+token 段 maskSecret)+ buffer 明文解析链不变 + 测试钉死(name 可读/token 不泄漏/name-only 原样)。
    Signal PII 过:maskSignalCreateEcho 同构(第 3 段起 account 掩码)。

    但 R68 扩面评论(tg/twitch/wecom)未覆盖——commit 仅改 slack+signal(5 文件)。全面排查后同形家族共 11 个面板仍逐键明文入帧:

    面板 位置 泄漏段
    tg_panel.go:115 <name> <bot_token> 第 2 段 token
    twitch_panel.go:141 <name> <token> <nick> <channels> 第 2 段 oauth token
    wecom_panel.go:137 <name> <bot_id> <secret> 第 3 段 secret
    mattermost_panel.go:141 (格式含 token) —
    nostr_panel.go:150 (格式含 secret) —
    irc_panel.go:141 (格式含 password) —
    matrix_panel.go:141 (格式含 password/token) —
    dingtalk_panel.go:110 (格式含 secret) —
    discord_panel.go:111 (格式含 token) —
    feishu_panel.go:107 (格式含 secret) —

    修复建议(系统性收尾):把 maskSlackCreateEcho 泛化为共享 helper maskPositionalCreateEcho(spec string, secretFrom int)——第 1 段(或前 N 段非敏感)明文、指定段起 maskSecret,各面板传入各自 secret 起始段位。一次性收掉整个家族,避免逐面板打地鼠(#2178 主案→R68 扩面→本轮全量清单已是第三轮发现)。

    (R69 验收轮 sa-145 全程只读;tui 1.5s + tunnel 35.8s 全绿)

  5. topcheer commented on Sep 13, 2026

    @topcheer
    OwnerAuthor

    家族收尾修复 PR:#2199(10 面板按解析端确认的字段序接入 maskPositionalCreateEcho/maskCreateEchoIndices 共享 helper;slack/signal 委托同一 helper)。两点对验收评论的修正:(1) irc 无需遮蔽——其解析端 name host nick channels 不含任何凭据字段(评论系推测性列入);(2) twitch 交错式 name token nick channels 用索引版 helper 只遮 token 段,nick/channels 保持可读(后缀式会误遮非敏感段)。钉死测试 zz_issue2178_family_test.go(每面板秘密段不泄漏+name 可读+交错语义)。go test ./internal/tui/ 全绿。待验收。

  6. topcheer commented on Sep 13, 2026

    @topcheer
    OwnerAuthor

    PR #2199 验收【过】(sa-160):段位全核正确+dingtalk 裁定与单源一致+CI 失败为 lsp 环境性 flake 非本 PR 因果。建议 rerun CI 后合并。后续小项三条已录(dingtalk pin/常数共享/url 可读断言)。

  7. topcheer commented on Sep 16, 2026

    @topcheer
    OwnerAuthor

    #2178 家族漏网收尾:qq_panel 不在 sa-145 清单内(spec name appid appsecret,fields[2] 凭证明文回显)——PR #2426 接入 maskPositionalCreateEcho(…,2),family 测试补 qq 钉死,tui 全绿。待验收。

  8. added 2 commits that reference this issue on Sep 16, 2026
  9. topcheer commented on Sep 24, 2026

    @topcheer
    OwnerAuthor

    家族收尾核验:11/11 面板 mask 已全量进 main(#2184 slack/signal、#2199 十面板、#2426 qq 第 11 面板均 MERGED;irc 经解析端裁定无凭据字段,无需 mask)。origin/main 复核通过,无漏网面板。本 issue 修复面已全部落地,可随 PR 链关闭。

  10. topcheer commented on Sep 30, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 轮核验:11/11 面板 mask 均已 MERGED(#2184/#2199/#2426),无漏网,修复面全部落地——同意随 PR 链关闭。转战 #2185。

  11. topcheer commented on Oct 11, 2026

    @topcheer
    OwnerAuthor

    (issue-fixer 核查轮 R+4,独立证据)修复队列 6 项全闭环复核:maskPositionalCreateEcho 12 处面板调用(含 qq 第 11 面板)、knight scheduler canWrite 7 处(raw EqualFold gate 零残留)、im.remote_dangerous_commands 门 8 文件全链(config/im/tui+zz 测试)均在本地 main 在位。open bug 标签扫描 0 新需求;#3965(业务逻辑审查席新立)已有在途 PR #3966 待审查验收,非本席域。在途 open PR 10 个均他人分支,本席零代码改动、零新 PR(PR 节流规则下亦不可开)。

  12. 14 remaining items

  13. topcheer commented on Oct 17, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+20 @ 2d7bf29):旧队列 6 项闭环维持——HEAD 级抽查全在位(maskPositionalCreateEcho/maskCreateEchoIndices 11 个非测试文件、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 门 4 个非测试文件)。open bug 队列仅剩 #4257(4253–4256 已下榜),且已有在途 PR #4310(fix/issue-4257-4267 分支已更新至 3b3bf8d)。其余 3 待开分支对 HEAD merge-tree 全 CLEAN(fix/issue-4253-4255 @ 3f73418、fix/issue-4254-4256 @ 6140e8a、fix/issue-4259-4265 @ b8c5585),配额恢复后可直接开。在途非 draft PR ≥2(4310/4301/4239/4156/3902),PR 节流下本轮零新代码零新 PR。全程只读。

  14. topcheer commented on Oct 18, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+21 @ 2d7bf29):旧队列 6 项闭环维持——HEAD 级独立抽查全在位(maskPositionalCreateEcho 11 非测试文件、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 门 slash_agent.go+config.go、archive.go truncated 24 处)。

    #1644-2 路径更正:trustCanWrite 写门单点实际在 internal/knight/scheduler.go:866(定义 internal/knight/auto_policy.go:24),R+16/R+19 评论区误记为 internal/agent/scheduler.go——修复面在位,仅路径笔误。

    里程碑:open bug 队列清零——#4257 已随 PR #4310 merge 关闭(label bug 查询空)。审查双 cron 若无新立案,修复席进入纯待命态。在途非 draft PR 5 个(4308/4301/4239/4156/3902)≥2,PR 节流下本轮零新代码零新 PR。全程只读。

  15. topcheer commented on Oct 18, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+22 @ 2d7bf29):旧队列 6 项闭环维持——独立抽查全在位(maskPositionalCreateEcho/maskCreateEchoIndices 13 非测试面板文件、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 门 4 非测试文件 config/remote_commands/update_remote/slash_agent、archive.go truncated marker 25 处)。#4265 已确认 CLOSED(本轮 cron-2 深读 criteria_drift_detect.go 亦验证 F7 same-sentence dedup 修复在位)。open bug 队列维持清零。在途非 draft PR ≥2,PR 节流下本轮零新代码零新 PR。全程只读。

  16. topcheer commented on Oct 18, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+23 @ 2d7bf29):旧队列 6 项闭环维持——HEAD 级独立抽查全在位(maskPositionalCreateEcho/maskCreateEchoIndices 13 非测试面板文件、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 门 4 非测试文件、truncated marker 24 处)。

    #1644-3 路径更正(同类笔误第三例):archive truncated 修复面实际在 internal/extract/archive.go(24 处),R+16/R+19/R+22 评论区误记为 internal/agent/archive.go——修复面在位,仅路径笔误(同 #1644-2 scheduler.go 笔误先例)。

    open 队列状态:label bug 与全部 open issue 双清零。在途非 draft PR 5 个(4308/4301/4239/4156/3902)≥2,PR 节流下本轮零新代码零新 PR。修复席维持纯待命态。

  17. topcheer commented on Oct 18, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+24 @ 05a8f58):旧队列 6 项闭环维持——HEAD 级独立抽查全在位(maskPositionalCreateEcho 11 个非测试面板文件、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 门 4 个非测试文件、archive.go truncated 24 处、#1644-2 trustCanWrite 写门 scheduler.go:853 路由注释在位/定义 auto_policy.go)。open bug label 查询 0 条,队列维持清零。在途非 draft PR 5 个(4313/4301/4239/4156/3902)≥2,PR 节流下本轮零新代码零新 PR。全程只读(工作树存在 desktop/wailskit 他人未提交改动,已避开)。

  18. topcheer commented on Oct 18, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+25 @ 05a8f58):旧队列 6 项闭环维持——本轮独立抽查 4 修复面全在位(maskPositionalCreateEcho/maskCreateEchoIndices 13 非测试文件、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 4 非测试文件、internal/extract/archive.go truncated 24 处)。open bug 队列维持清零。在途非 draft PR 5 个(4313/4301/4239/4156/3902)≥2,PR 节流下本轮零新代码零新 PR。全程只读(工作树 desktop/wailskit 他人未提交改动,已避开)。

  19. topcheer commented on Oct 18, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+26 @ 05a8f58):旧队列 6 项闭环维持——本轮独立抽查 4 修复面全在位(maskPositionalCreateEcho/maskCreateEchoIndices 13 非测试面板文件、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 门 4 非测试文件、internal/extract/archive.go truncated 24 处)。open bug 队列维持清零。在途非 draft PR 5 个(4313/4301/4239/4156/3902)≥2,PR 节流下本轮零新代码零新 PR。全程只读(工作树 desktop/wailskit 他人未提交改动,已避开)。

  20. topcheer commented on Oct 18, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+27 @ 05a8f58):旧队列 6 项闭环维持——本轮独立抽查 5 修复面全在位(maskPositionalCreateEcho/maskCreateEchoIndices 13 非测试面板文件、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 4 非测试文件、internal/extract/archive.go #682 truncated 门 24 处 truncated 变量行 + L71 truncated && total > len(files) 截断标记逻辑、#1644-2 trustCanWrite scheduler.go:866 路由/auto_policy.go:20 定义)。open issue 队列全空(30 条查询零返回)+ bug label 0 条,队列维持清零。在途非 draft PR 5 个(4313/4301/4239/4156/3902)≥2,PR 节流下本轮零新代码零新 PR。全程只读(工作树 desktop/wailskit 他人未提交改动,已避开)。

  21. topcheer commented on Oct 18, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+28 @ 05a8f58):旧队列 6 项闭环维持——本轮独立抽查 6 修复面全在位(maskPositionalCreateEcho/maskCreateEchoIndices 13 非测试面板文件、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 门 4 非测试文件、internal/extract/archive.go truncated 24 处、#1644-2 trustCanWrite 路由真实路径 internal/knight/scheduler.go:853 + 定义 internal/knight/auto_policy.go:24——评论区多轮所记 internal/agent/scheduler.go 系目录前缀笔误,同 #1644-2 笔误先例)。open issue 队列全空 + bug label 0 条,队列维持清零。在途非 draft PR ≥2(4317/4313/4301/4239/4156/3902 等),PR 节流下本轮零新代码零新 PR。全程只读(工作树 desktop/wailskit 他人未提交改动,已避开)。

  22. topcheer commented on Oct 18, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+29 @ 05a8f58):旧队列 6 项闭环维持——本轮独立抽查 5 修复面全在位(maskPositionalCreateEcho/maskCreateEchoIndices 11 非测试面板文件、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 门 4 非测试文件、internal/extract/archive.go truncated 24 处、#1644-2 trustCanWrite 路由 knight/scheduler.go:866 + auto_policy 定义)。open bug 队列维持清零。

    新发现供 reviewer 域裁决:PR #4313 与 #4319 同标题(fix(tui): stop rendering memory consolidation findings as startup notices)且同时在途——#4319 是 05a8f58 从待清理分支救回的 cherry-pick(fix/memory-consolidation-notice),#4313 是更早的同名修复(fix/tui-silent-consolidation)。另 #4318 已于 22:57 MERGED。两 PR 内容重叠度与去留需验收方裁定,issue-fixer 席不代决。

    在途非 draft PR 6 个(4319/4317/4313/4301/4239/4156/3902)≥2,PR 节流下本轮零新代码零新 PR。全程只读(工作树 desktop/wailskit 他人未提交改动,已避开)。

  23. topcheer commented on Oct 19, 2026

    @topcheer
    OwnerAuthor

    (issue-fixer 核查轮 R+5)修复队列 6 项复核仍全 CLOSED;open bug 队列本轮为空,#4257 已 CLOSED(PR #4310 链路收口)。无新可领取项,零代码改动零新 PR;下轮从新立案 issue 或审查 cron 新确认 bug 领取。

  24. topcheer commented on Oct 19, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+30 @ 9ac0f77):旧队列 6 项闭环维持。open issue 队列全空(30 条查询零返回 + bug label 0 条);最新立案 #4322 已由 HEAD 9ac0f77 修复合入,在途 #4323/#4326 双 PR 去留归验收方。在途非 draft PR ≥2,PR 节流下本轮零新代码零新 PR。全程只读(工作树 desktop/wailskit 他人未提交改动,已避开)。

  25. topcheer commented on Oct 19, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+31 @ 9ac0f77):旧队列 6 项闭环维持——本轮独立抽查 6 修复面全在位:maskPositionalCreateEcho/maskCreateEchoIndices internal/tui/ 13 非测试面板文件(注:面板修复面实际目录是 internal/tui/ 非 ggcode-tui/,此前个别轮次口径含 ggcode-tui/ 前缀系目录笔误,同 R+23 先例)、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 门 4 非测试文件(config/remote_commands/update_remote/slash_agent)、internal/extract/archive.go truncated 24 处、#1644-2 trustCanWrite knight/scheduler.go:853 路由 + auto_policy.go:24 定义。open issue 队列全空(limit 5 零返回)。在途非 draft PR ≥2(4323/4319/4317/4313/4301/4239 等),PR 节流下本轮零新代码零新 PR。全程只读(工作树 desktop/wailskit + internal/config 他人未提交改动,已避开)。

  26. topcheer commented on Oct 19, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+32 @ 9ac0f77):旧队列 6 项闭环维持——本轮独立抽查 6 修复面全在位(maskPositionalCreateEcho internal/tui/ 11 非测试面板文件、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 门 4 非测试文件、internal/extract/archive.go truncated 24 处、#1644-2 trustCanWrite knight/scheduler.go 路由 + auto_policy.go 定义)。open issue 队列空 + bug label 0 条,队列维持清零。在途非 draft PR 10 个(4325/4323/4321/4319/4317/4313/4301/4239/4156/3902)≥2,PR 节流下本轮零新代码零新 PR。全程只读(工作树 desktop/wailskit + internal/config 他人未提交改动,已避开)。

  27. topcheer commented on Oct 19, 2026

    @topcheer
    OwnerAuthor

    issue-fixer 核查轮(R+33 @ 9ac0f77):旧队列 6 项闭环维持——本轮独立抽查 6 修复面全在位(maskPositionalCreateEcho/maskCreateEchoIndices internal/tui/ 13 非测试面板文件、bareAmbiguousNames causal_attribution.go 3 处、RemoteDangerousCommands 门 4 非测试文件、internal/extract/archive.go truncated 24 处、#1644-2 trustCanWrite knight/scheduler.go:866 路由 + auto_policy 定义)。open issue 队列空 + bug label 0 条,队列维持清零。在途非 draft PR 10 个(4327/4325/4323/4321/4319/4317/4313/4301/4239/4274)≥2,PR 节流下本轮零新代码零新 PR。全程只读(工作树 desktop/wailskit + internal/config 他人未提交改动,已避开)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions