CVE-2018-12120: Debugger port 5858 listens on any interface by default
Categorization: Unprotected Primary Channel (CWE-419)
All versions of Node.js 6 are vulnerable and the severity is HIGH. When the debugger is enabled with node --debug or node debug, it listens to port 5858 on all interfaces by default. This may allow remote computers to attach to the debug port and evaluate arbitrary JavaScript. The default interface is now localhost. It has always been possible to start the debugger on a specific interface, such as node --debug=localhost. The debugger was removed in Node.js 8 and replaced with the inspector, so no versions from 8 and later are vulnerable.
Reported and fixed by Ben Noordhuis.
All versions of Node.js 6 (LTS "Boron") are vulnerable
All versions of Node.js 8 (LTS "Carbon") are NOT vulnerable
All versions of Node.js 10 (LTS "Dubnium") are NOT vulnerable
All versions of Node.js 11 (Current) are NOT vulnerable
Other sources
Debugger port 5858 listens on any interface by default: When the debugger is enabled with node --debug or node debug, it listens to port 5858 on all interfaces by default. This may allow remote computers to attach to the debug port and evaluate arbitrary JavaScript. The default interface is now localhost. It has always been possible to start the debugger on a specific interface, such as node --debug=localhost. The debugger was removed in Node.js 8 and replaced with the inspector, so no versions from 8 and later are vulnerable.
— Node.Js
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.15.0Fixed in 8.14.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.15.0 - Upgrade
Upgrade
Node.jsto a version that resolves this vulnerability.Fixed in 6.15.0 - Configuration
Start the debugger with `node --debug=localhost` so port 5858 listens only on localhost rather than all interfaces.
Node.js debugger debugger listen interface = localhost
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is the severity of CVE-2018-12120?
CVE-2018-12120 is considered a medium severity vulnerability due to the risk of unauthorized remote access to the debugger.
How do I fix CVE-2018-12120?
To fix CVE-2018-12120, upgrade Node.js to version 6.15.0 or later to ensure the debugger only listens on localhost by default.
Who is affected by CVE-2018-12120?
CVE-2018-12120 affects all versions of Node.js prior to 6.15.0 that have the debugger enabled.
What can happen if CVE-2018-12120 is exploited?
Exploiting CVE-2018-12120 can allow attackers to connect to the debugger and execute arbitrary commands on the Node.js application.
Is there a workaround for CVE-2018-12120?
A temporary workaround for CVE-2018-12120 is to avoid enabling the debugger on production systems or bind the debugger to specific interfaces.