Repository navigation
Replies: 2 comments
|
Thank you for writing this up with the stderr excerpt — the paths in it are what made the cause findable, and I am sorry about the files. The mechanism is quoting, and it is now measured rather than inferred. cmd /c "rd /s /q \"$d\""the double-quoted string ends at that quote. I ran the exact line under PowerShell 7.6.7 with a stand-in
On your five asks, split by who owns them.
What now exists. npm i github:argszero/dsh-recursive-delete-guardMount it through its What it does not do, so nobody relies on it for more. It is not a sandbox: a recursive delete aimed at a real subdirectory passes untouched, including outside the workspace. It cannot see an expansion — I could not reproduce the deletion itself — no Windows host here — so the evidence is the tokenizer measurement above plus your stderr, not a re-run of the incident. The core fix is still the one your items 1, 2 and 4 describe. |
|
Hi ZyptusOn, thanks for posting such a clear log. Since the quoting fix, have you kept approval on never, or moved risky commands back behind a prompt? Running with approval off is exactly when a recursive delete near the drive root should still need a fresh yes, and Vestige, the open source tool I built, enforces that outside the model and keeps a receipt for every command it allowed or stopped. Happy to show you how it would fit your setup. Sam |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TL;DR: A cleanup command intended for a project subdirectory was executed with
cmd /c rd /s /qand traversed from theC:/root. It deleted 48 user music files and much ofC:/Program Filesbefore the 120 s timeout; a sanitized excerpt is below, and the full 21 MB log/hash can be provided privately.[Bug][Safety] DSH 0.2.1-rc.2: cleanup command expanded to C:/ root and deleted user files
Environment
What happened
At 2026-10-21 18:11:30, a cleanup command intended to remove only:
was executed as:
Instead of removing that directory, the child process traversed from the C:/ root.
It deleted C:/CloudMusic (48 files), CloudMusic resources, and much of
C:/Program Files before the 120 s tool timeout killed it, before C:/Users was reached.
Evidence
1, /PROGRA1, /PROGRA~2I can provide the full log privately if needed; it contains local paths, so I am not
attaching all of it publicly.
Impact
What I think should change
to receive a root/empty/ambiguous path; resolve and validate the target first.
danger-full-access, or provide a workspace-only delete guard.
file API and reject paths outside the approved workspace.
and traversed multiple top-level directories.
that no path outside the workspace is touched.
Note
I understand DSH is a developer preview and SAFETY.md warns that model-generated
commands can delete files. The issue here is not sandbox bypass: the command was
intended to be scoped to a project directory, but path/quoting expansion made it
target the C:/ root.
Minimal repro (do not run on a real C: drive)
Use a disposable VM. Set an empty or malformed $d, run the command form above,
and observe whether rd resolves outside the intended directory.
Sanitized stderr excerpt
All reactions