All vulnerabilities

npm

CVE-2026-101912

ip-address: isInSubnet() and isHostInSubnet() compare addresses of different families as if they shared an address space, allowing an allowlist check to admit an address outside its range

Severity
Medium
Published
29 Sept 2026
Last changed
30 Sept 2026
Added to UpHeron
22 Oct 2026
Fixed in
10.7.1
Exploit chance
0.4% in the next 30 daysHigher than 31% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Incorrect comparison (CWE-697)CWE-843
Also known as
GHSA-j6r3-76f7-8jcv
Sources
OSV.dev and GitHub

Description

isInSubnet() and isHostInSubnet() accept an address of either family and compare masked binary strings without checking that both operands are the same family. Address4 pads to 32 bits and Address6 to 128, so whenever the leading bits agree the strings are equal: new Address6('a00::1').isInSubnet(new Address4('10.0.0.0/8')) is true, and new Address4('32.0.0.1').isInSubnet(new Address6('2000::/3')) is true. No IPv4 address is inside an IPv6 network, so both answers are untrue.

An application that parses untrusted input as whichever family accepts it and then tests the result against a fixed-family allowlist can admit an address outside the list.

Both methods are in src/common.ts:

mask(n) returns the first n bits of the address as a string of 0 and 1, taken from a representation padded to the family's width. new Address6('a00::1').mask(8) is '00001010', and so is new Address4('10.0.0.0/8').mask(), so string equality reports containment.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
ip-addressnpm · osv:npm:ip-address
  • Every version before 10.7.1

About ip-address

Weekly downloads (npm)
138,360,349npm, 17 Nov 2026

References