security: guard and protected-config lists miss hook managers, package-manager, CI and devcontainer files, and some secret files

Đã đóng Phù hợp với người mới
#283 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.

Đá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
74/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
security

Hướng nghiên cứu

Bắt đầu với src/main/tools/guard.ts và src/main/tools/sandbox_config.ts để xem GUARDED, SECRETS và PROTECTED_CONFIG được đối chiếu như thế nào, sau đó đọc guard.test.ts và các bài kiểm tra cấu hình sandbox. Bổ sung kiểm thử cho các mẫu hook, trình quản lý gói, CI, devcontainer, agent và tệp bí mật đã liệt kê. Công việc hoàn tất khi các trường hợp mới được kiểm thử và các bài kiểm tra hiện có vẫn chạy thành công.

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

Mô tả

priority: medium security severity: low

Found in the Oct 11 audit (at c5f5641). Follow-up to #236, #262 and #271.

Where: src/main/tools/guard.ts:18-39 (GUARDED, SECRETS); src/main/tools/sandbox_config.ts:9-35 (PROTECTED_CONFIG).

.husky/, .git/ and .github/ are protected because their contents run outside the sandbox later. Files that work the same way are not:

  • Hook managers: .pre-commit-config.yaml (repo: local hooks), lefthook.yml / .lefthook.yml, .simple-git-hooks.*
  • Package managers: .yarnrc.yml (yarnPath), .pnpmfile.cjs
  • CI: .gitlab-ci.yml, .circleci/, azure-pipelines.yml, bitbucket-pipelines.yml, .travis.yml, Jenkinsfile
  • Editor config that runs on the host: .devcontainer/ (initializeCommand), *.code-workspace (folder-open tasks)
  • Other agents' config: GEMINI.md, .cursorrules, .windsurfrules, .clinerules, .roo/, .aider.conf.yml

Missing from SECRETS (these files are also embedded for search, code_index.ts:291): .git-credentials (the .git(/|$) pattern does not match it), *.env such as prod.env, credentials.json, *.tfvars, terraform.tfstate.

Impact: in Auto mode an edit, or a sandboxed command, can plant a command that runs unsandboxed on the user's next commit, yarn, CI run or devcontainer open, without an approval card.

Fix: extend GUARDED, SECRETS and PROTECTED_CONFIG, with tests in guard.test.ts and the sandbox config tests.

Ngôn ngữ chính
TypeScript
Star
2
Fork
2
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

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 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.