Skip to content

Reduce PowerShell shell approval repetition - #1837

Merged
Aaronontheweb merged 2 commits into
devfrom
fix/pwsh-approval-alpha2
Aug 9, 2026
Merged

Reduce PowerShell shell approval repetition#1837
Aaronontheweb merged 2 commits into
devfrom
fix/pwsh-approval-alpha2

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

Summary

  • Update ShellSyntaxTree to 0.3.0-alpha.2.
  • Prove one exact POSIX pwsh wrapper and evaluate the outer host plus each decoded PowerShell child command.
  • Apply hard-deny and protected-path checks before safe verbs or stored approvals.
  • Keep all other Bash wrappers and all Windows PowerShell wrappers one-shot only.
  • Add a 204-case shell approval review table and focused Windows matcher coverage.

Security review

An adversarial reviewer found and verified fixes for Bash-to-PowerShell quote decoding, option-bearing launcher prefixes, and Windows cmd quote removal. The final review passed with no material findings.

Validation

  • dotnet build -c Release: passed with zero warnings
  • dotnet test -c Release --no-build: passed
  • focused security and actor approval suites: passed
  • strict OpenSpec validation: passed
  • header verification: passed
  • Slopwatch: zero findings
  • git diff --check: passed

@Aaronontheweb
Aaronontheweb enabled auto-merge (squash) August 9, 2026 10:39
Comment on lines +255 to +263
foreach (var argument in occurrence.Clause.Args)
{
if (argument.IsPath
&& !string.IsNullOrWhiteSpace(argument.Resolved)
&& IsDeniedAgainst(argument.Resolved, _shellDeniedPaths))
{
return true;
}
}
Comment on lines +278 to +282
foreach (var redirect in occurrence.Redirects)
{
if (redirect.IsPathRelevant && DomainReferencesDeniedPath(redirect.Target))
return true;
}
Comment on lines +172 to +175
catch
{
return false;
}
Comment on lines +92 to +95
var deniedRoot = Path.Combine(
Path.GetTempPath(),
"netclaw-protected-root",
"config");
Defaults(),
new ShellCommandPolicy(),
new ToolPathPolicy([deniedRoot]));
var decodedPath = Path.Combine(deniedRoot, "secret.txt");
@Aaronontheweb
Aaronontheweb merged commit 60f5202 into dev Aug 9, 2026
21 checks passed
@Aaronontheweb
Aaronontheweb deleted the fix/pwsh-approval-alpha2 branch August 9, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant