CVE-2023-43657

7.2 HIGH

📋 TL;DR

This vulnerability in the discourse-encrypt plugin allows cross-site scripting (XSS) attacks when encrypted topic titles are improperly escaped. It affects Discourse sites using the discourse-encrypt plugin with Content Security Policy (CSP) headers disabled. Attackers could inject malicious scripts that execute in users' browsers.

💻 Affected Systems

Products:
  • discourse-encrypt plugin for Discourse
Versions: All versions before commit 9c75810af9
Operating Systems: All platforms running Discourse
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when CSP headers are disabled, which is non-default. The plugin shows warnings when CSP is disabled.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could steal session cookies, perform actions as authenticated users, deface content, or redirect users to malicious sites, potentially compromising user accounts and sensitive encrypted communications.

🟠

Likely Case

Limited XSS attacks targeting users viewing specific encrypted topics, potentially stealing session tokens or performing unauthorized actions within the user's privilege level.

🟢

If Mitigated

No impact when CSP is properly enabled, as CSP headers would block the execution of injected scripts even if they reach the browser.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Requires ability to create or modify encrypted topics and CSP disabled. Exploitation depends on user interaction with malicious content.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Version containing commit 9c75810af9

Vendor Advisory: https://github.com/discourse/discourse-encrypt/security/advisories/GHSA-5fh6-wp7p-xx7v

Restart Required: Yes

Instructions:

1. Update discourse-encrypt plugin to latest version. 2. Restart Discourse application. 3. Verify CSP headers are enabled in Discourse settings.

🔧 Temporary Workarounds

Enable CSP Headers

all

Enable and properly configure Content Security Policy headers in Discourse settings to block XSS execution.

🧯 If You Can't Patch

  • Ensure CSP headers are enabled and properly configured in Discourse settings
  • Monitor admin dashboard for CSP warnings and address them immediately

🔍 How to Verify

Check if Vulnerable:

Check if discourse-encrypt plugin version is older than commit 9c75810af9 AND CSP headers are disabled in Discourse settings.

Check Version:

Check Discourse admin panel or plugin directory for discourse-encrypt version information

Verify Fix Applied:

Verify plugin version includes commit 9c75810af9 and CSP headers are enabled with no warnings in admin dashboard.

📡 Detection & Monitoring

Log Indicators:

  • Unusual topic creation/modification patterns
  • Admin dashboard CSP warnings

Network Indicators:

  • Requests attempting to inject script tags in topic titles
  • Missing CSP headers in HTTP responses

SIEM Query:

Search for: 'CSP violation' OR 'XSS attempt' in web application logs

🔗 References

📤 Share & Export