CVE-2021-28918 — netmask
CRITICALCVE-2021-28918 is a critical-severity (CVSS 9.1) CWE-704 vulnerability in netmask. 2 public exploit references exist, so weaponization risk is real. A fix is available for netmask — see the affected versions and patch details below.
Improper parsing of octal bytes in netmask
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2021-28918 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,738 CVEs with a current EPSS score, this one falls in the 10–50% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
netmasknpmDescription
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.
: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. For complete protection from this vulnerability an upgrade to version 2.0.1 or later is recommended.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | netmask | all versions | 1.1.0npm install netmask@1.1.0 |
Affected Products
netmasknetmask_projectResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for netmask, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update netmask to 1.1.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-28918 is resolved across your whole dependency graph.
Workarounds
Restrict outbound requests from the affected component to an allowlist of hosts, block access to link-local and internal address ranges at the network layer, and require authentication on internal services so a forged request cannot reach them unauthenticated.
How to detect CVE-2021-28918
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id cve-2021-28918 -u https://target- Template
- Netmask NPM Package - Server-Side Request Forgery
- Severity
- critical
- Impact
- An attacker can exploit this vulnerability to make requests to internal resources, potentially leading to unauthorized access or information disclosure.
- Remediation
- Upgrade to Netmask version 2.0.0 or later, which includes a fix for this vulnerability.
Template by ProjectDiscovery nuclei-templates (johnjhacking), MIT licensed. View the full template. Scan only systems you are authorised to test.
Frequently Asked Questions
Is CVE-2021-28918 in your dependencies?
Find it across npm, including transitive dependencies.