Free tools Windows power users keep installed

One-click scans. No signup required.

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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Spring Boot 4.1 introduced InetAddressFilter for restricting the IP addresses that outgoing HTTP clients may contact. Configure it on a client through HttpClientSettings, or expose a filter bean for auto-configured client builders. This is an address-level control—not a complete defense for every user-supplied URL, redirect, or HTTP client path.

Which Spring Boot versions support InetAddressFilter?

Spring Boot 4.1.0 introduced the feature; Spring announced that release on June 10, 2026. The configuration guidance is in the Spring Boot 4.1 reference, and the API documentation cited here is for Spring Boot 4.1.1. Do not assume the API is available in earlier Spring Boot versions. Spring’s release highlights say both reactive and blocking HTTP clients can be configured with an InetAddressFilter to block outgoing requests to selected addresses.

Spring Boot 4.1.0 release announcement · Spring Boot 4.1 reference: Calling REST Services · Spring Boot 4.1.1 InetAddressFilter API · Spring Boot 4.1 release highlights

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

Apply a filter to one RestClient

For a client with a specific destination policy, attach the filter to HttpClientSettings, build a JDK request factory with those settings, and give that factory to RestClient. Spring’s reference demonstrates this pattern with the built-in external-address policy:

#1 Best Overall
FortiGate-40F Firewall Appliance - 5 Gigabit Ethernet RJ45 Ports, Ideal for Small Businesses (Appliance Only, No Subscription) (FG-40F)
  • Compact and Efficient Design: The FortiGate 40F is designed for small to mid-sized businesses and enterprise branch offices, featuring a compact, fanless desktop form factor that ensures quiet operation and minimizes space usage.
  • Robust Connectivity Options: Equipped with 5 GE RJ45 ports, including 1 WAN port and 4 internal ports, this model provides essential connectivity and flexibility for various network configurations in a small-scale environment.
  • High-Performance Security: Offers up to 1 Gbps IPS throughput and 600 Mbps threat protection throughput, using Fortinet’s purpose-built security processor technology to deliver industry-leading performance and protection for SSL encrypted traffic.
  • Advanced Threat Protection: Integrated with Fortinet’s AI-powered FortiGuard Labs, the FortiGate 40F offers comprehensive cybersecurity, identifying and mitigating both known and unknown threats to maintain robust security across your network.
  • Simplified Management and Deployment: Features a user-friendly management console that provides comprehensive network automation and visibility, coupled with Zero Touch Integration with Fortinet’s Security Fabric for easy deployment.
InetAddressFilter onlyExternalAddresses = InetAddressFilter.externalAddresses();
HttpClientSettings settings = HttpClientSettings.defaults()
    .withInetAddressFilter(onlyExternalAddresses);
ClientHttpRequestFactory requestFactory = ClientHttpRequestFactoryBuilder.jdk()
    .build(settings);
RestClient restClient = RestClient.builder()
    .requestFactory(requestFactory)
    .baseUrl("https://example.org")
    .build();

Use this per-client approach when clients in the same application need different destination rules. The filter is set on the request factory used by this RestClient; it does not, by itself, configure clients constructed elsewhere.

Spring Boot 4.1 reference: client configuration examples

Rank #2
FortiGate-60F Network Security Appliance Plus 1 Year FortiGuard Unified Threat Protection (UTP) and FortiCare Premium (FG-60F-BDL-950-12)
  • HARDWARE PLUS SECURITY SERVICES: FortiGate-60F Firewall Appliance bundled with 1 year of FortiCare Premium and FortiGuard Unified Threat Protection.
  • UNIFIED THREAT PROTECTION (UTP): Secures against advanced online threats with comprehensive web filtering and anti-botnet technologies.
  • OPTIMIZED FOR MEDIUM-SIZED BUSINESSES: Tailored for businesses needing robust security without the infrastructure of larger enterprises.
  • RELIABLE CUSTOMER SUPPORT: FortiCare Premium ensures high-quality support and service continuity.
  • EFFECTIVE PROTECTION: Employs advanced filtering technologies to safeguard against sophisticated threats.

Configure a filter for auto-configured client builders

To provide a shared policy to auto-configured HTTP client builders, define an InetAddressFilter bean. This example permits the specified private IPv4 CIDR range except for two addresses:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
@Bean
InetAddressFilter httpClientInetAddressFilter() {
    return InetAddressFilter.of("192.168.1.0/24")
        .andNot("192.168.1.1", "192.168.1.10");
}

