-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Warn about/prevent multiple direct remote connections #20834
Conversation
by finding the current session and redirecting to it from the login page.
494265c
to
eeb7792
Compare
eeb7792
to
2d267b8
Compare
// from two machines into the same browser origin. | ||
|
||
const logged_into = environment["logged-into"]; | ||
const cur_machine = logged_into.length > 0 ? logged_into[0] : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
function redirect_to_current_machine() { | ||
if (cur_machine === ".") | ||
login_reload("/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 3 added lines are not executed by any test.
if (cur_machine === ".") | ||
login_reload("/"); | ||
else | ||
login_reload("/=" + cur_machine); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
if (cur_machine) { | ||
if (!environment.page.allow_multi_host) | ||
redirect_to_current_machine(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 3 added lines are not executed by any test.
id("multihost-message").textContent = format(_("You are already connected to '$0' in this browser session. Connecting to other hosts will allow them to execute arbitrary code on each other. Please be careful."), | ||
cur_machine == "." ? "localhost" : cur_machine); | ||
id("multihost-get-me-there").addEventListener("click", redirect_to_current_machine); | ||
show('#multihost-warning'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 4 added lines are not executed by any test.
@@ -948,6 +977,8 @@ | |||
} | |||
|
|||
function login_reload (wanted) { | |||
console.log("RELOAD", wanted); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
Demo: https://youtu.be/lvR2youiY4M