HedgeDoc - Ideas grow better together
Find a file
Erik Michelson f30f0d8e51 fix(passwords): use argon2id instead of bcrypt
OWASP [1] recommends for password hashing the following algorithms in
descending order: argon2id, scrypt, bcrypt. They state that bcrypt may
be used in legacy systems or when required due to legal regulations.
We're however not building any legacy application. Even HedgeDoc 1.x
utilizes a more modern algorithm by using scrypt.

While bcrypt is not insecure per se, our implementation had a major
security flaw, leading to invalid passwords being accepted in certain
cases. The bcrypt nodejs package - and the OWASP cheatsheet as well -
point out, that the maximum input length of passwords is limited to 72
bytes with bcrypt. When some user has a password longer than 72 bytes in
use, only the first 72 bytes are required to log in successfully.
Depending on the encoding (which could be UTF-8 or UTF-16 depending on
different circumstances) this could in worst-case be at 36 characters,
which is not very unusual for a password. See also [2].

This commit changes the used algorithm to argon2id. Argon2id has been in
use for several years now and seems to be a well-designed password
hashing function that even won the 2015 Password Hashing Competition.
Argon2 does not have any real-world max input length for passwords (it
is at 4 GiB).

The node-rs/argon2 implementation seems to be well maintained, widely
used (more than 150k downloads per week) and is published with
provenance, proving that the npm package was built on GitHub actions
using the source code in the repository. The implementation is written
in Rust, so it should be safe against memory leakages etc.

[1]: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Che
     at_Sheet.html#password-hashing-algorithms
[2]: https://security.stackexchange.com/a/39851

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2024-08-08 20:29:23 +02:00
.github ci: remove netlify deployment workflow 2024-07-30 08:48:38 +02:00
.idea/copyright chore(reuse): remove unneeded license file 2023-10-24 11:26:16 +02:00
.reuse docs: restructure documentation 2023-09-17 21:50:21 +02:00
.yarn fix: version of resolution of dicebear/converter 2024-02-11 23:54:55 +01:00
backend fix(passwords): use argon2id instead of bcrypt 2024-08-08 20:29:23 +02:00
commons fix(deps): update dependency reveal.js to v5 2024-04-09 11:40:15 +02:00
dev-reverse-proxy fix(caddy): use hostname instead of ip 2023-09-03 22:00:34 +02:00
docker fix(docker): remove docker image hashes from example docker-compose.yml 2023-03-28 09:13:29 +02:00
docs ci: remove netlify deployment workflow 2024-07-30 08:48:38 +02:00
frontend fix(frontend): do not hardcode example.org, do not prebuild motd 2024-08-07 21:28:17 +02:00
html-to-react chore(deps): update linters 2024-03-01 17:51:22 +01:00
LICENSES feat(frontend): replace forkawesome with bootstrap icons 2023-02-24 14:31:17 +01:00
markdown-it-plugins chore(deps): update linters 2024-03-01 17:51:22 +01:00
.dockerignore
.env.example refactor: move .env file to repo root 2023-03-26 15:53:49 +02:00
.env.example.license refactor: move .env file to repo root 2023-03-26 15:53:49 +02:00
.gitattributes
.gitignore add download directory 2024-01-24 12:14:40 +01:00
.mailmap chore: update authors file 2023-10-08 21:57:01 +02:00
.mailmap.license
.nvmrc chore(deps): update dependency node to v20.11.0 2024-02-10 16:16:10 +01:00
.nvmrc.license
.yarnrc.yml chore(deps): update yarn to v4.1.0 2024-02-10 18:00:34 +01:00
AUTHORS chore: update authors file 2023-10-08 21:57:01 +02:00
CODE_OF_CONDUCT.md
codecov.yml
CONTRIBUTING.md fix CODE_OF_CONDUCT.md file url , inside CONTRIBUTING.md 2023-10-19 19:30:49 +02:00
developer-certificate-of-origin.txt refactor: move dco into root 2023-09-17 21:50:21 +02:00
developer-certificate-of-origin.txt.license refactor: move dco into root 2023-09-17 21:50:21 +02:00
LICENSE fix: add new slogan 2023-07-11 21:17:19 +02:00
package.json chore(deps): update dependency @types/node to v20.11.18 2024-02-15 15:34:38 +00:00
package.json.license
README.md Change to direct link 2024-01-12 09:41:07 +01:00
renovate.json ci: remove netlify deployment workflow 2024-07-30 08:48:38 +02:00
renovate.json.license
SECURITY.md
turbo.json fix(turbo): deduplicate test task config and add coverage directory 2023-09-09 09:40:06 +02:00
turbo.json.license
yarn.lock fix(passwords): use argon2id instead of bcrypt 2024-08-08 20:29:23 +02:00
yarn.lock.license

HedgeDoc Logo

#HedgeDoc on matrix.org version POEditor Mastodon Twitter REUSE Compliance Check Nest.JS CI codecov

HedgeDoc lets you create real-time collaborative markdown notes.

Getting Started

State of the project

HedgeDoc 1.x is stable and used around the world, but the codebase has grown over time, making it hard to add new features.
We are currently working on HedgeDoc 2, a complete rewrite of HedgeDoc. Please note the following:

  • This branch contains the latest development code and does not implement all features yet. If you are looking for the 1.x source code, have a look at the master branch.
  • The 1.x release is maintenance-only. We do not accept feature requests or PRs for this release anymore and may choose to close non-critical bug reports, if the bug will be non-existent in 2.0.
  • HedgeDoc 2 will be split in two components. The backend and the frontend. Both are present in this repository.

Development

Information for setting up a local development environment can be found in the developer documentation

HedgeDoc 2 Alpha

Curious about the new look and feel of HedgeDoc 2? We provide a demo of the alpha on hedgedoc.dev.

If you want to try it out on your own devices, visit the HedgeDoc 2 docs. But be aware that these may change over time.

Contributions

We welcome contributions!
Have a look at our contribution docs to find out how you can help. If you want to contribute to HedgeDoc 2, please join our development chat.

License

Licensed under AGPLv3. For our list of contributors, see AUTHORS.

The license does not include the HedgeDoc logo, whose terms of usage can be found in the github repository.