Soenneker.Validators.IpAddresses.Ssrf 4.0.2

Prefix Reserved
dotnet add package Soenneker.Validators.IpAddresses.Ssrf --version 4.0.2
                    
NuGet\Install-Package Soenneker.Validators.IpAddresses.Ssrf -Version 4.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Validators.IpAddresses.Ssrf" Version="4.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Validators.IpAddresses.Ssrf" Version="4.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Validators.IpAddresses.Ssrf" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Validators.IpAddresses.Ssrf --version 4.0.2
                    
#r "nuget: Soenneker.Validators.IpAddresses.Ssrf, 4.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Validators.IpAddresses.Ssrf@4.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Validators.IpAddresses.Ssrf&version=4.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Validators.IpAddresses.Ssrf&version=4.0.2
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Validators.IpAddresses.Ssrf

IP address validation for SSRF protection

Determines whether an IPv4 or IPv6 address is publicly routable. Private, loopback, link-local, carrier-grade NAT, documentation, benchmarking, multicast, reserved, IPv4-mapped IPv6, and other special-use destinations are handled conservatively.

Installation

dotnet add package Soenneker.Validators.IpAddresses.Ssrf

Usage

services.AddSsrfIpAddressValidatorAsSingleton();

ISsrfIpAddressValidator validator =
    serviceProvider.GetRequiredService<ISsrfIpAddressValidator>();

bool isPublic = validator.Validate("8.8.8.8");       // true
bool isPrivate = validator.Validate("192.168.1.10"); // false
bool isLoopback = validator.Validate(IPAddress.Loopback); // false

Validate(string) accepts unambiguous IP address literals only and performs no managed allocations. It does not resolve hostnames. Legacy abbreviated, octal, and hexadecimal IPv4 forms are rejected. For SSRF-safe HTTP requests, resolve every hostname and validate every returned address at connection time. Revalidate redirects as well, so DNS rebinding cannot bypass an earlier check.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Validators.IpAddresses.Ssrf:

Package Downloads
Soenneker.Utils.HttpClientCache.Ssrf

SSRF-safe, DNS-rebinding-resistant HttpClient caching.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.2 0 7/28/2026
4.0.1 31 7/27/2026