Skip to content

fix(security): address HIGH findings from security audit#830

Merged
Aaronontheweb merged 4 commits into
devfrom
fix/security-audit-high-findings
Apr 30, 2026
Merged

fix(security): address HIGH findings from security audit#830
Aaronontheweb merged 4 commits into
devfrom
fix/security-audit-high-findings

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

Summary

Addresses the 4 HIGH-severity findings from the 2026-04-29 security audit (OpenProse security-audit.prose workflow).

  • Categorically deny sudo/su/doas in ShellCommandPolicy — previously, prepending sudo to any denied command bypassed all deny patterns because verb-chain matching operated on tokens[0]. New PrivilegeEscalationDenyPattern blocks these as first-token verbs.
  • Move SecretOutputRedactor.Redact() to DispatchingToolExecutor — previously only ShellTool and BackgroundJobExecutionActor applied redaction. Now all tool outputs (FileReadTool, WebFetchTool, McpToolAdapter, etc.) are redacted before reaching the LLM.
  • Gate raw OAuth tokens to loopback only in /api/provider/oauth/status/{state} — remote paired devices now see null for accessToken/refreshToken instead of raw provider credentials. The CLI (always loopback) continues to receive tokens for provider setup.

Related: #829 (Roslyn analyzer for enforcing pipeline-level redaction)

Test plan

  • 6 new tests for privilege escalation deny (sudo, su, doas, compound, case-insensitive, bash -c wrapped)
  • All 34 ShellCommandPolicyTests pass
  • Build succeeds across Security, Actors, and Daemon projects
  • Verify existing provider OAuth setup flow still works via CLI (loopback path unchanged)
  • Verify paired remote device cannot read raw tokens from status endpoint

- Categorically deny privilege escalation commands (sudo, su, doas)
  in ShellCommandPolicy. Previously, prepending sudo to any denied
  command bypassed all deny patterns because matching operated on
  tokens[0].

- Move SecretOutputRedactor.Redact() to DispatchingToolExecutor so
  all tool outputs are redacted before reaching the LLM, not just
  shell and background job outputs.

- Gate raw OAuth token values in provider status endpoint to loopback
  connections only. Remote paired devices see boolean flags instead
  of raw access/refresh tokens.

Closes finding S4-20, S5-01, S7-5.5 from the 2026-04-29 audit.
…t safe-list tools

User-facing subagents are now restricted to the SubAgentToolPolicy safe list
(attach_file, file_read, web_fetch, web_search) at tool resolution time.
Tools on the safe list are auto-granted in non-interactive contexts instead of
being denied by the approval gate, fixing subagents that had zero usable tools.

Closes #831
@Aaronontheweb Aaronontheweb force-pushed the fix/security-audit-high-findings branch from 4efd224 to 6d2be97 Compare April 30, 2026 00:12
…crets

Add redaction patterns for AWS access keys (AKIA...), JWT tokens
(eyJ...three-segment), and ADO.NET connection string passwords
(Password=/Pwd=). Expand JSON key name list to catch client_secret,
signing_key, private_key, connection_string, and credential. Stop env
regex at semicolons to avoid clobbering connection string structure.

Reorganize tests into Theory/InlineData patterns for consistency.
…t for loopback gate

Add redaction patterns for AWS access keys (AKIA...), JWT tokens,
and ADO.NET connection string passwords (Password=/Pwd=). Expand JSON
key name list to catch client_secret, signing_key, credential, etc.

Fix ProviderOAuthEndpointTests to set RemoteIpAddress on TestServer
(defaults to null, not loopback). Add test verifying tokens are hidden
for non-loopback requests.
@Aaronontheweb Aaronontheweb marked this pull request as ready for review April 30, 2026 01:12
@Aaronontheweb Aaronontheweb merged commit 92b7845 into dev Apr 30, 2026
5 checks passed
@Aaronontheweb Aaronontheweb deleted the fix/security-audit-high-findings branch April 30, 2026 01:12
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