CVE-2024-39777

8.7 HIGH

📋 TL;DR

This vulnerability in Mattermost allows remote attackers to forcibly share local channels without administrator consent when shared channels are enabled. Attackers can send unsolicited invites with existing local channel IDs, exposing those channels to unauthorized external access. This affects Mattermost instances with shared channels enabled across multiple version ranges.

💻 Affected Systems

Products:
  • Mattermost
Versions: 9.9.x <= 9.9.0, 9.5.x <= 9.5.6, 9.7.x <= 9.7.5, 9.8.x <= 9.8.1
Operating Systems: All platforms running Mattermost
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when shared channels feature is enabled. Default installations may not have this enabled.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Sensitive internal communications and data in local channels become accessible to unauthorized external parties, potentially exposing confidential information, intellectual property, or sensitive discussions.

🟠

Likely Case

Unauthorized sharing of internal team channels with external entities, leading to data leakage and potential compliance violations.

🟢

If Mitigated

Limited exposure if shared channels feature is disabled or proper access controls are in place to restrict external connections.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires ability to send invites to the Mattermost instance, but does not require authentication to the target channel being hijacked.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Update to Mattermost 9.9.1, 9.5.7, 9.7.6, or 9.8.2

Vendor Advisory: https://mattermost.com/security-updates

Restart Required: Yes

Instructions:

1. Backup your Mattermost instance. 2. Download the patched version from Mattermost releases. 3. Stop Mattermost service. 4. Replace with patched version. 5. Restart Mattermost service. 6. Verify version update.

🔧 Temporary Workarounds

Disable Shared Channels

all

Temporarily disable the shared channels feature to prevent exploitation

Edit config.json: set 'EnableSharedChannels' to false
Restart Mattermost service

🧯 If You Can't Patch

  • Disable shared channels feature immediately
  • Implement network segmentation to restrict external access to Mattermost instance

🔍 How to Verify

Check if Vulnerable:

Check Mattermost version and verify if shared channels are enabled in System Console > Environment > Shared Channels

Check Version:

mattermost version

Verify Fix Applied:

Verify version is 9.9.1, 9.5.7, 9.7.6, or 9.8.2 or higher

📡 Detection & Monitoring

Log Indicators:

  • Unexpected channel sharing events
  • External invites to local channels without admin approval
  • Shared channel creation logs without corresponding local admin actions

Network Indicators:

  • Unexpected external connections to previously internal-only channels
  • Increased cross-server communication for channel sharing

SIEM Query:

source="mattermost" AND (event="channel_shared" OR event="invite_accepted") AND NOT user_role="admin"

🔗 References

📤 Share & Export