gogs / gogs/gogs

Store password hashes prefixed with the used scheme/algorithm

Open
#3,662 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🔒 security 🔨 enhancement
Dominant language
Go
Stars
47.8k
Forks
5.1k
Avg merge
7h 23m
Merged PRs (30d)
5

Description

There are several open issues and pull requests around password hashing. However we decide what (currently) a decent default setting is, being able to change hashing functions by configuration is a good thing.

Dovecot allows to store the password algorithm as prefix of the hashed password (additionally it can be suffixed with the salt), which is nice way to be able to deal with different hashing functions in use at the same time. That is mandatory if we want to auto-upgrade hashes the next time a users logs in with the clear-text password like mentioned by @LefsFlarey.

To ensure compatibility with existing installs the configured default algorithm is used when there the stored password is not prefixed at all.

After some feedback, I'd love to start working on a pull-request for this feature. So please let me know what you think and which hashes should be supported. Maybe there's even a library that already does that?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked issue #1734, pull request #3642, and Dovecot password-scheme reference to understand the existing hashing configuration and compatibility requirements. Done means hashes identify their scheme or algorithm while unprefixed existing hashes continue using the configured default, with the supported schemes agreed and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authentication, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.