CVE-2018-7408: Incorrect Permission Assignment for Critical Resource in NPM
Summary
CVE-2018-7408: Incorrect Permission Assignment for Critical Resource in NPM. Affects npm versions < 5.7.1. Fixed in 5.7.1. How to fix ↓
Also tracked for
- npm · npm
The same CVE-2018-7408 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
NPM is a package manager for the JavaScript programming language. It allows developers to easily install, manage, and share reusable code packages. The vulnerability in NPM version 4.2.0 allows local users to bypass filesystem access restrictions by changing ownerships of critical directories unexpectedly. This issue was discovered in a pre-release version of NPM 5.7.0 and was automatically installed by the 'npm upgrade -g npm' command. It was announced in the vendor's blog without mentioning its pre-release status.
Vulnerability Detail
The vulnerability arises from a 'correctMkdir' issue in NPM. It can be exploited by local users to gain unauthorized access to critical resources on the system. By changing ownerships of the /etc and /usr directories, the intended filesystem access restrictions can be bypassed. This can lead to unauthorized modifications, data leakage, or even complete system compromise. The vulnerability has a CVSS score of 7.8, indicating a high severity level.
How To Fix
Minimum fixed version
5.7.1
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no specific workaround mentioned for this vulnerability. The recommended solution is to upgrade NPM to the fixed version.
Conclusion
The vulnerability in NPM version 4.2.0 allows local users to bypass filesystem access restrictions, potentially leading to unauthorized modifications or system compromise. It is recommended to upgrade NPM to version 5.7.1 or later to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for npm →
FAQ
NPM is a package manager for JavaScript that allows developers to easily install, manage, and share reusable code packages.
This vulnerability allows local users to bypass filesystem access restrictions and gain unauthorized access to critical resources on the system.
The CVSS score of this vulnerability is 7.8, indicating a high severity level.
To fix this vulnerability, you need to upgrade NPM to version 5.7.1 or later.
No specific workaround is mentioned for this vulnerability. The recommended solution is to upgrade NPM to the fixed version.
Related vulnerabilities
Recent vulnerabilities recorded for npm.