node-wifi icon indicating copy to clipboard operation
node-wifi copied to clipboard

What's the reason for not auto-connecting to open networks?

Open paumoreno opened this issue 6 years ago • 4 comments

I'm wondering why, at least on Windows (i haven't tested the behaviour on other OSs), when a connection is established to an open newtork, the connectionMode is set to manual. This prevents the machine from connecting to the chosen network again after a restart.

Is it a security reason? Does it happen on Linux and Mac?

paumoreno avatar Nov 30 '17 10:11 paumoreno

In fact this library is made to manage wifi connections without human interaction. And it is better to do it in manual mode. It could be a improvement to do.

friedrith avatar Dec 02 '17 16:12 friedrith

It could be something useful to add into the options in the connect function like this:

wifi.connect({
    ssid: 'ssid',
    password: 'password',
    auto: true|false,
})

However, I think that could be useful to find how to manage this auto connection behavior for all OS before integrating it in node-wifi.

If you are interested in this feature, do not hesitate to propose a PR. But remember to implement the feature of all os.

friedrith avatar Dec 20 '17 20:12 friedrith

It would be a huge confidentiality and availability problem.

Availability wise, it's quite possible you'll hit a network with a captive portal and not be able to access the web. How can you tell if you've connected to a useful network?

From a security perspective it's a nightmare. You can fingerprint the device, MITM your device, and more. Mitigating this is way outside the scope of this library.

If you want to do this you totally can, but beware of the above.

stonegray avatar Apr 12 '18 21:04 stonegray

Totally right! But since it is available with user interface, I don't think it is really a problem. Moreover this option should be set to false by default. Whatever, I am waiting to have this feature on all OS before releasing it.

friedrith avatar May 13 '18 05:05 friedrith