CVE-2025-4981

9.9 CRITICAL

📋 TL;DR

This vulnerability allows authenticated Mattermost users to write files to arbitrary locations on the filesystem by uploading archives containing path traversal sequences in filenames. This can lead to remote code execution when file uploads and document search by content are enabled. All Mattermost instances running affected versions with default configurations are vulnerable.

💻 Affected Systems

Products:
  • Mattermost
Versions: 10.5.x <= 10.5.5, 9.11.x <= 9.11.15, 10.8.x <= 10.8.0, 10.7.x <= 10.7.2, 10.6.x <= 10.6.5
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Requires FileSettings.EnableFileAttachments = true and FileSettings.ExtractContent = true (both enabled by default)

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data exfiltration, or ransomware deployment.

🟠

Likely Case

Unauthorized file writes to sensitive locations, potential privilege escalation, and data manipulation.

🟢

If Mitigated

Limited impact if proper access controls and monitoring are in place, though file system integrity may still be compromised.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

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

Exploitation requires authenticated user access and specific configuration settings enabled

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 10.5.6, 9.11.16, 10.8.1, 10.7.3, 10.6.6 or later

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

Restart Required: Yes

Instructions:

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

🔧 Temporary Workarounds

Disable file content extraction

all

Disable the ExtractContent setting to prevent archive extraction

Update config.json: "ExtractContent": false

Disable file attachments

all

Completely disable file attachments to prevent archive uploads

Update config.json: "EnableFileAttachments": false

🧯 If You Can't Patch

  • Implement strict file upload restrictions and monitoring
  • Apply network segmentation and limit Mattermost server access

🔍 How to Verify

Check if Vulnerable:

Check Mattermost version and verify FileSettings.EnableFileAttachments and FileSettings.ExtractContent are both true

Check Version:

mattermost version

Verify Fix Applied:

Verify Mattermost version is patched (10.5.6+, 9.11.16+, 10.8.1+, 10.7.3+, or 10.6.6+)

📡 Detection & Monitoring

Log Indicators:

  • Unusual archive uploads, file write attempts to unexpected locations, path traversal patterns in filenames

Network Indicators:

  • Large or unusual file uploads to Mattermost

SIEM Query:

source="mattermost" AND ("archive" OR "upload" OR "extract") AND (".." OR "../" OR "path traversal")

🔗 References

📤 Share & Export