of matches the CIDR range, while andNot removes the listed addresses from that match. A bean is for auto-configured client builders; verify coverage in your application if code also creates clients manually or sends requests through other client libraries or paths.

Rank #3
GL.iNet GL-MT5000 Brume 3 Wired VPN Security Gateway NO Wi-Fi
  • 【Up to 1100 Mbps VPN Speed 】 Hardware-accelerated WireGuard and OpenVPN-DCO deliver up to 1100 Mbps VPN throughput, over 3× faster than Brume 2 for smooth remote access and file transfers.
  • 【Three 2.5G Ports & Multi-WAN】Tri-port 2.5GbE design with flexible WAN LAN configuration supports multi-gigabit wired setups, dual-ISP Multi-WAN and failover to keep home and SOHO networks online.
  • 【Stealth VPN Obfuscation】VPN obfuscation disguises VPN traffic as regular HTTPS, helping you evade blocking, bypass restrictive networks and maintain stable, private connections.
  • 【DPI protection】Deep Packet Inspection with visual dashboards blocks adult/gambling/malicious sites, while SQM and QoS prioritize gaming, calls, and video when bandwidth is tight
  • 【OpenWrt & USB 3.0 Expansion】OpenWrt with 1GB DDR4 and 8GB eMMC lets you install plugins and build VPN, ad-blocking or NAS, while USB 3.0 Type‑C connects high-speed storage or 4G/5G dongles

Spring Boot 4.1 reference: InetAddressFilter bean example

Choose a policy that matches your destinations

The API supports IPv4 and IPv6 addresses and CIDR blocks. Its factories and composition methods let you express broad address classes or combine more specific rules.

Rank #4
Ubiquiti Cloud Gateway Ultra (UCG-Ultra)
  • Runs UniFi Network for full-stack network management
  • Manages 30+ UniFi Network devices and 300+ clients
  • 1 Gbps routing with IDS/IPS
  • Multi-WAN load balancing
  • 0.96" LCM status display
Policy or method What it does
externalAddresses() Matches addresses considered external by Spring’s filter.
internalAddresses() Matches addresses considered internal by Spring’s filter.
routable() Matches addresses considered routable by Spring’s filter.
multicast() Matches multicast addresses.
specialPurpose() Matches special-purpose addresses.
of(...) Creates a filter from IPv4 or IPv6 addresses and CIDR blocks.
and, or, andNot, negate Combine or invert address-matching rules.

These methods evaluate addresses, not whether a URL is trustworthy as a whole. For example, allowing a private CIDR may be necessary when an application calls an internal service, but it also permits requests to matching addresses. Keep any exception as narrow as the actual service requirement.

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

InetAddressFilter API: factories and composition

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

Harden the complete outbound request path

SSRF defenses should account for how a URL becomes a network connection. A hostname can resolve to an address during validation and a different address when the client connects. The USENIX Security 2024 paper describes this DNS rebinding problem and discusses IP pinning: resolve once and continue using the validated address. The paper also advises rejecting redirects or validating every redirect destination. These are general security principles; Spring’s cited reference does not establish identical DNS or redirect behavior for every underlying client and request flow.

  • Allow only URL schemes your application needs, such as HTTPS, rather than accepting arbitrary schemes.
  • Apply address filtering to every outbound client and code path that can handle attacker-influenced URLs.
  • Decide whether redirects are needed. Reject them where practical, or validate each redirect target under the same policy.
  • Confirm how the specific request factory and client resolve DNS and handle redirects; do not assume validation and connection use the same address without checking.
  • Review internal-address exceptions against actual service needs, and keep permitted ranges and exclusions specific.

USENIX Security 2024: Server-Side Request Forgery: Theory and Practice

Do not confuse Spring Boot Admin settings with Spring Boot client defaults

Spring Boot Admin documents a separate SSRF protection feature. Its documentation says that protection is disabled by default in that product and describes allowing selected internal CIDRs when internal communication is required. Those are Spring Boot Admin-specific settings, not defaults for all Spring Boot HTTP clients or a substitute for configuring their outbound request paths.

Spring Boot Admin 4.1.2: SSRF Protection

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.

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