github / github/copilot-cli

Password masking feature fails to mask passwords from agents and makes them use extra tokens

未关闭
#4,241 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:tools
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the bug

Every time I have an agent read a file with a password in, (most often it is a dummy password) the password gets masked from the agent. The agent then every single time, uses python to read the underlying bytes in the file, and gets stuck on thinking the password is an issue, when the password is not an issue, it just picks up as a false positive due to not being able to read the password. From that point, all file edits by the agent are done via python instead of the view tool.

### Affected version

GitHub Copilot CLI 1.0.74.

### Steps to reproduce the behavior

Here is a little snippet from my conversation, with paths to my files redacted:
"""
The file uses \`\` which is masking the password in the DB_URL default. The view tool is showing this. Let me check the raw content to be safe. The old_str I'm trying to match includes `"localhost:5432/password_dummy"` but with what the view shows, the match should work. Let me check more carefully... Ah wait, looking at the view output again - it shows `"localhost:5432/password_dummy"` but when I tried to match this in old_str with the exact same text, it didn't match. This is strange. The view tool might be masking actual content (the `postgres://` prefix is being masked as \`\`). Let me use bash to check the actual content. Shell Read raw install.sh content 21 lines… head -20 {REDACTED} | cat Shell Check raw DB_URL line bytes 6 lines… python3 - << 'EOF' with open('{REDACTED}', 'rb') as f: content = f.read() # Show hex of the DB_URL line for line in cont… Thought for 3s OK the view tool is masking `postgres://` with \`\`. The raw content actually has `postgres://` replaced with \`\` which is the view tool masking. Wait no - let me look more carefully. The bash output also shows `localhost:5432/password_dummy`. So the actual file content has `localhost:5432/password_dummy` as the default URL. This is probably `postgres://` being masked. Actually looking at this again, the file literally contains the string `"postgres://localhost:5432/password_dummy"` and the view tool is masking the `postgres://` prefix. Let me verify by showing more bytes:
"""

### Expected behavior

_No response_

### Additional context

_No response_

贡献指南

打开贡献指南

调研方向

使用包含所示 DB_URL 的文件在 view tool 中重现该问题,并将其显示内容与 bash 和 Python 的原始读取结果进行比较。跟踪密码掩码如何处理 postgres:// 值,以及 agent 如何接收结果。当非密码 URL 文本能够一致地显示,并且 agent 不再需要通过其他读取方式处理普通文件编辑时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python, shell
领域
cli, security
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
需要澄清
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。