github / github/copilot-cli

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

Đang mở
#4,601 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

area:permissions
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lệnh đã được báo cáo từ một phiên Copilot CLI có thư mục gốc là /work, đặc biệt là đường dẫn tương đối ../subfolder4 sau khi thay đổi thư mục. Theo dõi bước kiểm tra quyền truy cập workspace của CLI và xác minh rằng nó phân giải đường dẫn của lệnh trước khi so sánh. Được xem là hoàn tất khi một mục cùng cấp trong workspace được chấp nhận mà không có lời nhắc allow-list, trong khi một đường dẫn thực sự bên ngoài vẫn bị từ chối.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
shell
Lĩnh vực
cli, security
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
66/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.