CVE-2023-38487

HedgeDoc API allows to hide existing notes

6.5 medium EPSS 0.79%

Published 4 Aug 2023 Updated 3 Oct 2024 CNA: GitHub_M

Check your servers for CVE-2023-38487

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2023-38487 affects hedgedoc, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

HedgeDoc is software for creating real-time collaborative markdown notes. Prior to version 1.9.9, the API of HedgeDoc 1 can be used to create notes with an alias matching the ID of existing notes. The affected existing note can then not be accessed anymore and is effectively hidden by the new one.

When the freeURL feature is enabled (by setting the `allowFreeURL` config option or the `CMD_ALLOW_FREEURL` environment variable to `true`), any user with the appropriate permissions can create a note by making a POST request to the `/new/<ALIAS>` API endpoint. The `<ALIAS>` parameter can be set to the ID of an existing note. HedgeDoc did not verify whether the provided `<ALIAS>` value corresponds to a valid ID of an existing note and always allowed creation of the new note. When a visitor tried to access the existing note, HedgeDoc will first search for a note with a matching alias before it searches using the ID, therefore only the new note can be accessed.

Depending on the permission settings of the HedgeDoc instance, the issue can be exploited only by logged-in users or by all (including non-logged-in) users. The exploit requires knowledge of the ID of the target note. Attackers could use this issue to present a manipulated copy of the original note to the user, e.g. by replacing the links with malicious ones. Attackers can also use this issue to prevent access to the original note, causing a denial of service. No data is lost, as the original content of the affected notes is still present in the database.

This issue was fixed in version 1.9.9. As a workaround, disabling freeURL mode prevents the exploitation of this issue. The impact can be limited by restricting freeURL note creation to trusted, logged-in users by enabling `requireFreeURLAuthentication`/`CMD_REQUIRE_FREEURL_AUTHENTICATION`.

Severity (CVSS)

6.5 medium CVSS 3.1 from GitHub_M (CNA)
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:L
Attack vector
network: an attacker can reach the vulnerable part over the network, often from the internet
Attack complexity
high: an attack depends on conditions outside the control of the attacker, such as a race
Privileges required
none: the attacker does not need an account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality none, integrity high, availability low: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.79%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 57.5% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 3 Oct 2024):

Exploitation
poc: a proof of concept is public
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Weakness

  • CWE-289 Authentication Bypass by Alternate Name

Affected products

As the CNA lists them.

ProductVersions
hedgedoc
affected < 1.9.9

Is my server affected?

Find the installed version of hedgedoc and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i hedgedoc
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2023-38487 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2023-38487

RHEL, Rocky, Alma, Fedora

rpm -q hedgedoc
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2023-38487

Alpine

apk list --installed | grep -i hedgedoc

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2023-38487
trivy image --scanners vuln IMAGE | grep CVE-2023-38487

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Advisories

Other references

Source: the record CVE-2023-38487 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.