Commit Graph

1247 Commits

Author SHA1 Message Date
Joakim Svensson
c3e078c9c6 Add Invite Agent action to editor menu and allow CSP connect-src 2025-12-31 00:08:30 +00:00
Erik Michelson
7185a44448 docs: update for release 1.10.5
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-12-06 17:45:55 +01:00
Erik Michelson
0a5f4ccefd docs: update for release 1.10.4
Co-authored-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-12-05 23:36:12 +01:00
Erik Michelson
35f36fccba fix(auth): add state parameters and PKCE support
Only the OAuth2 auth strategy was using the state parameter,
which should be used as described in the RFC. The other
auth strategies such as GitHub, GitLab or Google were lacking
the state parameter.
This change adds the required state parameter as well as
enabling PKCE support on providers where it's possible.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-12-05 22:06:30 +01:00
Erik Michelson
ef724d0fc2 fix(renderer): use credentialless and sandbox attributes on iframes
Websites loaded via an iframe could interrupt the user's workflow by initiating certain actions like opening print dialogs, alert boxes, etc. on the user's browser or even initiate file downloads.
By using the sandbox attribute, the iframe is limited in it's actions and can't access browser APIs such as to download files.
With the additional credentialless attribute, the page in the iframe is loaded in a completely separate browsing context on Chromium-based browsers, thus isolating the content even more.
The functionality could previously be abused to initiate certain actions on 3rd-party websites where the user is logged-in, if these 3rd-party websites have no proper CSRF protection. However, this is not a security risk to HedgeDoc itself.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-12-05 21:57:19 +01:00
Erik Michelson
10ec965ed3 fix(renderer): correct regexes for list extra tags
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-12-03 19:52:52 +01:00
Erik Michelson
801ef14b7e fix(shutdown): kill server after timeout when hanging on shutdown
When socket.io is not able to close a connection somehow, the code
never reaches the final shutdown state but keeps waiting for all
connections to be closed. This can cause a high CPU load on failing
shutdown. It is very unlikely to happen, except when the server is
shut down exactly at the same time a socket is disconnecting and not
already marked as disconnected. This change adds a fallback timer
which forcefully kills the server after a certain amount of time.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-12-03 19:52:52 +01:00
Erik Michelson
1028d61bf9 fix(embeddings): replace removed sample PDF file with another one
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-12-03 19:52:52 +01:00
Erik Michelson
1c9a5e4283 fix(embeddings): YouTube embedding requires referrer
The embedded YouTube player seemed not to work anymore
and showed a warning "invalid player configuration".
This seems to be related to the iframe being loaded
without a referrer to the origin domain. YouTube
nowadays requires this (probably to track from which
domains a YouTube player is embedded).

See also: https://developers.google.com/youtube/terms/required-minimum-functionality#embedded-player-api-client-identity

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-12-03 19:52:52 +01:00
Philip Molares
bc2075ae9d refactor: use user-token for historyDelete too
Previously, the user token was only used for the endpoint
to delete the user itself. This commit adds that token to
the history deletion as well.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2025-11-26 19:28:53 +01:00
Erik Michelson
05a937ea22 chore(node): run tests and linting with Node 24 too
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-11-26 09:23:29 +01:00
Erik Michelson
9a45d1e2a9 chore(deps): upgrade dependencies, remove some unnecessary ones
This commit upgrades dependencies that are more or less trivial
to update, e.g. because they didn't have major version bumps or
simply didn't break anything. There are some dependencies which
have not been upgraded since this would have required larger
refactorings. This includes especially the markdown-it ecosystem
and the webpack ecosystem.
The largest refactorings in this commit come from the bump of
socket.io v2 to v4 which changed the handling of the connected
socket list for instance.

