Repository navigation
feat(webhooks): run organization triggers as their creator - #8423
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental commit replaces the creator-mode checkbox with a Assumptions: Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit 06d797a)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 06d797a)Status: No Issues Found | Recommendation: Merge Executive SummaryThe follow-up commits close the previously reported scheduled-trigger inbound exposure, enforce the 16-character shared secret for creator-run webhooks on create and rotation, make the internal key comparison constant-time, render prompt templates in a single pass, and restore orphan cleanup — no new issues found in the incremental diff. Files Reviewed (12 files)
Previous review (commit 0ec006b)Status: 3 Issues Found | Recommendation: Address before merge Executive SummaryScheduled creator-run triggers are publicly invocable through the unauthenticated inbound webhook route, bypassing the new shared-secret requirement and running under the creator's identity. Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Files Reviewed (23 files)
Reviewed by deepseek-flash-latest · Input: 97.2K · Output: 13K · Cached: 929K Review guidance: REVIEW.md from base branch |
Compare the internal API key in constant time and render prompt templates in a single pass so placeholders inside webhook request data are never expanded.
Scheduled triggers have no webhook auth, but the public inbound route still captured requests for them, so anyone with the trigger URL could run a creator-run (or personal) scheduled trigger as its principal. Inbound capture now rejects scheduled triggers; they run only from alarms or authenticated invokes. Also restrict Run now on creator-run triggers to the creator, require a 16-character minimum secret for creator-run webhooks, and restore orphan PostgreSQL cleanup when the worker no longer has an organization trigger.
Summary
Webhook security hardening (review follow-up)
/inboundstill captured requests for them. Anyone who knew the trigger URL could run a scheduled trigger with an attacker-controlled body as its principal: the creator for creator-run triggers, or the user for personal triggers.TriggerDO.captureRequestnow rejects scheduled triggers with 404 and does not write anything. Scheduled triggers now run only from the DO alarm or the internal-key-authenticated/invokeroute. The UI never showed an inbound URL for scheduled triggers.{{headers}}, are no longer expanded.Behavior And Trust Model
webhookTriggers.createwithrunAsCreatoris intentionally callable from MCP. It is equivalent to personal triggers, which MCP can already create and which mint the calling user's token on every run. The identity always comes from the authenticated caller, so a caller cannot target another user. Organization credit use is the same as for bot-run org triggers, which MCP can already create.Verification
tsgo --noEmitpassed. Lint passed on the changed web files. Formatting andgit diff --checkpassed.