fix(plugins): accept same-origin GET on session-authenticated webhooks (#2984)

Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
João Salavisa
2026-08-24 20:31:32 +00:00
committed by GitHub
parent f4bc106db5
commit 9b0f6cf809
4 changed files with 231 additions and 25 deletions
@@ -156,7 +156,11 @@ rpc HandleWebhook(WebhookRequest) returns (WebhookResponse)
```
`access` is enforced by the host before `HandleWebhook` runs. For `authenticated`, the normal Kandev
identity must be present and browser cookie authentication additionally requires an accepted Origin;
identity must be present, and a session-cookie identity additionally requires a same-origin request.
Exactly two signals accept it: an accepted Origin, or (when the browser sends no Origin, as it does
not on same-origin GET/HEAD) a `Sec-Fetch-Site` of `same-origin` or `none`. Everything else is
rejected, including `cross-site`, `same-site`, and a request carrying neither header. PAT and
synthetic identities are not ambient and are not subject to that check;
authentication-disabled installations use the synthetic default user. Public webhooks retain their
current external-call behavior. Request cancellation propagates through the existing RPC context.