Uh oh!
There was an error while loading. Please reload this page.
fix(security): prefer IPv4 when pinning DB and 1Password connections - #5799
Conversation
Same class of bug fixed for MCP in #5798: SSRF pinning forces a single resolved IP, which strips Happy Eyeballs' IPv4 fallback. dns.lookup(verbatim) returns the IPv6 address first for dual-stack hosts, so a database host or 1Password Connect server that is dual-stack gets pinned to IPv6 — unreachable on IPv4-only egress (AWS NAT gateways) and hangs until timeout. validateDatabaseHost and validateConnectServerUrl now resolve all addresses and prefer IPv4; IPv6-only hosts still pin their sole address. SSRF validation of the pinned IP is unchanged (the selected address is the one validated and pinned).
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview
OnePassword tests were updated for the array-shaped lookup mock and add coverage for dual-stack (IPv4 chosen) and IPv6-only pinning. Reviewed by Cursor Bugbot for commit c0c41c0. Configure here. |
Greptile SummaryThis PR prefers IPv4 when pinning database and 1Password Connect connections. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(security): prefer IPv4 when pinning ..." | Re-trigger Greptile |
Uh oh!
There was an error while loading. Please reload this page.
Summary
dns.lookup(verbatim)returns the IPv6 address first for dual-stack hosts, so a dual-stack database host or 1Password Connect server gets pinned to IPv6 — unreachable on IPv4-only egress (AWS NAT gateways) and hangs until timeout.validateDatabaseHostandvalidateConnectServerUrlnow resolve all addresses ({ all: true, verbatim: true }) and prefer IPv4; IPv6-only hosts still pin their sole address.Safety
isPrivateOrReservedIP/assertConnectIpAllowed) and pinned — never a "validate A, connect B" split. Equal-or-stricter than before (a private IPv4 is now caught where it was previously masked by an IPv6 pick).Type of Change
Testing
lib/core/security+ all DB tool utils (postgresql/clickhouse/mysql) + onepassword suites green (617); tsc + biome clean.validateDatabaseHostuses the identical expression, covered by the domain-check test in fix(mcp): pin outbound connections to IPv4 to avoid unreachable-IPv6 hangs #5798.Checklist