github / github/copilot-cli

Copilot constantly nags about "parent directory" access when it's clearly in a subfolder of the project directory

Offen
#4,601 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

area:permissions
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

Describe the bug

When using Claude Opus, it will occasionally cd into a lower directory and then access a sibling directory using the relative parent directory shortcut (..). This will inevitably be flagged by Copilot CLI as going outside of the project directory, which is clearly incorrect. Rather than assuming .. is going out of the project directory, Copilot CLI should be getting the absolute directory and checking that.

Affected version

Copilot v1.0.80

Steps to reproduce the behavior

Example issue:

  1. Start Copilot CLI in /work.
  2. Ask Claude to review code with a deep directory structure.
  3. Claude will use something like the following command: cd subfolder/subfolder3/subfolder5 && grep -rn "searching for text" ../subfolder4
  4. The CLI incorrectly "warns" me that it's accessing a directory outside my workspace. And then wants me to add ../subfolder4 to my "allowed" directories, which is not secure. If it was added to the "allowed" directories, it actually could do it at the top level.
Expected behavior

The CLI should be converting relative addressing to absolute addressing and checking the full path.

Additional context

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, den gemeldeten Befehl aus einer Copilot CLI-Sitzung mit dem Arbeitsverzeichnis /work zu reproduzieren, insbesondere den relativen Pfad ../subfolder4 nach dem Wechsel des Verzeichnisses. Verfolge die Workspace-Zugriffsprüfung der CLI und stelle sicher, dass sie den Pfad des Befehls vor dem Vergleich auflöst. Erledigt ist dies, wenn ein innerhalb des Workspace liegender Nachbar ohne Allow-List-Aufforderung akzeptiert wird, während ein tatsächlich externer Pfad weiterhin abgelehnt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
shell
Bereich
cli, security
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
66/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.