Repository navigation
security: don't follow redirects on webhook delivery - #8263
Merged
Merged
Conversation
Reject HTTP redirects whose target hostname resolves to a blocked local network address. Adds a CheckRedirect hook to httplib so the webhook delivery client can reuse the existing IsBlockedLocalHostname check on every hop, not just the initial URL.
unknwon
force-pushed
the
ghsa-c4v7-xg93-qf8g
branch
from
May 18, 2026 17:46
cfdeb50 to
7c76d04
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to harden webhook delivery by applying local-network SSRF validation to HTTP redirect targets and exposing redirect policy configuration in httplib.
Changes:
- Adds
CheckRedirectsupport tointernal/httplib. - Applies redirect-target local-network blocking during webhook delivery.
- Documents the webhook redirect SSRF fix in the changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
internal/httplib/httplib.go |
Adds Settings.CheckRedirect, a setter, and passes it into http.Client. |
internal/database/webhook.go |
Installs a webhook redirect policy that blocks redirects resolving to local network addresses. |
CHANGELOG.md |
Adds the security advisory entry for webhook redirect SSRF. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Setting CheckRedirect replaces net/http's default policy, so the default 10-hop limit no longer applies. Reapply it in the callback to keep a malicious endpoint from looping webhook delivery indefinitely.
The webhook target is explicitly configured by the user, so following any redirect silently retargets the signed payload — which is the root of the SSRF vector regardless of whether the redirect target is local or public. Refuse all redirects instead of resolving and re-checking them.
unknwon
added a commit
that referenced
this pull request
Jun 7, 2026
(cherry picked from commit 199cf4f)
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Request.SetCheckRedirectoninternal/httplibso callers can install anhttp.Client.CheckRedirectpolicy.Refs GHSA-c4v7-xg93-qf8g.
Test plan
301/302(e.g. tohttp://169.254.169.254/); trigger delivery and confirm it fails with a "refusing to follow webhook redirect" error and the redirect target is never fetched.