Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To prevent server-side request forgery (SSRF) in a Node.js webhook sender or crawler, validate and constrain the destination the socket actually reaches—not just the submitted URL or an earlier DNS answer. Build one outbound-request policy that parses each URL, checks every resolved address, binds the connection to an approved address, and repeats those checks for redirects and retries. Add crawler rules or webhook delivery controls on top of that shared network boundary.

Why outbound requests are a trust boundary

A service that fetches a URL supplied by a user lets that user influence where the service connects. An attacker may try to use that ability to reach internal services, machine-local resources, or cloud metadata endpoints that are not reachable from the public internet. OWASP’s SSRF Prevention Cheat Sheet explicitly identifies user-specified webhook callback URLs as an SSRF use case.

Apply the same core destination policy to webhook deliveries, crawler page requests, robots.txt retrieval, and any linked resources the crawler fetches. Their application behavior differs, but each is an outbound request influenced by untrusted input.

Define what destinations the service allows

Prefer a host allowlist when the product permits it

If customers can register a finite set of webhook hosts, allowlist those hosts and the required ports instead of accepting arbitrary URLs. Where possible, accept a host identifier or a constrained endpoint configuration rather than a complete URL. OWASP recommends this narrower approach when it fits the use case.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Make an explicit policy for arbitrary public URLs

A crawler often needs to accept full URLs, and some webhook products may intentionally deliver to arbitrary public endpoints. In that case, document the policy before implementing it: permitted schemes, ports, address classes, redirect behavior, proxy behavior, and how DNS answers are handled. A reasonable strict default is HTTPS only, with an explicit exception process if the product genuinely needs other schemes or ports. That is a deployment choice, not a universal requirement established by the cited guidance.

Define denied address classes using the network environment the service actually runs in. At minimum, assess loopback, private, link-local, internal ranges, and metadata-service destinations. Network topology can make otherwise public-looking ranges sensitive, so an address policy should be reviewed against the deployment rather than copied blindly.

Parse and validate the URL before resolving it

Use one well-defined URL parser consistently from validation through request construction. Reject malformed or ambiguous input, unsupported schemes, unexpected ports, and URL credentials unless the product has a deliberately designed reason to support them. Do not use regular expressions or substring checks such as “hostname contains our domain” as the security decision.

Normalize and inspect the parsed hostname, not just the original string. Account for alternate IP representations, IPv6 forms, user information, and parser disagreement between components. OWASP describes a backslash and userinfo case where different parsing conventions can disagree about which host is being requested. If separate services or libraries interpret the same input differently, reject it rather than hoping they agree.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

After parsing, apply the scheme and hostname policy, then pass the validated structured destination—not a separately reconstructed or reinterpreted string—to the resolver and HTTP client. Keep this policy centralized so the webhook and crawler cannot quietly acquire different URL-validation rules.

Resolve DNS and bind the connection to an approved address

  1. Resolve both address families. Obtain A and AAAA answers for the hostname, or parse a literal IP address directly. Apply the same address policy to every result, including IPv4-mapped IPv6 and equivalent representations.
  2. Reject mixed unsafe answers. If any answer is outside the allowed destination set, reject the hostname rather than selecting a different answer from the same response. This avoids approving a hostname whose result set includes both permitted and forbidden destinations.
  3. Connect to an approved result. Bind the socket to an address that passed the check. Preserve the original hostname for the HTTP Host header, TLS Server Name Indication (SNI), and certificate verification. Do not disable certificate checks to make pinned connections work.
  4. Revalidate any alternate path. If the client retries with another address, falls back between address families, or otherwise opens a new connection, make that connection use an address that has passed the policy.

The critical failure to avoid is validating one DNS answer and then allowing the HTTP client to perform an independent lookup when it connects. That creates a gap in which the destination can change, including through DNS rebinding. OWASP’s SSRF guidance warns that domain allowlisting alone does not eliminate this risk.

Make redirects, retries, pools, and proxies part of the policy

Redirects are new destination decisions

A safe first URL does not make its Location target safe. Disable automatic redirect following or intercept each redirect and run the full parse, scheme, DNS, address, and connection checks again. Set a small, explicit redirect limit. Do not forward authorization headers, signing secrets, cookies, or other credentials to a different authority unless the application has a carefully scoped rule for doing so. OWASP specifically warns that redirects can bypass SSRF validation and recommends disabling automatic redirect following as a defense.

Retries must retain the original constraints

Bound retries and their schedule. A retry must not quietly resolve the hostname again without checking the new answers, switch to a disallowed fallback address, or follow a redirect that skips validation. Keep retry limits and request deadlines appropriate to the service’s workload; the cited sources do not establish universal numeric values.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Connection reuse needs a deliberate boundary