This commit further removes some outdated and/or unnecessary
dependencies. This includes the String.js library which is
unmaintained for 9 years and has some CVEs. We mainly used
this library for their escapeHTML and unescapeHTML methods.
This can be done using native DOM APIs nowadays, which is also
considered more safe since it is the same logic that the
browser itself uses.
Since we target Node 18 and above, we can also rely on the
built-in fetch function instead of the node-fetch package.
The current version of Chance.js includes a method for
generating a random color now too, so we don't need the
package randomcolor anymore.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-11-24 14:32:24 +01:00
Erik Michelson
637c451486 fix: use nanoid instead of shortid
shortid is deprecated and they recommend nanoid instead.
We're not sure if this has to do with possible name
collisions or enumerability, but to be sure and on the
safe side, we're changing this. nanoid seems quite safe
since it uses node's crypto module underneath.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-11-22 01:05:50 +01:00
Erik Michelson
4030cbbd3c fix(renderer): update regex for supported link schemes
This commit updates the whitelist we're using for outgoing links from HedgeDoc. Previously, any URI scheme except javascript: could be used as long as it contains two slashes after the scheme (like https://). On the one hand this allowed linking to arbitrary and possibly unsafe URI schemes, on the other hand this breaks some schemes like xmpp: or geo:.
We're now using the list of schemes that can be registered by a browser to be opened. This restricts arbitrary scheme usage but on the other side fixes several other schemes.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-11-21 21:37:46 +01:00
Erik Michelson
6d970dbafd feat(config): allow restriction and disabling of uploads
Previously, image uploads were always allowed, unless `CMD_ALLOW_ANONYMOUS=false` and `CMD_ALLOW_ANONYMOUS_EDITS=false`.
This PR adds a new config option `CMD_ENABLE_UPLOADS` to configure image uploads independently. There are three different modes: `all` (everyone can upload, guests too), `registered` (only registered and logged-in users can upload images), and `none` to completely disable image uploads.
The default value is non-breaking as it is `all`, unless the config `CMD_ALLOW_ANONYMOUS=false` and `CMD_ALLOW_ANONYMOUS_EDITS=false` is set, in which case the value is `registered`.
The UI will reflect the setting and either show or hide the upload button.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-11-15 22:54:57 +01:00
Kim Brose
1f586399ac update non-localised strings
Signed-off-by: Kim Brose <2803622+HarHarLinks@users.noreply.github.com>
2025-08-30 00:45:38 +02:00
Erik Michelson
c61bc6a2e0 docs(release-notes): add entry about toobusy bugfix
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-08-14 15:31:09 +02:00
Erik Michelson
a27f58396b docs: update release notes
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-04-10 00:21:55 +02:00
Erik Michelson
3f520ea59a refactor(embeds): drop slideshare, use vimeo api, tighten CSP
The slideshare integration was broken for quite a while already,
as slideshare doesn't seem to have a good replacement, we're
dropping it in the same manner as speakerdeck was dropped some
time ago. This means the special syntax now just renders a plain
link. This commit gets rid of the vimdo oembed API too which
allowed JSONP injection. Instead we're using the normal vimeo
video metadata API.

