CVE-2021-28918: Netmask Improper Parsing Of Octal Bytes Vulnerability
CRITICALCVE-2021-28918 is a CRITICAL (CVSS 9.1) improper parsing of octal bytes vulnerability (CWE-20: Improper Input Validation) affecting Netmask libraries in the npm ecosystem. The issue involves improper parsing of octal bytes in netmask. Remediation is available by upgrading affected packages to version 1.1.0.
CVE-2021-28918 at a Glance
Security Impact
CVSS: 9.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N).
How to Fix CVE-2021-28918
To remediate this vulnerability, upgrade all affected Netmask dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install netmask@1.1.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls netmask
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-28918, inspect your project dependencies using npm:
npm ls netmask
Analyze the terminal output to locate any version of Netmask in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.0), your application is affected.
Note: The npm ls netmask command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Netmask, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-28918 Affected Netmask Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
netmask
|
npm |
< 1.1.0
|
1.1.0
|
References
Frequently Asked Questions
What is CVE-2021-28918?
Which Netmask versions are affected?
What version fixes CVE-2021-28918?
Is netmask affected?
What is the CVSS score of CVE-2021-28918?
What CWE is associated with CVE-2021-28918?
How can I check npm dependencies for CVE-2021-28918?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4c7m-wxvm-r7gc",
"modified" : "2022-04-01T20:21:55Z",
"published" : "2021-04-14T15:03:16Z",
"aliases" : [ "CVE-2021-28918" ],
"summary" : "Improper parsing of octal bytes in netmask",
"details" : "Improper input validation of octal strings in netmask npm package v1.0.6 and below allows unauthenticated remote attackers to perform indeterminate SSRF, RFI, and LFI attacks on many of the dependent packages. A remote unauthenticated attacker can bypass packages relying on netmask to filter IPs and reach critical VPN or LAN hosts.\n\n:exclamation: NOTE: The fix for this issue was incomplete. A subsequent fix was made in version `2.0.1` which was assigned [CVE-2021-29418 / GHSA-pch5-whg9-qr2r](https://github.com/advisories/GHSA-pch5-whg9-qr2r). For complete protection from this vulnerability an upgrade to version 2.0.1 or later is recommended.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "netmask"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-28918"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-pch5-whg9-qr2r"
}, {
"type" : "WEB",
"url" : "https://github.com/rs/node-netmask"
}, {
"type" : "WEB",
"url" : "https://github.com/rs/node-netmask/blob/98294cb20695f2c6c36219a4fbcd4744fb8d0682/CHANGELOG.md#v110-mar-18-2021"
}, {
"type" : "WEB",
"url" : "https://github.com/sickcodes/security/blob/master/advisories/SICK-2021-011.md"
}, {
"type" : "WEB",
"url" : "https://rootdaemon.com/2021/03/29/vulnerability-in-netmask-npm-package-affects-280000-projects"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20210528-0010"
}, {
"type" : "WEB",
"url" : "https://www.bleepingcomputer.com/news/security/critical-netmask-networking-bug-impacts-thousands-of-applications"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/package/netmask"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2021-04-13T16:13:23Z",
"nvd_published_at" : "2021-04-01T13:15:00Z"
}
}