Repository navigation
Allow webhook delivery to operator-approved private networks (e.g. WEBHOOK_ALLOWED_CIDRS) #261
dominik-myszkowski
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Webhook targets are resolved through netutil.ResolveSafe / SafeTransport, which rejects any private, loopback, link-local, CGNAT or ULA address. That's the right default against SSRF.
For self-hosted deployments, though, the most natural webhook receiver is a sibling container on the same Docker network (e.g. http://sms-sender:8080/webhook, resolving to 172.x). Today that's impossible. The workarounds are routing the webhook out through the public reverse proxy and back in (hairpin, extra public endpoint) or polling the REST API.
The codebase already accepts this trade-off elsewhere: ResolveNotMetadata / MetadataSafeTransport deliberately allow private ranges for CalDAV, LLM and LiveKit, because "a self-hostable product can't treat 'private network' as inherently suspicious".
Proposal:
New env var WEBHOOK_ALLOWED_CIDRS (comma-separated, empty by default, so behaviour is unchanged). Operator-level, not an in-app setting, so a workspace admin can't widen it.
When set, webhook targets inside those CIDRs pass. Everything else still goes through ResolveSafe. The cloud-metadata range (169.254.0.0/16, fe80::/10) stays blocked unconditionally, even if listed.
The check applies both when saving the webhook URL and at dial time (same DNS-rebinding protection as today).
Documented in DEPLOY.md next to TRUSTED_PROXY_CIDRS, with the same "only list networks you control" warning.
We can send a PR with tests if you agree with the shape.
All reactions