Skip to content

fix(security): prevent TOCTOU DNS rebinding SSRF in webhooks#3173

Open
nyxsky404 wants to merge 3 commits into
Priyanshu-byte-coder:mainfrom
nyxsky404:fix/dns-rebinding-ssrf
Open

fix(security): prevent TOCTOU DNS rebinding SSRF in webhooks#3173
nyxsky404 wants to merge 3 commits into
Priyanshu-byte-coder:mainfrom
nyxsky404:fix/dns-rebinding-ssrf

Conversation

@nyxsky404

Copy link
Copy Markdown
Contributor

This PR fixes a critical TOCTOU (Time-of-Check to Time-of-Use) vulnerability in the webhook dispatch system. Previously, isSafeUrl performed a DNS resolution to verify the IP, but fetch subsequently performed a second DNS resolution. This allowed attackers to use DNS rebinding (with a low TTL) to bypass SSRF protections and hit internal networks (e.g. 169.254.169.254 or localhost). The fix updates isSafeUrl to return the explicitly validated IP address, which is then passed directly to fetch while pinning the Host header to the original URL's hostname. Fixes #3169.

@github-actions github-actions Bot added type:bug GSSoC type bonus: bug fix type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts) gssoc26 GSSoC 2026 contribution type:security GSSoC type bonus: security (+20 pts) labels Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@github-actions github-actions Bot added the type:testing GSSoC type bonus: tests (+10 pts) label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts) type:security GSSoC type bonus: security (+20 pts) type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] TOCTOU DNS Rebinding Vulnerability in Webhook Dispatch

1 participant