LiveActive security incident?Get immediate response
CVE Record

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

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.

MediumCVSS 4.4Not KEV-listedUpdated
Glexia's TakeAutomated analysismoderate

Security readout for executives and security teams

Plain-English summary

CVE-2021-39161 is a cross-site scripting issue in Discourse category names. The business risk is limited for default installations because Discourse’s default Content Security Policy mitigates it. Risk rises for sites that weakened or disabled CSP and allow moderators to modify categories.

Executive priority

Prioritize remediation for internet-facing Discourse communities with customized CSP or delegated moderator category control. Default, fully patched deployments are lower urgency, but version and CSP validation should be completed.

Technical view

Affected Discourse versions before 2.7.8 and 2.8.0 beta versions before beta4 allowed category names to be used for XSS. The CVSS 3.1 score is 4.4, with network access, high complexity, low privileges, required user interaction, and changed scope.

Likely exposure

Exposure is most likely on self-hosted or managed Discourse sites running affected versions, with modified or disabled CSP, and moderator permissions that allow category changes. Default CSP significantly reduces practical exposure.

Exploitation context

The source bundle does not report active exploitation, and the CVE is not listed as KEV. Exploitation depends on site configuration and user interaction, so broad opportunistic exploitation is not supported by the provided evidence.

Researcher notes

Focus assessment on version, CSP posture, and category-management permissions. The provided sources identify the weakness and patched version ranges, but do not provide evidence of exploitation in the wild or additional compensating controls beyond CSP and upgrade guidance.

Mitigation direction

  • Upgrade Discourse to the latest stable, beta, or tests-passed release.
  • Confirm Discourse Content Security Policy is enabled.
  • Avoid CSP changes that weaken XSS protection.
  • Restrict category modification permissions until patched.
  • Review the Discourse advisory for current vendor guidance.

Validation and detection

  • Inventory Discourse instances and compare versions against affected ranges.
  • Check whether CSP is enabled and close to Discourse defaults.
  • Review which roles can modify categories.
  • Confirm upgraded systems are no longer below 2.7.8 or beta4.
  • Document any CSP exceptions and their business justification.
Prepared
Confidence
high
Sources
3

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-79: User-session and phishing behavior lookup

Client-side and session-facing weaknesses should be reviewed alongside initial-access and user-execution behaviors. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-39161 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Medium
CVSS
4.4 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
2Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
4.4CVSS 3.1MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N1.32.7Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

4.4Medium
CVSS 3.1 vector shape for CVE-2021-39161Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
discoursediscourse< 2.7.8, >= 2.8.0.beta1, < 2.8.0.beta4Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-79 · source CWE mapping

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.