CVE-2025-22602

6.5 MEDIUM

📋 TL;DR

This vulnerability allows attackers to execute arbitrary JavaScript in users' browsers by posting malicious video placeholder HTML elements in Discourse forums. Only Discourse sites with Content Security Policy (CSP) disabled are affected. Attackers can steal session cookies, redirect users, or perform actions on their behalf.

💻 Affected Systems

Products:
  • Discourse
Versions: All versions before the patch
Operating Systems: All
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when Content Security Policy (CSP) is disabled. CSP is enabled by default in Discourse installations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could steal administrator credentials, take over forum administration, exfiltrate user data, or distribute malware to all forum visitors.

🟠

Likely Case

Attackers would steal user session cookies to hijack accounts, post spam, or redirect users to malicious sites.

🟢

If Mitigated

With CSP enabled, the attack is completely prevented as CSP blocks inline JavaScript execution.

🌐 Internet-Facing: HIGH - Discourse forums are typically internet-facing, and the exploit requires only posting privileges which are often granted to registered users.
🏢 Internal Only: LOW - Discourse is primarily deployed as an internet-facing community platform, not typically used internally.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires posting privileges (typically registered user access). The vulnerability is straightforward to exploit once an attacker understands the video placeholder HTML injection technique.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Latest version of Discourse (specific version not specified in advisory)

Vendor Advisory: https://github.com/discourse/discourse/security/advisories/GHSA-jcjx-694p-c5m3

Restart Required: Yes

Instructions:

1. Update Discourse to the latest version using standard update procedures. 2. Restart the Discourse application. 3. Verify CSP remains enabled in site settings.

🔧 Temporary Workarounds

Enable Content Security Policy

all

Enable CSP in Discourse settings to block inline JavaScript execution and prevent this attack.

Navigate to Admin > Settings > Security > Content Security Policy and ensure it's enabled

🧯 If You Can't Patch

  • Enable Content Security Policy (CSP) immediately in Discourse settings
  • Restrict posting privileges to trusted users only and monitor for suspicious posts

🔍 How to Verify

Check if Vulnerable:

Check if CSP is disabled in Discourse settings AND version is older than patched release

Check Version:

Check Discourse admin dashboard or run: `cd /var/discourse && ./launcher status app`

Verify Fix Applied:

Verify Discourse is updated to latest version AND CSP is enabled in settings

📡 Detection & Monitoring

Log Indicators:

  • Unusual posts containing video placeholder HTML elements
  • Multiple failed CSP violation reports if CSP is enabled

Network Indicators:

  • Outbound connections to unexpected domains from forum pages
  • Suspicious JavaScript execution patterns

SIEM Query:

Search for posts containing unusual video or iframe HTML elements, especially with JavaScript event handlers

🔗 References

📤 Share & Export