[bug] settings.system.json: single-slash permission rules miss system dirs

Đang mở Phù hợp với người mới
#2,954 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 5 ngày

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
tooling

Hướng nghiên cứu

Tìm nơi settings.system.json định nghĩa tám quy tắc quyền và kiểm tra cách các cài đặt hệ thống cùng các lớp phủ cài đặt được kết hợp. Đọc điểm vào kiểm tra hoặc lint cài đặt được đề cập trong codebase, nếu có. Cập nhật các quy tắc để dùng hai dấu gạch chéo ở đầu và đảm bảo các lớp phủ có mảng deny riêng không rỗng cũng nhận được chỉnh sửa tương tự; hoàn tất khi cả tám quy tắc đều nhắm đến các đường dẫn hệ thống tệp được mô tả và lỗi hồi quy dùng một dấu gạch chéo được phát hiện.

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

Mô tả

What happened

settings.system.json writes its system-directory permission rules with one leading slash, so Claude Code resolves them under the settings root and they do not protect the system directories they name. On a case-insensitive volume the bin rule blocks edits to the install's own Bin folder instead.

Summary

What happens

settings.system.json writes eight permission path rules with one leading slash. Claude Code reads a single leading slash as relative to the settings root, and a double slash as the filesystem root. So these rules point inside the install, not at the system.

Deny rules affected (rule text shown without its leading slash, so a path scrubber leaves it readable): Edit(System/**), Edit(bin/**), Edit(etc/**), Edit(sbin/**), Edit(usr/**).

Allow rules affected, same notation: Edit(private/tmp/**), Edit(tmp/**), Edit(var/folders/**).

Effect

  • The five deny rules give no protection to the system directories.
  • On a case-insensitive volume, the macOS default, the bin rule matches the install's own Bin folder. The assistant is refused when it edits a script there: "File is in a directory that is denied by your permission settings".
  • The three allow rules grant edits under same-named folders inside the install, not the temp directories.

How I confirmed it (8.761.0, macOS)

  1. An Edit of a script in the install's Bin folder was refused with the message above.
  2. I changed the bin rule to the double-slash form. The same Edit then succeeded.
  3. I moved the other deny rules to the double-slash form and probed each with an Edit against a file that does not exist. The system usr, bin, sbin, System and etc directories each refused with the deny message. A control inside the install's Bin folder returned "File does not exist", so it was no longer blocked.

Suggested fix

Write all eight rules with the double leading slash. A lint in the settings check that rejects any Edit(, Read( or Write( rule starting with exactly one slash would stop it coming back.

One note for whoever picks this up: an install whose overlay carries its own non-empty deny array replaces the system list, so that overlay needs the same correction.

Details

  • Kind: bug
  • LifeOS version: 8.761.0

Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.

Ngôn ngữ chính
TypeScript
Star
20.7k
Fork
2.6k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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.

Issue khác của danielmiessler/LifeOS

Tất cả issue của danielmiessler/LifeOS

Issue tương tự

Thêm issue về TypeScript

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.