Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Sandbox: a sandboxed command can replace a submodule's .git, which host Git recurses into

Đã đóng
#294 0 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 1 ngày

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

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
git, typescript
Lĩnh vực
desktop, security

Hướng nghiên cứu

Start with src/main/tools/sandbox_git.ts and trace how validateSandboxGit protects the top-level Git metadata; inspect #262 for how protected top-level names handle renames. The issue lists several possible approaches, so first compare them against submodule gitlinks and sandbox command handling. Done means host Git cannot run planted submodule filters after a sandboxed command, with the chosen behavior covered by tests.

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

Mô tả

enhancement priority: medium security severity: medium

Follow-up to #273. Patch's own Git calls (Git panel, chat Git context) no longer look inside submodules: status and diffs run with --ignore-submodules=dirty, and checkout/restore with submodule.recurse=false.

What remains is the sandbox side: a submodule's .git is a working-tree entry (a gitfile, or an in-tree folder), so a sandboxed command can replace it with planted metadata, for example a folder whose config defines filter.x.clean plus a .gitattributes in the submodule. validateSandboxGit (src/main/tools/sandbox_git.ts) protects only the top-level .git, HEAD and the Git directories. The next git status the user runs in their own terminal or editor recurses into the submodule and runs that filter outside the sandbox.

Protecting <submodule>/.git by path is not enough on its own: the submodule folder itself stays writable, so a command can rename it away and create a new one with planted metadata. Options:

  • Protect each submodule .git named by the index's gitlinks and also refuse (or undo) a rename of the submodule folder, as #262 does for protected top-level names.
  • After each sandboxed command, compare every submodule's .git with a snapshot and report or restore a changed one.
  • Document that host Git in a project with submodules can run code a sandboxed command left behind, as USAGE.md already says for hooks and filters of existing integrations.
Ngôn ngữ chính
TypeScript
Star
2
Fork
2
Merge trung bình
6 giờ 27 phút
Pull request đã merge (30 ngày)
37

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 khác của PierrunoYT/patch

Tất cả issue của PierrunoYT/patch

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.