[Security] Use random salts for new password hashes, with backward-compatible migration
I maintainer di solito rispondono entro 1 giorno
@Taha254511 ci sta già lavorando.
Dal 18/10/2026.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- authentication, backend, security
Direzione di ricerca
Start with the referenced hashing and verification functions in src/worker.py, then read MIGRATION.md for existing Django-hash support and the authentication flows. Find the tests covering registration, login, password reset and change, and run them before changing anything. Done means new hashes use random salts and a self-describing format, while successful legacy authentication upgrades hashes without breaking supported flows.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
src/worker.py currently derives each application's PBKDF2 salt deterministically as SHA-256(_PEPPER || username), where _PEPPER is a constant committed to the repository.
The resulting application-specific password hash is stored as a Base64-encoded digest without recording the algorithm or its parameters.
Because _PEPPER is public, it cannot provide the protection expected from a confidential secret pepper.
This issue proposes improving password-storage practices while preserving compatibility with existing accounts. It does not claim evidence of a security breach.
Current limitations
- The salt is deterministic rather than randomly generated for each password hash.
_PEPPERis committed to the repository and therefore cannot be treated as a confidential secret.- The current application-specific hash format does not record its algorithm or parameters.
- The current application's legacy hash verification uses ordinary
==comparison rather than constant-time comparison.
Proposed solution
- Generate a cryptographically random salt for each newly created password hash.
- Store new hashes in a self-describing format containing the algorithm, iteration count, salt, and derived hash. The existing
pbkdf2_sha256$iterations$salt$hashformat handled by_verify_django_password()can be reused. - Preserve a dedicated verification path for the existing application-specific Base64-only hashes. Retain
_PEPPERonly as long as it is needed to verify those hashes. New hashes must not depend on this committed value. - Use
_hmac.compare_digest()when comparing derived hashes, including the existing application-specific legacy hashes. Preserve the constant-time comparison already used by_verify_django_password(). - Upgrade existing application-specific hashes after successful authentication so users do not need to reset their passwords solely because of the format change.
- Continue supporting existing Django-format password hashes. Rehash those only when required by the agreed password-hashing policy.
Out of scope
- Introducing a new secret pepper loaded from a Wrangler secret. This requires passing the appropriate runtime configuration to the hashing functions and can be considered separately.
- Changing the PBKDF2 iteration count. Worker CPU limits should be evaluated before changing the work factor.
- Changing token handling or login response formats.
- Logging passwords, derived hashes, or other sensitive authentication data.
Acceptance criteria
- New password hashes use cryptographically random salts.
- Stored hashes include the algorithm and parameters necessary for verification.
- Correct passwords are accepted and incorrect passwords are rejected.
- Existing application-specific hashes and supported legacy Django hashes remain verifiable.
- Existing application-specific hashes are upgraded after successful authentication.
- New hashes do not depend on any confidential value committed to source control.
- Legacy hash verification uses constant-time comparison where appropriate.
- Automated tests cover hash generation, unique salts, successful and failed verification, legacy compatibility, and migration.
- Registration, login, password-reset, and password-change flows continue to work.
Manual verification
- Register a new user and confirm that the stored hash uses the new format with a randomly generated salt.
- Sign in with an account using the existing application-specific hash format and confirm that the hash is upgraded.
- Verify that supported legacy Django-format hashes continue to work.
- Confirm that an incorrect password is rejected.
- Reset a password and confirm that the new password works while the old password no longer works.
Backward compatibility
Changing the salt derivation directly would invalidate existing application-specific password hashes.
The implementation must retain a separate verification path for the existing format and migrate hashes only after successful authentication.
The legacy constant must not be removed while accounts still depend on it unless an appropriate migration or account-recovery strategy has been agreed upon.
References
src/worker.py—_user_salt(),hash_password(),verify_password(), and_verify_django_password().MIGRATION.md— Legacy Django password-hash support and authentication flows requiring testing.- OWASP Password Storage Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html
- Lingua principale
- HTML
- Stelle
- 3
- Fork
- 28
- Merge medio
- 17h 41m
- PR unite (30g)
- 7
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di alphaonelabs/learn
-
Active Navigation State Is Not Highlighted in the NavbarForse già presa @Taha254511 l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
alphaonelabs/learn#91 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Add a "Resend verification email" option on the login pageForse già presa @gopikrishna-20 l’ha presa 1 giorno fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
alphaonelabs/learn#131 ·
I maintainer di solito rispondono entro 1 giorno
-
Add Google Sign-In AuthenticationForse già presa @gopikrishna-20 l’ha presa 2 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
alphaonelabs/learn#126 ·
I maintainer di solito rispondono entro 1 giorno
-
feat(classroom): add keyboard shortcuts and clean up interaction controlsForse già presa @rishavvrajj l’ha presa 3 giorni fa. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 42/100
alphaonelabs/learn#124 ·
I maintainer di solito rispondono entro 1 giorno
-
feat(classroom): add seated arrow-key desk navigation and improve seating user experienceForse già presa @rishavvrajj l’ha presa 3 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
alphaonelabs/learn#121 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di alphaonelabs/learn
Issue simili
-
[Low] CSI plugin builds staging directories from storage_volume_id without a containment checkApertaarea/security kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
agent-substrate/substrate#2935 ·
I maintainer di solito rispondono entro 1 giorno
-
API-key credentials accept a blank key: empty via the API, spaces-only via the builder's Add API key dialogForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
Significant-Gravitas/AutoGPT#15727 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
blinklabs-io/dingo#5367 ·
I maintainer di solito rispondono entro 1 giorno
-
cve-candidate cve-response
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sattyamjjain/agent-airlock#348 ·
I maintainer di solito rispondono entro 1 giorno
-
blocklist removal
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
MetaMask/eth-phishing-detect#303918 ·
I maintainer di solito rispondono entro 1 giorno