github kenryu42/cc-safety-net v2.7.12

one hour ago

Closes a PowerShell gap where recursive Remove-Item deletions of directories outside the working directory were allowed whenever -Force was absent.

Fixed

  • Fixed PowerShell recursive deletes being judged only when -Recurse and -Force appeared together, which allowed Remove-Item -Recurse <dir-outside-cwd> on the standard, strict, and paranoid levels. -Recurse alone already removes a non-empty directory without a prompt, so the checks now key on -Recurse by itself, the same way rm -r does. (#348)
    • Covers relative and absolute targets, -Path and -LiteralPath, and the ri, del, erase, rd, rm, and rmdir aliases. The current-directory, home-directory, strict dynamic-target, and paranoid checks now apply to plain -Recurse as well.
    • Recursive deletes inside the working directory on standard, temp paths, allow_paths entries, and -WhatIf commands stay allowed, and commands without -Recurse are unaffected.
    • Known limitation: -Recurse:$false is still read as recursive, so Remove-Item -Recurse:$false ../outside.txt is now blocked even though it does not delete recursively.

Changed

  • Changed Remove-Item -r -f . to be blocked as a delete of the current directory. It was previously allowed only because -f is too short to be recognized as -Force.

Don't miss a new cc-safety-net release

NewReleases is sending notifications on new releases.