-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 4.1.0
-
Fix Version/s: 4.1.4
-
Component/s: OS Integration
Issue
It is currently listening on 0.0.0.0, which is bad as it opens the computer to external attacks.
The current implementation is:
self.host = "localhost" self.port = 10650 # ... self.listen(QHostAddress(self.host), self.port)
And it turns out that QHostAddress does not do any DNS lookup:
>>> from PyQt5.QtNetwork import QHostAddress >>> QHostAddress("localhost").toString() '' >>> QHostAddress("localhost").toIPv4Address() 0
>>> a = QHostAddress() >>> a.setAddress("localhost") False >>> a.setAddress("127.0.0.1") True
So Qt listens on any interfaces by default, 0.0.0.0.
Fix
Resolve the address first:
>>> from PyQt5.QtNetwork import QHostInfo >>> info = QHostInfo().fromName("localhost") >>> for a in info.addresses(): ... print(a.toString()) ... 127.0.0.1 ::1
And use the IPv4 by default.
- is caused by
-
NXDRIVE-1467 Implement FS decorator on Windows
- Resolved
- is related to
-
NXDRIVE-2408 [macOS] Cannot start the extensions server
- Open