github / github/copilot-cli

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

Ouverte
#4,241 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

area:tools
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
6

Description

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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Reproduisez le problème dans l’view tool avec un fichier contenant la DB_URL indiquée et comparez son contenu affiché avec les lectures brutes effectuées avec bash et Python. Suivez la manière dont le masquage du mot de passe traite la valeur postgres:// et dont l’agent reçoit le résultat. C’est terminé lorsque le texte de l’URL qui n’est pas le mot de passe s’affiche de manière cohérente et que l’agent n’a plus besoin de lectures alternatives pour les modifications de fichiers ordinaires.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python, shell
Domaine
cli, security
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
À clarifier
Accessibilité débutants
38/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.