Skip to content

[SECURITY] fix: add SSRF protection to webhook URL validation (critical)#2920

Open
namann5 wants to merge 1 commit into
ritesh-1918:gssocfrom
namann5:fix/ssrf-webhook-url-validation-critical
Open

[SECURITY] fix: add SSRF protection to webhook URL validation (critical)#2920
namann5 wants to merge 1 commit into
ritesh-1918:gssocfrom
namann5:fix/ssrf-webhook-url-validation-critical

Conversation

@namann5

@namann5 namann5 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🔒 Security Fix: SSRF Protection for Webhook URLs

Fixes #2915

Vulnerability

send_webhook_notification() made HTTP POST requests to user-supplied URLs without any validation, enabling SSRF attacks against internal network services (cloud metadata, Docker internals, private IPs).

Fix

Added _validate_webhook_url() that:

  • ✅ Only allows http/https schemes
  • ✅ Blocks localhost, 127.0.0.1, ::1, 0.0.0.0
  • ✅ Blocks .local and .internal hostnames
  • ✅ Resolves hostname via DNS and blocks private (RFC1918), loopback, and link-local IPs
  • ✅ Returns 403-equivalent rejection with error log

Verification

  • ✅ Zero merge conflicts with upstream/gssoc
  • ✅ Minimal diff — only backend/services/webhook_service.py

Severity: Critical — CVSS 8.6 (SSRF)
Level: critical | advanced

send_webhook_notification() made HTTP requests to arbitrary URLs
without any validation, allowing SSRF attacks to internal networks.

Added _validate_webhook_url() that:
- Ensures only http/https schemes are allowed
- Blocks localhost, 127.0.0.1, ::1, 0.0.0.0
- Blocks .local and .internal hostnames
- Resolves hostname and blocks private (RFC1918), loopback,
  and link-local IP ranges
- Returns 403-level rejection logged at error level

This prevents attackers from using the webhook endpoint to scan
internal network services or access cloud metadata endpoints.
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

@namann5 is attempting to deploy a commit to the ritesh Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 22acbe6a-88da-4a92-9c67-cb42afdab261

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bb1218cf9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend/services/webhook_service.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant