github / github/copilot-cli

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

オープン
#4,241 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:tools
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
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:// の値をどのように処理するか、またエージェントが結果をどのように受け取るかを追跡します。パスワードではない URL テキストが一貫して表示され、通常のファイル編集でエージェントが代替の読み取りを必要としなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python, shell
領域
cli, security
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。