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

Hashed userpass authentication? #1572

Open
surma opened this issue Nov 7, 2021 · 2 comments
Open

Hashed userpass authentication? #1572

surma opened this issue Nov 7, 2021 · 2 comments

Comments

@surma
Copy link
Contributor

surma commented Nov 7, 2021

I’d like to not store my userpass/basicauth password in plaintext, so I am wondering if there’s any interest in a hasheduserpass authenticator?

I’d envision it would look something like this:

{
  "//": "...",
  "auth": "hasheduserpass:<username>:<sha224’d password>-<hex salt>[:vivify=<sha224’d vivify password>-<hex salt>][:+localhost]"
}

The password would still be transferred from the browser in plaintext and would be hashed on the server-side. In combination with HTTPS, this should be fine and avoid storing the password in plaintext.

I’d love to implement this, but wanted to check first that there’s interest and I’m not missing something.

@zenhack
Copy link
Contributor

zenhack commented Nov 7, 2021

We should probably use an algorithm designed for password hashing (probably Argon2?) instead of sha224.

...But that gets a bit weird, since currently the basic auth gets used for every request, whereas normally with a password scheme you'd use it once to get a session token and thereafter use that. Early on in my career I made the mistake of using a good password hash directly in an API and woke up to CI taking 45 minutes to run. So it seems like there's kindof two bad ways to do this:

  • Use a not-great password hash, giving users a somewhat-false sense of security (it's not nothing, but not "best practices")
  • Use a best-practice password hash, introducing a performance footgun for users. We'd at a minimum want to clearly document the pitfall.

An auth option that allowed for some sort of token exchange e.g. with a cookie would be more ideal, but also obviously much more work to implement.

What do others think? (Since you're specifically fishing for maintainers' thoughts, I should point out that I am some rando whose involvement is somewhat limited these days).

@brainwave
Copy link

@zenhack How about implementing an API first in Perkeep then? Would there be any interest for this feature?

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

3 participants