CVE-2023-43658
📋 TL;DR
This vulnerability in the discourse-calendar plugin allows attackers to inject malicious scripts into event titles, leading to cross-site scripting (XSS) attacks in the email preview interface. Only Discourse sites with Content Security Policy (CSP) disabled are affected, which is a non-default configuration. Most Discourse installations are protected by default CSP settings.
💻 Affected Systems
- discourse-calendar plugin for Discourse
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Attackers could steal session cookies, perform actions as authenticated users, or redirect users to malicious sites if CSP is disabled and XSS is successfully exploited.
Likely Case
Limited impact since most Discourse sites have CSP enabled by default, preventing the XSS from executing even if injection occurs.
If Mitigated
No impact when CSP is enabled, as modern browsers will block the malicious script execution.
🎯 Exploit Status
Exploitation requires the attacker to create or modify calendar events with malicious titles and the victim to view email previews. CSP provides strong protection even if injection occurs.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Version containing commit 9788310906febb36822d6823d14f1059c39644de
Vendor Advisory: https://github.com/discourse/discourse-calendar/security/advisories/GHSA-3fwj-f6ww-7hr6
Restart Required: Yes
Instructions:
1. Update discourse-calendar plugin to latest version via Discourse admin interface
2. Restart Discourse application
3. Verify CSP remains enabled (default setting)
🔧 Temporary Workarounds
Enable Content Security Policy
allEnsure CSP is enabled on Discourse forum to block XSS execution even if injection occurs
Check Discourse admin settings for CSP configuration
🧯 If You Can't Patch
- Ensure Content Security Policy (CSP) is enabled and properly configured on the Discourse forum
- Restrict calendar event creation/modification permissions to trusted users only
🔍 How to Verify
Check if Vulnerable:
Check if discourse-calendar plugin version is older than commit 9788310906febb36822d6823d14f1059c39644de and CSP is disabled
Check Version:
Check Discourse admin panel → Plugins → discourse-calendar version
Verify Fix Applied:
Verify plugin has been updated to include the proper escaping fix and CSP is enabled
📡 Detection & Monitoring
Log Indicators:
- Unusual calendar event creation/modification patterns
- Suspicious script-like content in event titles
Network Indicators:
- Unexpected script tags in email preview responses
SIEM Query:
Search for calendar event modifications containing script tags or JavaScript code in titles
🔗 References
- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
- https://github.com/discourse/discourse-calendar/commit/9788310906febb36822d6823d14f1059c39644de
- https://github.com/discourse/discourse-calendar/security/advisories/GHSA-3fwj-f6ww-7hr6
- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
- https://github.com/discourse/discourse-calendar/commit/9788310906febb36822d6823d14f1059c39644de
- https://github.com/discourse/discourse-calendar/security/advisories/GHSA-3fwj-f6ww-7hr6