4 Commits
Author SHA1 Message Date
Lauri Ojansivu 2cc0b59a51 On Sandstorm, send webhooks through the Powerbox, and accept the REST API with a grain API key.
A grain has no network but the bridge proxy, so an outgoing webhook now
leaves only through an API a board admin approved in the Powerbox for that
webhook's address: each saved webhook offers "Allow this grain to reach this
address". The grant belongs to the destination, not to a person, is found
by the URL being sent to, and is approved as the address's parent path so
the bridge delivers to the exact address. Every sender - immediate, grouped
and stored - goes through webhookFetch, which off Sandstorm, or for an
address no grant covers, is exactly the SSRF-guarded fetchSafe.

The REST API called with a Sandstorm API key acts as the key's user: in a
grain the bridge sets X-Sandstorm-User-Id itself. Only in a grain, only
after a WeKan token, only for an existing enabled account, and a key without
participate reads only.

New strings translated in all languages.

Thanks to xet7 !
2026-10-14 09:49:42 +03:00
Lauri Ojansivu 78957e14cb Send outgoing webhooks through an HTTP proxy, with the SSRF checks kept.
HTTP_PROXY, HTTPS_PROXY and NO_PROXY now work for every outgoing request
that goes through the SSRF guard: webhooks, imports, avatar downloads,
list sync. The destination is still resolved once and checked against
the blocked ranges first, and the proxy is handed that checked address,
never the name: an http:// request goes to the proxy in absolute form on
the pinned address with the real Host, an https:// one through a CONNECT
tunnel to the pinned address with TLS still verified against the real
name (and WEBHOOK_TLS_CA_CERT). A name resolving to an internal address
is refused before the proxy is asked anything. Proxy credentials in the
URL become Proxy-Authorization. The snap gets http-proxy, https-proxy and
no-proxy.

tests/outboundProxy.test.cjs runs a real proxy on loopback: the pinned
address, the Host header, the credentials, the CONNECT authority, and
that a refused destination never reaches the proxy.

Thanks to gbarre and xet7 !

Fixes #1455.
2026-10-14 08:20:30 +03:00
Lauri Ojansivu 4ad72c9701 Enforce total webhook deadlines with active request and response cancellation 2026-09-28 13:11:17 +03:00
Lauri Ojansivu e08b22983c Persist guarded webhook HTTP responses before processing reply effects 2026-09-28 05:32:01 +03:00