Co-authored-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-04-10 00:21:55 +02:00
Erik Michelson
0636b5c20b refactor: use iframes for gist embedding instead of gist-embed
The used library gist-embed relies on GitHub Gist's JSONP
endpoint which is a risk for XSS injection. By adding untrusted
content from GitHub into the DOM it also follows very bad
practises. Using the iframe embedding has the disadvantage of
not having the proper height for the frame auto-loaded, but
the security benefits are worth it.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-04-10 00:21:55 +02:00
Erik Michelson
f31e591c17 chore(release): bump version to 1.10.3 and add release notes
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-04-10 00:21:55 +02:00
Philip Molares
38f25ec8cc chore: bump version to 1.10.2
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2025-02-14 22:14:11 +01:00
Philip Molares
7b61a815c1 fix(release-notes): typo in the release year
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2025-02-14 21:09:03 +01:00
Philip Molares
a8d5cb754c fix(oauth2): verify user id exists
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2025-02-14 21:09:03 +01:00
Erik Michelson
fb6218ed82 fix(saml): change SAML attribute default, verify that a NameID is defined
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2025-02-14 21:09:03 +01:00
Philip Molares
cd50fc1e57 docs: finalize release notes
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2025-02-02 23:12:33 +01:00
Philip Molares
e5be5d3f9d chore: bump version to 1.10.1
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2025-02-02 23:12:33 +01:00
Philip Molares
3ae75adfb4 docs: add deprecation warning for node v18
We don't want to mix security fixes with major dependency updates, so
this release will still work with v18, but the next one won't support
it anymore.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2025-02-01 23:43:00 +01:00
Erik Michelson
72c233b233 fix: set HSTS preload attribute to false by default
See <https://hstspreload.org/#opt-in> for more information
why this is important.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-02-01 22:56:38 +01:00
Philip Molares
c84a01b4ae chore(eslint): add missing global comments
These comments tell eslint that those special variables are
globally accessible

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2025-02-01 22:15:54 +01:00
Philip Molares
03a7b0d3ef chore(eslint): remove deprecated eslint-env
These comments did not work anymore and were replaced by relevant
sections in eslint.config.mjs

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2025-02-01 22:15:54 +01:00
Philip Molares
c437366c33 chore(eslint): run eslint --fix
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2025-02-01 22:15:54 +01:00
Erik Michelson
876ebad1f3 feat: rate-limiting
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2025-02-01 21:12:08 +01:00
Dominik Rimpf
980bc71a65 fix(csp): allow 'data:' images in pads
Signed-off-by: Dominik Rimpf <dev@drimpf.de>
2024-12-18 19:09:05 +01:00
Lautaro Alvarez
4fdab806a3 fix(oauth2): Fix crash when profile fields are missing (#5850)
Co-authored-by: Lautaro Alvarez <lautaro@grava.digital>
2024-11-01 15:21:10 +01:00
David Mehren
28c08c297f Update release notes for 1.10.0
Signed-off-by: David Mehren <git@herrmehren.de>
2024-09-01 16:38:46 +02:00
David Mehren
3f79374619 Import translations from POEditor
Signed-off-by: David Mehren <git@herrmehren.de>
2024-09-01 16:38:46 +02:00
David Mehren
60325bba49 Fix anchor links dropping query parameter
Signed-off-by: David Mehren <git@herrmehren.de>
2024-09-01 16:38:46 +02:00
David Mehren
c543dc1f23 fix: anchor links
Signed-off-by: David Mehren <git@herrmehren.de>
2024-09-01 11:09:57 +02:00
David Mehren
1b91232909 fix: anchor links
Signed-off-by: David Mehren <git@herrmehren.de>
2024-09-01 11:09:57 +02:00
Erik Michelson
bf740ad910 fix(a11y): hide duplicated link text from screen readers
Because screen readers don't know that the anchor icon is not meant to be read,
they might read the title (which is the same as the heading itself) in addition
to the heading, thus causing a duplicated output.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2024-08-23 17:44:14 +02:00
Erik Michelson
858d7bf5d1 feat: option to disable note creation
The abuse of the demo instance required us to disallow note creation

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2024-07-21 11:03:35 +02:00
Erik Michelson
c85b11463d fix(minio): metadata as object not string
A change in the minio JS SDK resulted in uploads being stored
with a defect metadata object in minio, resulting in all
files served as application/octet-stream. This was caused as
the fifth argument to putObject is a metadata object and not
the content-type alone anymore.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2024-06-20 21:58:17 +02:00
Erik Michelson
307a634157 fix(router): do not create sessions for /_health
When the /_health endpoint for the docker container
healthcheck was introduced, it seems that it was
forgotten to exclude that route from the session
creation. As the healthcheck runs quite periodically,
this created a huge amount of session entries in the
database. This commit excludes the route from
session creation.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2024-02-10 15:52:08 +01:00
Erik Michelson
538f41cf1c fix(opengraph): treat user frontmatter values as String
A bug was reported that having frontmatter fields being only numeric results in an error. This seems to be caused
as the frontmatter is processed by the yaml-parser but returned
with the types as given. So a numeric value is returned as a number,
a "true" or "false" is returned as boolean etc.
As we expect strings in the template, that resulted in an exception.

This commit fixes this by treating every value as string in the template.
Since we've got no other usages of opengraph data, this should not have been
a security problem.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2024-01-17 17:10:06 +01:00
Jordi Mallach
91acb9063b Add a reference to Mermaid 9.1.7 documentation
HedgeDoc 1.9.x bundles Mermaid version 9.1.7, which
is old enough that current Mermaid syntax will fail to
render inside HedgeDoc notes.

Add a pointer to Mermaid 9.1.7 docs, so users of the
current stable HedgeDoc know what's actually supported.

https://github.com/mermaid-js/mermaid/blob/v9.1.7/docs/n00b-gettingStarted.md

Signed-off-by: Jordi Mallach <jordi@igalia.com>
2023-11-12 20:47:40 +01:00
David Mehren
de066ed6d9 Import translations from POEditor
Signed-off-by: David Mehren <git@herrmehren.de>
2023-07-30 20:07:27 +02:00
David Mehren
1da964a2f6 Add release notes for 1.9.9
Signed-off-by: David Mehren <git@herrmehren.de>
2023-07-30 20:07:27 +02:00
David Mehren
7c747cc6b6 Remove CodiMD infobox and tooltip
Signed-off-by: David Mehren <git@herrmehren.de>
2023-07-30 20:07:27 +02:00
David Mehren
2bb8531cc8 Do not translate slogan
Signed-off-by: David Mehren <git@herrmehren.de>
2023-07-30 20:07:27 +02:00