REDHAT-BUG-2510803: SSRF
ip-address is a library for parsing and manipulating IPv4 and IPv6 addresses in JavaScript. From 10.1.1 until 10.2.2, every special-use classification method is built on isInSubnet, which short-circuits to false whenever the address's own subnet mask is shorter than the reference range's mask. That mask comes verbatim from the CIDR suffix on the parsed input, so appending a suffix such as /0 suppresses classification entirely: isLoopback(), isPrivate(), isLinkLocal(), isCGNAT(), isMulticast(), isUnspecified(), isBroadcast(), isULA(), and getType() all report an internal address as unremarkable, while correctForm() and address still return the real internal target. An application that builds a network trust-boundary decision on these checks, for example a filter intended to block Server-Side Request Forgery, or SSRF, may therefore treat an internal target as external and allow the request. The underlying bit comparison is correct, and mask(n) already returns the first n bits of the full parsed address independently of subnetMask; the defect is solely that the containment guard sits in the classification path. This issue is fixed in version 10.2.2.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ip-addressto a version that resolves this vulnerability.Fixed in 10.2.2
Event History
Frequently Asked Questions
Which applications are realistically exposed?
Applications are exposed if they use ip-address special-use classification methods to make network trust-boundary decisions, such as blocking SSRF requests to internal targets. Applications that do not rely on these checks for access-control decisions are not described as affected by this issue.
What does an attacker need to exploit this behavior?
An attacker needs to be able to supply or influence an IP address input that is parsed with a CIDR suffix. Appending a suffix such as /0 can cause special-use checks to report an internal address as unremarkable while the address value still identifies the real internal target.
Are normal internal addresses affected without a CIDR suffix?
The described bypass depends on the subnet mask taken from the CIDR suffix on the parsed input. The issue occurs when that mask is shorter than the reference range mask used by the classification check.
What can be done if updating is not immediately possible?
Do not use the affected special-use classification methods as the sole trust-boundary control for user-influenced addresses with CIDR notation. Reject or separately handle CIDR-suffixed inputs before applying SSRF or internal-network access restrictions.
How can I check whether an application is vulnerable to the bypass?
Review whether it passes attacker-influenced CIDR-form addresses to isLoopback(), isPrivate(), isLinkLocal(), isCGNAT(), isMulticast(), isUnspecified(), isBroadcast(), isULA(), or getType() and relies on their result for access control. Test whether an internal address with a suffix such as /0 is classified as unremarkable even though correctForm() and address retain the internal target.