Vulnerabilities in pkg:npm/netmask
PACKAGECVE-2021-29418 is a MODERATE (CVSS 5.3) netmask npm package mishandles octal vulnerability (CWE-20: Improper Input Validation) affecting Netmask libraries in the npm ecosystem. The issue involves netmask npm package mishandles octal input data. Remediation is available by upgrading affected packages to version 2.0.1.
pkg:npm/netmask
Vulnerability advisories affecting package pkg:npm/netmask. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-pch5-whg9-qr2r | CVE-2021-29418 | MODERATE | netmask npm package mishandles octal input data |
| GHSA-4c7m-wxvm-r7gc | CVE-2021-28918 | CRITICAL | Improper parsing of octal bytes in netmask |
CVE-2021-29418 at a Glance
Security Impact
CVSS: 5.3
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:N/I:L/A:N).
How to Fix CVE-2021-29418
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@2.0.1
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-29418, 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 2.0.1), 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-29418 Affected Netmask Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
netmask
|
npm |
< 2.0.1
|
2.0.1
|
References
Frequently Asked Questions
What is CVE-2021-29418?
Which Netmask versions are affected?
What version fixes CVE-2021-29418?
Is netmask affected?
What is the CVSS score of CVE-2021-29418?
What CWE is associated with CVE-2021-29418?
How can I check npm dependencies for CVE-2021-29418?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pch5-whg9-qr2r",
"modified" : "2023-09-08T20:25:35Z",
"published" : "2021-03-29T21:32:05Z",
"aliases" : [ "CVE-2021-29418" ],
"summary" : "netmask npm package mishandles octal input data",
"details" : "The netmask package before 2.0.1 for Node.js mishandles certain unexpected characters in an IP address string, such as an octal digit of 9. This (in some situations) allows attackers to bypass access control that is based on IP addresses. NOTE: this issue exists because of an incomplete fix for CVE-2021-28918.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "netmask"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-29418"
}, {
"type" : "WEB",
"url" : "https://github.com/rs/node-netmask/commit/3f19a056c4eb808ea4a29f234274c67bc5a848f4"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20210604-0001"
}, {
"type" : "WEB",
"url" : "https://sick.codes/sick-2021-011"
}, {
"type" : "WEB",
"url" : "https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918"
}, {
"type" : "WEB",
"url" : "https://vuln.ryotak.me/advisories/6"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/package/netmask"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-03-29T21:31:24Z",
"nvd_published_at" : "2021-03-30T07:15:00Z"
}
}