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

Self-modifying login form password field interferes with the Firefox remember password feature #115

Open
ravenexp opened this issue Sep 8, 2021 · 0 comments

Comments

@ravenexp
Copy link
Contributor

ravenexp commented Sep 8, 2021

In the current implementation the password field value is replaced just before submitting the form,
causing Firefox to remember the password hash string instead of the user input.
This leads to a login failure when the user attempts use the remembered password next time.

The problematic script part:

const button = form.querySelector('input[type="submit"]');
            form.addEventListener("submit", function (event) {
                event.preventDefault();
                button.disabled = true;
                button.value = "Loading...";
                password.value = removeByteOrderMark(Rust.pbkdf2_encode(password.value, email.value, 5000));
                this.submit();
            });

Perhaps a hidden form field can be used to pass the hash to the server.
The password field itself can be made unnamed or disabled to prevent the browser from sending raw passwords to the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant