github / github/copilot-cli

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

Abierto
#4,241 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

area:tools
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce el problema en la view tool usando un archivo que contenga la DB_URL mostrada y compara su contenido mostrado con las lecturas sin procesar de bash y Python. Sigue cómo el enmascaramiento de contraseñas gestiona el valor postgres:// y cómo el agente recibe el resultado. Se considera terminado cuando el texto de la URL que no sea la contraseña se muestre de forma coherente y el agente ya no necesite lecturas alternativas para las ediciones de archivos habituales.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python, shell
Área
cli, security
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Necesita aclaración
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.