
is-localhost-ip 2.0.0 - SSRF via Restrictions bypass
Discovered by
Offensive Team, Fluid Attacks
Summary
Full name
is-localhost-ip 2.0.0 - SSRF via Restrictions bypass
Code name
State
Public
Release date
22 de set. de 2025
Affected product
is-localhost-ip
Vendor
is-localhost-ip
Affected version(s)
2.0.0
Vulnerability name
Server-side request forgery (SSRF)
Vulnerability type
Remotely exploitable
Yes
CVSS v4.0 vector string
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
CVSS v4.0 base score
6.9
Exploit available
Yes
CVE ID(s)
Description
is-localhost-ip is a library designed to determine whether a given IP address resolves to localhost. However, the validation can be bypassed by using alternative representations such as IPv6-mapped IPv4 addresses (e.g.,::ffff:127.0.0.1), allowing restricted localhost access to be incorrectly permitted.
If an app uses this library for security verification, it could be vulnerable to attacks such as Server Side Request Forgery (SSRF).
Vulnerability
The library misclassifies IPv6 addresses and allows localhost checks to be bypassed. Two issues combine:
False negatives for valid IPv6 localhost representations (bypass): The code only pattern‑matches a limited set of textual forms and misses IPv4‑mapped localhost in hextet form, e.g, .::ffff:7f00:1 (which equals 127.0.0.1). Because canBind defaults to false, these variants do not match the regex and often fail the bind check, so they are treated as NOT localhost.
False positives for non‑loopback “private” ranges (trust expansion): The regex treats RFC1918 (10/8, 172.16/12, 192.168/16), link‑local 169.254/16, and IPv6 ULA/LL (fc00::/7, fe80::/10) as localhost. Those addresses are reachable from other hosts and must not be considered loopback. When canBind=false, they are accepted without verifying that the interface actually exists locally.
Relevant code paths:
Impact in practice:
HTTP example bypass against an allow‑list that blocks localhost using this library:
This is vulnerable because:
The function equates “private/ULA/LL addresses” with “localhost”, expanding the trust boundary beyond the loopback device and enabling SSRF to internal services.
It fails to normalize and positively identify all loopback representations (e.g.,::ffff:7f00:1), letting attackers smuggle loopback through IPv6 forms that the regex does not cover.
With canBind=false (default), addresses are accepted purely by regex, even if the host cannot bind to them, making both classes of mistakes exploitable via direct IPs or DNS records that resolve to them.
Safe behavior should restrict “localhost” to only loopback addresses: 127.0.0.0/8, ::1, and ::ffff:127.0.0.0/104 (IPv4‑mapped), and must normalize/parse instead of relying on fragile regexes.
PoC
Evidence of Exploitation
Our security policy
We have reserved the ID CVE-2025-9960 to refer to this issue from now on.
System Information
is-localhost-ip
Version 2.0.0
Operating System: Any
References
Github Repository: https://github.com/tinovyatkin/is-localhost-ip
Mitigation
There is currently no patch available for this vulnerability.
Credits
The vulnerability was discovered by Cristian Vargas from Fluid Attacks' Offensive Team.
Timeline
2 de set. de 2025
Vulnerability discovered
3 de set. de 2025
Vendor contacted
22 de set. de 2025
Public disclosure
Does your application use this vulnerable software?
During our free trial, our tools assess your application, identify vulnerabilities, and provide recommendations for their remediation.