CVE-2024-45308·MariaDB vulnerability
HedgeDoc is an open source, real-time, collaborative, markdown notes application. When using HedgeDoc 1 with MySQL or MariaDB, it is possible 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 with an arbitrary alias, e.g. by accessing it in the browser. When MySQL or MariaDB are used, it is possible to create a new note with an alias that matches the lower-cased ID of a different note. HedgeDoc then always presents the new note to users, as these databases perform case-insensitive matching and the lower-cased alias is found first. This issue only affects HedgeDoc instances that use MySQL or MariaDB. 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. Users are advised to upgrade to version 1.10.0 which addresses this issue. Users unable to upgrade may disable freeURL mode which prevents the exploitation of this issue. The impact can also be limited by restricting freeURL note creation to trusted, logged-in users by enabling `requireFreeURLAuthentication`/`CMD_REQUIRE_FREEURL_AUTHENTICATION`.
- Severity
- medium
- Software
- MariaDB
- Fixed in
- 1.10.0
- Published
- 2024-09-02
Affected versions
Until: 1.10.0
Fixed in: 1.10.0
How to fix this CVE
Upgrade HedgeDoc to version 1.10.0 or later to patch the alias collision vulnerability affecting MariaDB deployments. If immediate upgrade is not possible, disable the freeURL feature by setting `allowFreeURL` to `false`, or require authentication for freeURL note creation using the `requireFreeURLAuthentication` option to limit exposure to trusted users only.
sudo dnf update mariadb-serverDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check HedgeDoc version with: grep -i version /path/to/hedgedoc/package.json | head -1
- Step 2: Verify if freeURL mode is enabled by checking your HedgeDoc config file for allowFreeURL=true or CMD_ALLOW_FREEURL environment variable set to true
- Step 3: Search HedgeDoc application logs for unusual note creation patterns: grep -i 'note.*created\|alias' /var/log/hedgedoc/*.log | grep -i lowercase
- Step 4: Query the MariaDB database to identify notes with duplicate aliases using case-insensitive matching: SELECT alias, COUNT(*) FROM notes GROUP BY LOWER(alias) HAVING COUNT(*) > 1;
FAQ
What is CVE-2024-45308?
CVE-2024-45308 is a vulnerability in HedgeDoc when running on MariaDB or MySQL that allows attackers to create note aliases matching the lowercased IDs of existing notes, effectively shadowing and hiding the original notes from users due to case-insensitive database matching.
Is CVE-2024-45308 being actively exploited?
No, CVE-2024-45308 is not listed on the CISA Known Exploited Vulnerabilities catalog and no public exploits are currently available, though the vulnerability is straightforward to exploit if conditions are met.
What versions of HedgeDoc are affected by CVE-2024-45308?
All versions of HedgeDoc prior to 1.10.0 are vulnerable when deployed with MariaDB or MySQL backends and the freeURL feature is enabled.
How do I check if my server is vulnerable to CVE-2024-45308?
Verify your HedgeDoc version (check package.json), confirm MariaDB/MySQL is in use, and check if freeURL mode is enabled via your config file or CMD_ALLOW_FREEURL environment variable.
Does Defensia detect CVE-2024-45308?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If HedgeDoc is installed on a monitored server, CVE-2024-45308 will appear in your dashboard with remediation steps.
Related MariaDB CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-45308. Free for 1 server.
Get started free