9e2f9e21e9
This patch adds an own filename function for `formidable`, which will make sure to generate a random file name, using UUIDv4. This should resolve GHSA-q6vv-2q26-j7rx. This change is required due to a change in behaviour from version 1 to version 2 of formidable. Formidable version 2 will generate predictable filenames by default, which results in potential access to images, that were uploaded while formidable v2 was used in Hedgedoc. This affects the versions `1.9.1` and `1.9.2`. Files generated previous to this commit will look like this: ``` <random string generated on app start><counter>.<file-extension> 38e56506ec2dcab52e9282c00.jpg 38e56506ec2dcab52e9282c01.jpg 38e56506ec2dcab52e9282c02.jpg ``` After this patch it'll look like this: ``` <uuid v4>.<file-extension> a67f36b8-9afb-43c2-9ef2-a567a77d8628.jpg 56b3d5d0-c586-4679-9ae6-d2044843c2cd.jpg 2af727ac-a2d4-4aad-acb5-73596c2a7eb6.jpg ``` This patch was implemented using `uuid` since we already utilise this package elsewhere in the project as well as using a secure function to generate random strings. UUIDv4 is ideal for that. In order to be consumable by formidable, it was wrapped in a function that makes sure to keep the file extension. This vulnerability was reported by Matias from [NCSC-FI](https://www.kyberturvallisuuskeskus.fi/). References: https://github.com/node-formidable/formidable/blob/v2-latest/src/Formidable.js#L574 https://github.com/node-formidable/formidable/issues/808#issuecomment-1007090762 https://www.npmjs.com/package/uuid |
||
---|---|---|
.github | ||
bin | ||
docs | ||
lib | ||
locales | ||
public | ||
test | ||
.babelrc | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.gitignore | ||
.mailmap | ||
.remarkrc | ||
app.js | ||
app.json | ||
AUTHORS | ||
CHANGELOG.md | ||
CODE-OF-CONDUCT.md | ||
config.json.example | ||
CONTRIBUTING.md | ||
LICENSE | ||
package.json | ||
README.md | ||
renovate.json | ||
SECURITY.md | ||
webpack.common.js | ||
webpack.dev.js | ||
webpack.htmlexport.js | ||
webpack.prod.js | ||
yarn.lock |
HedgeDoc
HedgeDoc lets you create real-time collaborative markdown notes. You can test-drive it by visiting our HedgeDoc demo server.
It is inspired by Hackpad, Etherpad and similar collaborative editors. This project originated with the team at HackMD and now forked into its own organisation. A longer writeup can be read in the history.
Community and Contributions
We welcome contributions! There's a lot to do: If you would like to report bugs, the issue tracker is the right place. If you can help translating, find us on POEditor. To get started developing, take a look at the developer documentation. In any case: come talk to us, we'll be delighted to help you with the first steps.
To stay up to date with our work or get support it's recommended to join our Matrix channel, stop by our community forums or subscribe to the release feed. We also engage in regular community calls (RSS) which you are very welcome to join.
Installation / Upgrading
You can run HedgeDoc in a number of ways, and we created setup instructions for all of these:
Configuration
Theres two main ways to configure your HedgeDoc instance: config file or environment variables. You can choose what works best for you.
HedgeDoc can integrate with
- facebook, twitter, github, gitlab, mattermost, dropbox, google, ldap, saml and oauth2 for login
- imgur, s3, minio, azure for image/attachment storage (files can also be local!)
- dropbox for export and import
More info about that can be found in the configuration docs above.
Browser support
To use HedgeDoc, your browser should match or exceed these versions:
- Chrome >= 47, Chrome for Android >= 47
- Safari >= 10.1, iOS Safari >= 10.3
- Firefox >= 44
- Edge >= 14
- Opera >= 34, Opera Mini not supported
- Android Browser >= 4.4
Backup/restore your instance
To backup HedgeDoc, you should:
- backup your database
- backup your custom config file if you have one
- backup the upload folder (see the uploadsPath config directive)
Restoring an existing instance of HedgeDoc is then just a matter of restoring these elements.
Related Tools
Our community has created related tools, we'd like to highlight hedgedoc-cli which lets you use HedgeDoc from the comfort of your command line.
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.