CVE number – CVE-2021-28918
A vulnerability has been found in the netmask npm package that could expose private networks and lead to a variety of attacks, including malware delivery.
Improper input validation of octal strings in widely used netmask npm package v1.1.0 and below allows unautenticated remote attackers to perform indeterminate SSRF, RFI, and LFI attacks on many of the dependent packages. The netmask npm package incorrectly evaluates individual ipv4 octets that contain octal strings as left-stripped integers, leading to an inordinate attack surface on hundreds of thousands of projects that rely on netmask to filter or evaluate ipv4 block ranges, both inbound and outbound.
For example, a remote unauthenticated attacker can request local resources using input data 022.214.171.124 (127.0.0.1), which netmask evaluates as public IP 126.96.36.199. Contrastingly, a remote authenticated or unauthenticated attacker can input the data 0127.0.0.01 (188.8.131.52) as localhost, yet the input data is a public IP and potentially cause local and remote file inclusion (LFI/RFI). A remote authenticated or unauthenticated attacker can bypass packages that rely on netmask to filter IP address blocks to reach intranets, VPNs, containers, adjacent VPC instances, or LAN hosts using input data such as 012.0.0.1 (10.0.0.1), which netmask evaluates as 184.108.40.206 (public).
This issue has been fixed in version v2.0.0