The listener is opened on INADDR_ANY, so it will accept any network
connection, no matter if it is originating locally or from the outside of the host. There is no check in place to discard non-local connections. The only security against a malicious attack would be provided by a local firewall, which is not guaranteed to be installed on every workstation kicad is used on. I tested this, and a host running eeschema accepts connections on TCP port 4243 from other hosts on the internet. A patch to remedy this potentially serious security hole is attached. It creates the listener on localhost instead. A flag is provided to allow the creation of sockets on 0.0.0.0 instead, if required. localhost is the default.
This commit is contained in:
parent
3a07ab1f09
commit
96771ccc03
|
@ -35,12 +35,15 @@ void SetupServerFunction( void (*remotefct)(const char* remotecmd) )
|
|||
|
||||
/* Function to initialize a server socket
|
||||
*/
|
||||
WinEDA_Server* CreateServer( wxWindow* window, int service )
|
||||
WinEDA_Server* CreateServer( wxWindow* window, int service, bool local )
|
||||
{
|
||||
wxIPV4address addr;
|
||||
|
||||
// Create a new server
|
||||
addr.Service( service );
|
||||
// Listen on localhost only if requested
|
||||
if( local )
|
||||
addr.Hostname( HOSTNAME );
|
||||
|
||||
server = new wxServer( addr );
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
/* autres fonctions */
|
||||
/********************/
|
||||
|
||||
WinEDA_Server * CreateServer( wxWindow * window, int port );
|
||||
WinEDA_Server * CreateServer( wxWindow * window, int port, bool local = true );
|
||||
bool SendCommand( int port, const char* cmdline );
|
||||
void SetupServerFunction( void (*remotefct) (const char* remotecmd) );
|
||||
|
||||
|
|
Loading…
Reference in New Issue