CVE-2021-43827
JSON

4.3medium

Inline footnotes wrapped in <a> tags can cause errors in discourse-footnotes

Severity
4.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.83% (higher than 58% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

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.

Affected

Product or packageVersionsReported by
discourse discourse-footnote< 0.2CVE List
discourse discourse_footnotebefore 0.2NVD

All scores

GitHub_M4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
NVD4.0medium CVSS:2.0AV:N/AC:L/Au:S/C:N/I:N/A:P

Classification

What each source says

CVE List

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.

NVD (es)

discourse-footnote es una biblioteca que proporciona notas a pie de página para los mensajes en Discourse. ### Impacto Cuando es publicada una nota al pie de página en línea envuelta en etiquetas "(a)" (por ejemplo, "(a)^[footnote](/a)", el HTML resultante incluye un "(a)" anidado, que es eliminado por Nokogiri porque no es válido. Esto causaba un error de javascript en las páginas de los temas porque buscábamos un elemento "(a)" dentro del span de referencia de la nota al pie y obteníamos su ID, y como no se presentaba obteníamos un error de referencia null en javascript. Es recomendado a usuarios que actualicen a la versión 0.2. Como solución a este problema, pueden editarse las entradas en cuestión desde la consola de rails o la consola de la base de datos en el caso de los auto alojados, o deshabilitar el plugin en el panel de administración

References

Sources

SourceRecordLicence
CVE ListCVE-2021-43827 changed 2024-08-04CVE Terms of Use
NVDCVE-2021-43827 changed 2026-06-17Public domain