π‘οΈ Sentinel: [HIGH] Fix SSRF/DNS rebinding mitigation bypass with IPv6 addresses in resolveCustomProviderUrl#455
Conversation
β¦6 addresses Node.js' `URL.hostname` setter fails silently when passed an unbracketed IPv6 address. This allowed SSRF/DNS rebinding protection bypass in `resolveCustomProviderUrl` because the IP pinning logic (`url.hostname = firstAddress.address`) would silently fail for IPv6 addresses, keeping the original unpinned hostname in place. This commit explicitly checks if the pinned IP address is IPv6 and wraps it in brackets `[ ]` before assigning it to `url.hostname`. Tests are also included to verify that this bracketed assignment does not silently fail. Co-authored-by: Oxygen-Low <95589118+Oxygen-Low@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review detailsβοΈ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: π Files selected for processing (3)
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. Comment |
π¨ Severity: HIGH
π‘ Vulnerability: Node.js'
URL.hostnamesetter fails silently when passed an unbracketed IPv6 address. This means the SSRF / DNS rebinding mitigation where we pinned the resolved IP address tourl.hostnameinresolveCustomProviderUrlwould silently fail and do nothing for IPv6 addresses, leaving the original hostname intact and allowing DNS rebinding to a private address.π― Impact: Potential Server-Side Request Forgery (SSRF) bypass, allowing access to internal networks.
π§ Fix: Checked if the resolved address is IPv6 using
net.isIPv6(). If it is, wrap it in brackets[ ]before assigning it tourl.hostname.β Verification: A unit test was added using vitest mock on
dns/promises.lookupto return a fake IPv6 address and ensure the final generated URL has the properly bracketed IP address. All tests were verified viapnpm test.PR created automatically by Jules for task 2719232807080006503 started by @Oxygen-Low