Skip to content

[codex] Fix authz, scope propagation, and shell-injection bugs#320

Open
jmecom wants to merge 8 commits intoblock:mainfrom
jmecom:jm/morevulns
Open

[codex] Fix authz, scope propagation, and shell-injection bugs#320
jmecom wants to merge 8 commits intoblock:mainfrom
jmecom:jm/morevulns

Conversation

@jmecom
Copy link
Copy Markdown
Collaborator

@jmecom jmecom commented Apr 14, 2026

Summary

This PR fixes the authz, scope-propagation, and shell-injection vulnerabilities identified in the recent security review, and adds regression coverage for each fix.

What changed

  • prevent non-bootstrap callers from minting child tokens with scopes outside the caller context
  • require workflow ownership for workflow mutation/trigger paths and keep channel-bound workflows from sending outside their bound channel
  • preserve token channel restrictions across aggregate REST endpoints and WebSocket session handling
  • require API-token WebSocket auth to present a valid NIP-42 proof before token verification
  • re-check workflow execution against the owner/channel access context used at run time
  • stop managed-agent discovery from interpolating attacker-controlled command strings into a login shell
  • add regression tests covering each vulnerability class

Root cause

The main issue was incomplete mediation after authentication: once a caller was authenticated, several paths dropped delegated token/channel context or failed to bind the action to the specific protected resource. The desktop issue was separate: command lookup treated user-controlled input as shell syntax instead of data.

Validation

  • cargo test -p sprout-auth --lib
  • cargo test -p sprout-workflow --lib
  • cargo test -p sprout-relay --lib
  • cargo test --manifest-path desktop/src-tauri/Cargo.toml --lib

@jmecom jmecom marked this pull request as ready for review April 14, 2026 19:57
@jmecom jmecom requested a review from wesbillman as a code owner April 14, 2026 19:57
@wesbillman
Copy link
Copy Markdown
Collaborator

@tlongwell-block this one might be good for you to review

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.

2 participants