Skip to content

Fix auth and SSRF vulns#261

Merged
jmecom merged 3 commits into
block:mainfrom
jmecom:fix/vuln-report-findings
Apr 10, 2026
Merged

Fix auth and SSRF vulns#261
jmecom merged 3 commits into
block:mainfrom
jmecom:fix/vuln-report-findings

Conversation

@jmecom

@jmecom jmecom commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR fixes a set of auth and SSRF weaknesses in the relay and desktop client.

The relay changes close authorization gaps around personal workflows, stop trusting request forwarding headers when verifying NIP-98 token mints, cut off live WebSocket subscriptions immediately after channel membership is revoked, and block IPv6 unspecified addresses in workflow webhook SSRF checks. The desktop changes harden authenticated Tauri request construction so attacker-controlled IDs cannot be interpreted as raw path traversal on the relay origin.

Explanation of vulns

  • Personal workflows were missing owner checks on runs and trigger, so another authenticated user who learned a personal workflow UUID could trigger it and read run history.
  • POST /api/tokens rebuilt the signed NIP-98 URL from request headers, so a captured bootstrap mint request could be replayed to a different relay if that relay trusted attacker-supplied forwarded host/proto values.
  • Channel membership revocation only updated the database; it did not evict existing WebSocket subscriptions. A removed user who stayed connected could continue receiving new channel events until reconnect.
  • Workflow webhook SSRF checks blocked 0.0.0.0 but not IPv6 unspecified ::, which left a path to target localhost-bound IPv6 services via http://[::]:... and read the response back through workflow run history.
  • Several Tauri commands interpolated untrusted IDs directly into REST paths. In a WebView/IPC compromise, that let an attacker use .. segments to make authenticated same-origin requests to unintended relay routes.

What changed

  • Personal workflows now consistently enforce owner-only access for:
    • GET /api/workflows/:id/runs
    • POST /api/workflows/:id/trigger
  • POST /api/tokens now verifies NIP-98 signatures against the configured relay URL instead of X-Forwarded-* / Host.
  • Channel removals now evict existing live channel subscriptions for the removed user, so revoked access takes effect immediately for active sockets.
  • Workflow webhook SSRF validation now blocks IPv6 unspecified :: / [::] in both shared IP classification and workflow URL validation.
  • Desktop Tauri commands now build relay API paths from encoded path segments via a shared helper, and authenticated request builders reject raw . / .. traversal segments before sending same-origin requests.

@jmecom jmecom requested a review from wesbillman as a code owner April 7, 2026 21:50
@jmecom jmecom force-pushed the fix/vuln-report-findings branch from 186ae67 to 55abeda Compare April 7, 2026 22:02
@wesbillman

Copy link
Copy Markdown
Collaborator

@jmecom Thanks for this PR, is this good to merged now that it's approved?

@jmecom

jmecom commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator Author

@jmecom Thanks for this PR, is this good to merged now that it's approved?

Yes! I don't think I can merge though.

@jmecom jmecom force-pushed the fix/vuln-report-findings branch from 55abeda to fe17109 Compare April 9, 2026 20:47
@jmecom jmecom enabled auto-merge (squash) April 10, 2026 18:34
@jmecom jmecom merged commit 489d69f into block:main Apr 10, 2026
13 of 14 checks passed
tlongwell-block added a commit that referenced this pull request Apr 11, 2026
…ona-migration

* origin/main:
  feat(desktop): add Pulse social notes surface (#296)
  Fix flaky desktop smoke tests (#294)
  Add agent lifecycle controls to channel members sidebar (#291)
  Update nest_agents.md tagging info (#292)
  feat: add Sprout nest — persistent agent workspace at ~/.sprout (#290)
  Fix auth and SSRF vulns (#261)
  Add per-agent MCP toolset configuration to agent setup (#279)
  feat(desktop): team & persona import/edit flows (#288)
  Remove menu item subtitles and fix persona card overflow (#289)
  feat: Phase 1 video upload support (Blossom-compliant-ish) (#285)
  Add inline subtitles to menu items and field descriptions (#276)
  Improve ephemeral channel affordances and hide archived sidebar rows (#286)
  Fix @mention search to use word-boundary prefix matching (#278)
  Allow bot owners to remove their agents from any channel (#284)
  [codex] Polish agent selectors and settings layout (#283)

# Conflicts:
#	desktop/scripts/check-file-sizes.mjs
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.

3 participants