# CVE-2021-39161: Cross-site scripting via category name in Discourse

- Severity: Medium 4.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.41%, higher than 37% of CVEs (2026-12-01)
- Published: 2021-08-26T20:00:11.000Z
- Modified: 2026-09-08T08:46:03.161Z
- Also known as: BIT-DISCOURSE-2021-39161, GHSA-xhmc-9jwm-wqph
- Weaknesses: CWE-79
- Assigned by: GitHub_M

## Description

Discourse is an open source platform for community discussion. In affected versions category names can be used for Cross-site scripting(XSS) attacks. This is mitigated by Discourse's default Content Security Policy and this vulnerability only affects sites which have modified or disabled or changed Discourse's default Content Security Policy have allowed for moderators to modify categories. This issue is patched in the latest stable, beta and tests-passed versions of Discourse. Users are advised to ensure that the Content Security Policy is enabled, and has not been modified in a way which would make it more vulnerable to XSS attacks.

(As written by CVE List.)

## Affected

- discourse discourse: < 2.7.8; >= 2.8.0.beta1, < 2.8.0.beta4; before 2.7.8; 2.8.0
- discourse (Bitnami): before 2.7.8

## Every score

- GitHub_M: CVSS:3.1 4.4 Medium `CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:2.0 2.1 Low `AV:N/AC:H/Au:S/C:N/I:P/A:N`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://github.com/discourse/discourse/security/advisories/GHSA-xhmc-9jwm-wqph> (advisory, third-party-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-39161> (web)

## Sources

- CVE List: [CVE-2021-39161](https://www.cve.org/CVERecord?id=CVE-2021-39161), CVE Terms of Use, modified 2024-08-04
- NVD: [CVE-2021-39161](https://nvd.nist.gov/vuln/detail/CVE-2021-39161), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-DISCOURSE-2021-39161](https://osv.dev/vulnerability/BIT-DISCOURSE-2021-39161), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2021-39161 · Whole record: https://cve.day/CVE-2021-39161.json · Rebuilt by cve.day 2026-11-25T22:58:03.522Z
