Vulnerability in ‘netmask’ npm package [CVE-2021-28918]

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 0177.0.0.1 (, which netmask evaluates as public IP Contrastingly, a remote authenticated or unauthenticated attacker can input the data 0127.0.0.01 ( 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 (, which netmask evaluates as (public).

This issue has been fixed in version v2.0.0

Further details –

Jason Davies

UK based technology professional, with an interest in computer security and telecoms.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: