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

webui: crypt user password by default before passing it to backend #5321

Closed
wants to merge 1 commit into from

Conversation

rvykydal
Copy link
Contributor

@rvykydal rvykydal commented Nov 14, 2023

NOTE: using the same method as the current Gtk GUI

I didn't find anything usable for crypting the password in javascript but I might well miss something.

NOTE: using the same method as the current Gtk GUI
@@ -45,12 +45,18 @@ export function getAccountsState (
};
}

export const cryptUserPassword = async (password) => {
const pythonScript = `from random import SystemRandom as sr; import crypt; print(crypt.crypt("${password}", "$y$j9T$" + "".join(sr().choice("./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") for _sc in range(24))))`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The crypt module will be removed in Python 3.13, which is planned/proposed for Fedora 41: https://discussion.fedoraproject.org/t/f41-change-proposal-python-3-13-system-wide/92897
So this code might stop working quite soon. Unfortunately, I do not come with another solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to address it out of scope of this PR together with the GUI implementation:

def crypt_password(password):

Copy link
Contributor

@M4rtinK M4rtinK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - good point from @jstodola & agreed that as we will have to solve this (password crypt in Python) for GUI we can also fix this later when we are at it.

@rvykydal
Copy link
Contributor Author

The PR has been migrated to the new repository: rhinstaller/anaconda-webui#48

@rvykydal rvykydal closed this Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants