Windows sandbox: one PATH folder whose permissions can't be read breaks every later helper start

Chiusa
#163 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust, typescript
Ambito
desktop, security

Direzione di ricerca

Read win.rs around RecoveryRecord::undo (1216–1290), recover_abandoned_runs (1293–1335), and the grant logic (1588–1594, 1688–1708). Start by running the Rust tests for sandbox recovery; the issue requests a test where one failed undo does not prevent other records from recovering. Done means access-denied revocation is handled safely and recovery continues per record, quarantining records after repeated failures.

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

Descrizione

bug platform: windows priority: medium severity: high

Found in the 2026-10-07 code review (traced through the code; not reproduced with a real folder that denies reading its permissions). Related to #152, which has a different trigger.

Problem

  • run records every existing read_only path in record.granted before granting, and ignores grant failures for non-required paths (win.rs:1588-1594, 1688-1708).
  • RecoveryRecord::undo (win.rs:1216-1290) calls edit_acl(path, sid, 0, Revoke) for each one. That starts with GetNamedSecurityInfoW and returns Err when the permissions can't be read.
  • The record is kept, and DeleteAppContainerProfile is skipped. On the next start, recover_abandoned_runs (win.rs:1293-1335) hits the same error, serve sends Error{id:null}, and the helper exits.

Scenario

PATH contains a folder that exists but whose permissions the user can't read (for example an admin's tool folder added machine-wide, or a restricted share). After the first sandboxed command, every sandboxed command fails with "cannot read the permissions of X". This lasts until the user deletes the record under %LOCALAPPDATA%\Patch\sandbox-recovery by hand.

Fix

  • When revoking, treat ERROR_ACCESS_DENIED from GetNamedSecurityInfoW as "nothing to undo". Without READ_CONTROL/WRITE_DAC the grant could never have been applied.
  • Recover each record on its own: log a failure, keep going with the other records, and quarantine a record after N failed attempts instead of aborting the helper.
  • Rust test: one record whose undo fails, with the other records still recovered.
Lingua principale
TypeScript
Stelle
2
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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.

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.