Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#294 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
git, typescript
Ambito
desktop, security

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
TypeScript
Stelle
2
Fork
2
Merge medio
5h 28m
PR unite (30g)
24

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PierrunoYT/patch

Tutte le issue di PierrunoYT/patch

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.