A pooled socket avoids a new DNS lookup, but it also means a later request may reuse a connection established under an earlier decision. Scope pools to the relevant origin and policy context; do not reuse an authenticated connection across authorities. Decide how long sockets remain eligible for reuse and how policy changes, revoked destinations, or stale connections are handled. Review the chosen client’s actual pooling behavior rather than assuming a pool preserves the intended security boundary automatically.

A proxy must enforce the destination policy too

If requests pass through a proxy, identify which component resolves the destination and opens the external socket. A local URL check does not constrain a proxy that independently resolves or connects to a different address. Require the proxy or egress layer to apply an equivalent destination policy, including to HTTPS CONNECT destinations, and ensure it cannot be bypassed by another client path.

Choose and configure a Node.js HTTP client deliberately

Node’s http.request() exposes custom lookup and createConnection hooks. Node’s built-in fetch() is based on Undici and accepts a custom dispatcher. These are integration points for implementing and reviewing a destination policy; they are not, by themselves, SSRF safeguards. Node’s API documentation does not claim that default configurations implement the policy described here.

Client path Documented integration point What your implementation still needs to establish
http.request() Custom lookup and createConnection hooks That the socket uses only an approved address while preserving the intended hostname for Host, SNI, and certificate verification; and that redirects, retries, pooling, timeouts, and proxies follow policy.
Built-in fetch() with Undici Custom dispatcher That the dispatcher enforces address binding and that redirects, retries, pooling, timeouts, and proxy behavior are explicit and reviewed.

The available Node documentation establishes these hooks, not a head-to-head security or performance ranking. Select one client path, implement the policy at its connection boundary, and document how each of the behaviors in the table is handled for the supported Node release lines.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Give the crawler robots.txt behavior without weakening SSRF checks

For each origin, retrieve /robots.txt at the top-level path, parse its UTF-8 rules, and follow parseable rules after a successful retrieval. RFC 9309 says that when robots.txt is unreachable due to server or network errors, the crawler must assume complete disallow. Treat that as a crawl-permission rule, not as permission to skip network safety checks.

RFC 9309 recommends following at least five consecutive redirects when retrieving robots.txt, including redirects across authorities. Validate every redirect destination through the same outbound policy. The RFC permits treating robots.txt as unavailable after more than five consecutive redirects. Apply your overall safety limits as well, and do not fetch pages disallowed by successfully retrieved, parseable rules.

The shared request policy also applies to page fetches, redirects, and any linked resources the crawler chooses to retrieve. Robots rules govern what the crawler may fetch; they do not make an otherwise forbidden network destination safe.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Protect webhook delivery and processing separately

Destination controls stop a webhook sender from being used to reach forbidden network locations; they do not prove that an incoming webhook is authentic or safe to process. OWASP’s Webhook Security Guidelines are draft guidance, so check their current status before treating them as final. The draft covers complementary controls:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
  • Verify the signature over the request bytes defined by the sender’s protocol.
  • Use timestamps and event IDs to detect stale or replayed deliveries.
  • Store signing secrets securely and redact them from logs.
  • Make event processing idempotent so duplicate deliveries do not repeat side effects.
  • Use TLS for webhook transport.

Queue outbound deliveries asynchronously, apply per-tenant rate limits, and keep queue retention and retry behavior bounded. These measures help contain slow or abusive destinations and make delivery failures manageable; they do not replace destination validation.

Set resource limits and test the connection boundary

Choose explicit request deadlines, response-body ceilings, concurrency limits, per-tenant rates, and bounded retry schedules based on expected traffic and service objectives. The cited sources provide no universal values for these settings. Apply limits while reading the response as well as before starting the request, so a slow or oversized response cannot consume unbounded resources.

Test the policy at the point that opens the socket, not only as a collection of URL-validation unit tests. Include cases such as:

  • Malformed or ambiguous URLs, credentials in URLs, unsupported schemes, and unexpected ports.
  • IPv4 and IPv6 literals, alternate IP representations, mixed public and disallowed DNS answers, and DNS changes between validation and connection.
  • Redirects to a disallowed address, a different authority, or an excessive redirect chain.
  • Retries or address-family fallback that would otherwise use an unchecked answer.
  • Connection-pool reuse, stale sockets, and proxy resolution or CONNECT behavior.
  • Robots.txt success, parseable rules, server or network errors, and cross-authority redirects.
  • Webhook signature failures, replayed timestamps or event IDs, duplicate processing, and secret redaction in logs.

Use a controlled test network and fake resolver or client hooks where possible; do not test by directing a production service at real internal or metadata endpoints. Confirm that rejected destinations never result in a connection attempt, and that logs and metrics provide enough information to diagnose a rejection without exposing secrets.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.