Connections that use insecure protocols transmit data in cleartext. This introduces a risk of exposing sensitive data to third parties.
1var net = require('net')
2var socket = new net.Socket()
3function insecureConnectionNoncompliant()
4{
5 var port = 0
6 // Noncompliant: host value is not specified.
7 var host = ''
8 var server = socket.connect(port, host)
9}
1var net = require('net')
2var socket = new net.Socket()
3function insecureConnectionCompliant()
4{
5 var port = 0
6 // Compliant: host value is specified.
7 var host = '192.168.1.1'
8 var server = socket.connect(port, host)
9}