Memos' webhook dispatch function safeDialContext() (internal/webhook/webhook.go) resolves the...
Summary
Memos' webhook dispatch function safeDialContext() (internal/webhook/webhook.go) resolves the...
Original description
The description as published by the source.
Memos' webhook dispatch function safeDialContext() (internal/webhook/webhook.go) resolves the target hostname via net.DefaultResolver.LookupHost() and validates the resulting IPs against reserved ranges, but then dials net.JoinHostPort(host, port) using the original hostname rather than the already-validated IP address. Because net.Dialer.DialContext() performs its own independent DNS resolution, an attacker controlling DNS for the webhook's hostname (e.g. via a short TTL) can return a public, allowed IP during validation and a different, internal IP at dial time — a classic time-of-check/time-of-use DNS-rebinding bypass of the SSRF protection.
Source: NIST National Vulnerability Database NVD GitHub Advisory
AI summary
Written by an external AI model and may contain mistakes. Check the original description and references below before acting on it.
Memosのwebhookディスパッチ関数safeDialContext()において、DNSリバインディング攻撃によりSSRF保護が回避される脆弱性が発見されました。攻撃者はDNSを制御することで、異なるIPアドレスを返すことができます。この脆弱性により、外部の不正なサーバーに接続される可能性があります。
Memosのwebhookディスパッチ関数safeDialContext()におけるDNSリバインディング攻撃。
Memosのinternal/webhook/webhook.go。
外部攻撃者が内部IPへの不正アクセスを可能にする可能性があるため、重大な脆弱性です。
安全なDNS解決戦略を実装し、バリデーション後に正しいIPを使用してダイヤルするロジックを適用すること。
一時的な回避策は情報なし。
webhookへのDNSリクエストと応答のロギングを有効にして異常を特定する。
References
- web github.com
- web github.com
- web nvd.nist.gov
- web github.com