CVE-2018-7160: Node.js Inspector DNS rebinding vulnerability
Withdrawn Advisory This advisory has been withdrawn because this vulnerability affects inspector code in https://github.com/nodejs/node, not the legacy debugger at https://github.com/node-inspector/node-inspector. https://github.com/nodejs/node is not in a supported ecosystem.
Original Description The Node.js inspector, in 6.x and later is vulnerable to a DNS rebinding attack which could be exploited to perform remote code execution. An attack is possible from malicious websites open in a web browser on the same computer, or another computer with network access to the computer running the Node.js process. A malicious website could use a DNS rebinding attack to trick the web browser to bypass same-origin-policy checks and to allow HTTP connections to localhost or to hosts on the local network. If a Node.js process with the debug port active is running on localhost or on a host on the local network, the malicious website could connect to it as a debugger, and get full code execution access.
Other sources
A malicious website could use a DNS rebinding attack to trick a web browser to bypass same-origin-policy checks and allow HTTP connections to localhost or to hosts on the local network, potentially to an open inspector port as a debugger, therefore gaining full code execution access.
References:
https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOGV8.md
It was found that when a Node.js script is run in inspector mode, Node.js did not properly validate the Host header, leaving the inspector vulnerable to a DNS rebind attack and bypass same-origin policy. If a developer had an inspector session running, and was visiting a malicious website, the site could carry on a DNS rebind attack, allowing the site to have full access to the debugged script.
Node.js 6.x and later include a debugger protocol (also known as "inspector") that can be activated by the --inspect and related command line flags. This debugger service was vulnerable to a DNS rebinding attack which could be exploited to perform remote code execution.
The attack was possible from malicious websites open in a web browser on the same computer, or another computer with network access to the computer running the Node.js process. A malicious website could use a DNS rebinding attack to trick the web browser to bypass same-origin-policy checks and to allow HTTP connections to localhost or to hosts on the local network. If a Node.js process with the debug port active is running on localhost or on a host on the local network, the malicious website could connect to it as a debugger, and get full code execution access.
We updated the inspector implementation with an additional check for the browser provided Host header. If the connection is via a hostname, i.e. subject to DNS resolution, we ensure that the connection is to either localhost or localhost6 precisely.
Note that this mitigation may affect some remote debugging scenarios. For example it may no longer be possible to debug a remote computer by using a hostname. Either connect using the IP address or use an ssh-tunnel to work around this additional security check. This change is therefore a "breaking change", however, as per the Node.js release plan, we are including this as a security fix on all impacted release lines as a semver-minor rather than semver-major increment.
Node.js versions 4.x were not vulnerable as the inspector debug protocol is not available in that release line.
The severity of this vulnerability is HIGH due to remote code execution risk. However, the impact should be limited to environments (e.g. development) where debuggers are typically used.
This vulnerability was reported by Timo Schmid.
— Node.Js
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/rh-nodejs8-nodejsto a version that resolves this vulnerability.Fixed in 0:8.11.4-1.el7 - Upgrade
Upgrade
redhat/nodejsto a version that resolves this vulnerability.Fixed in 8.11.0 - Upgrade
Upgrade
redhat/nodejsto a version that resolves this vulnerability.Fixed in 6.14.0 - Upgrade
Upgrade
redhat/nodejsto a version that resolves this vulnerability.Fixed in 9.10.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.14.0Fixed in 8.11.0Fixed in 9.10.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 10.24.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 12.21.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 14.16.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 15.10.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.14.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 8.11.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 9.10.0 - Compensating control
Connect to the Node.js inspector using the IP address, or use an SSH tunnel instead of a hostname; note that this may affect some remote debugging scenarios.
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is the severity of CVE-2018-7160?
CVE-2018-7160 is categorized as a low severity vulnerability.
How do I fix CVE-2018-7160?
To fix CVE-2018-7160, ensure you are using a version of node-inspector that is below 6.0 or update to a version that addresses the vulnerability.
Which versions of Node.js are affected by CVE-2018-7160?
CVE-2018-7160 affects Node.js versions between 6.0.0 and 8.11.0.
Is CVE-2018-7160 still a current threat?
CVE-2018-7160 has been withdrawn, indicating it may no longer pose a threat as initially believed.
What component of Node.js does CVE-2018-7160 affect?
CVE-2018-7160 affects the inspector code in Node.js.