Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron local server is exposed on all interfaces #5114

Closed
ManuGowda opened this issue Jun 26, 2023 · 0 comments
Closed

Electron local server is exposed on all interfaces #5114

ManuGowda opened this issue Jun 26, 2023 · 0 comments

Comments

@ManuGowda
Copy link
Contributor

Expected behavior

Modify the call to the listen function to include the host parameter such as app.listen(port, "127.0.0.1") . This will ensure that only attackers on the same network cannot access the local server

Actual behavior

The lisk desktop application launches a local web server on port 5659 that is exposed on all interfaces.

Steps to reproduce

const server = {
init: (port) => {
if (process.env.LISK_DESKTOP_URL) {
return process.env.LISK_DESKTOP_URL;
}
const app = express();
app.set('views', path.join(__dirname, '.'));
app.use(express.static(path.join(__dirname, '.')));
app.get('*', (req, res) => res.sendFile(path.join(__dirname, '../setup/react/index.html')));
// catch 404 and forward to error handler
app.use((req, res, next) => {
const err = new Error('Not Found');
err.status = 404;
next(err);
});
app.listen(port);
return `http://localhost:${port}/`;
},
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants