fix(webhooks): block SSRF to localhost, link-local, and private IP addresses
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 58/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
調査の方向性
Start with apps/api/src/webhooks/dto/create-webhook.dto.ts and apps/api/src/webhooks/webhooks.service.ts, focusing on createWebhook, testWebhook, and dispatch. Check how the project handles DNS lookup and IP range validation, then verify URL checks cover creation and immediately before requests. Done when unsafe protocols and resolved addresses are rejected and redirects cannot reach unvalidated destinations.
索引モデルが issue の本文から書いたものです。
説明
Problem Description
In apps/api/src/webhooks/dto/create-webhook.dto.ts, CreateWebhookDto validates url using @IsUrl({ require_tld: false }) without restricting URL protocols or blocking internal/private network addresses.
This allows users to register webhook URLs pointing to localhost, 127.0.0.1, 169.254.169.254 (cloud metadata), or private IP ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, ::1, fc00::/7).
In apps/api/src/webhooks/webhooks.service.ts, both testWebhook and dispatch call fetch(endpoint.url) directly with no IP/protocol/DNS blocklist and follow redirects by default, enabling Server-Side Request Forgery (SSRF).
Expected Behavior
- Webhook URLs must only allow
http:andhttps:protocols. - Loopback, link-local (
169.254.0.0/16), private RFC1918/IPv6, multicast, and unspecified (0.0.0.0) addresses must be blocked both on creation and after DNS resolution right beforefetch(...). - Redirects on outbound webhook
fetchrequests should be disabled (redirect: 'error') or re-validated against the same blocklist.
Where to Look
apps/api/src/webhooks/dto/create-webhook.dto.tsapps/api/src/webhooks/webhooks.service.ts(createWebhook,testWebhook,dispatch)
Solution / Implementation Guide
- In
CreateWebhookDto, update@IsUrl(...)to enforceprotocols: ['http', 'https']andrequire_protocol: true. - Add an
assertSafeWebhookUrl(rawUrl: string)helper inwebhooks.service.ts(or a shared utility) that:- Parses the URL with
new URL(rawUrl)and checksprotocol === 'http:' || protocol === 'https:'. - Resolves the hostname via
dns.lookupand rejects private, loopback, link-local, multicast, and reserved IPv4/IPv6 ranges.
- Parses the URL with
- Call
assertSafeWebhookUrlincreateWebhook,testWebhook, anddispatchbeforefetch(...), and setredirect: 'error'infetchoptions.
- 主要言語
- TypeScript
- スター
- 2
- フォーク
- 1
- 平均マージ
- 6分
- マージ済み PR(30日)
- 27
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sumamakhan761/tryinstance のほかの issue
-
backend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sumamakhan761/tryinstance#65 ·
メンテナーはふだん 1 日以内に返信
-
backend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
sumamakhan761/tryinstance#64 ·
メンテナーはふだん 1 日以内に返信
-
backend good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
sumamakhan761/tryinstance#63 ·
メンテナーはふだん 1 日以内に返信
-
backend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sumamakhan761/tryinstance#62 ·
メンテナーはふだん 1 日以内に返信
-
backend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sumamakhan761/tryinstance#60 ·
メンテナーはふだん 1 日以内に返信
sumamakhan761/tryinstance の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
makecindy/cindy#15342 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
kwitsch/claude-code-plugin-tooling#219 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
no-repo-link tool-submission
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
BraveOPotato/NoSignups#2618 ·
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100