fix: report webhook redirects as failures instead of silent success#1740
Open
namann5 wants to merge 1 commit into
Open
fix: report webhook redirects as failures instead of silent success#1740namann5 wants to merge 1 commit into
namann5 wants to merge 1 commit into
Conversation
send_webhook() with follow_redirects=False was validating redirect target IPs against the SSRF blocklist but then returning (True, None) without actually delivering the payload. Security notifications would silently fail to arrive at redirected webhook endpoints. Now properly returns (False, ...) for all redirect outcomes: - Redirect to blocked IP (unchanged) - Redirect to allowed IP (new: reports non-delivery) - Empty Location header (new: reports non-delivery) - Relative redirect with no hostname (new: reports non-delivery) - Unresolvable redirect target (unchanged) Fixes utksh1#1739
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Description
Fixes #1739
\send_webhook()\ in
otification_service.py\ was validating webhook redirect targets against the SSRF blocklist but never actually following them or reporting failure. With \ollow_redirects=False, the payload was never delivered to the final URL � yet the function returned (True, None), silently reporting success.
This means any webhook endpoint that returns a 3xx redirect causes security notifications to be silently dropped with no indication to the user.
Change
The redirect handler now returns (False, error_message)\ for all redirect outcomes instead of falling through to
eturn True, None:
Testing
Added 3 new tests:
All 35 existing notification tests continue to pass.