CVE-2025-4981
Mattermost vulnerability analysis and mitigation

Overview

CVE-2025-4981 is a critical path traversal vulnerability in Mattermost Server that allows authenticated users to write files to arbitrary locations on the filesystem via maliciously crafted archive uploads, potentially leading to remote code execution. It affects 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, and 10.6.x ≤ 10.6.5. The vulnerability was published on June 20, 2025, with patches released the same day. It carries a CVSS v3.1 base score of 9.9 (Critical) (GitHub Advisory, Mattermost Security).

Technical details

The root cause is insufficient filename sanitization in Mattermost's archive extractor component (CWE-427: Uncontrolled Search Path Element). When a user uploads an archive (e.g., ZIP or similar) containing filenames with path traversal sequences (e.g., ../../), the extractor writes the file contents to attacker-controlled locations on the server filesystem without proper validation. Exploitation requires two default-enabled configuration settings to be active: FileSettings.EnableFileAttachments = true and FileSettings.ExtractContent = true. The attack is network-based, requires only low-privilege authentication, and needs no user interaction, making it highly accessible to any registered Mattermost user (GitHub Advisory).

Impact

Successful exploitation allows an authenticated attacker to write arbitrary files anywhere on the server filesystem accessible to the Mattermost process, which can directly lead to remote code execution — for example, by overwriting server-side scripts, configuration files, or planting web shells. The vulnerability has a Changed scope in CVSS, meaning impacts extend beyond the Mattermost application itself to the underlying host system. Full confidentiality, integrity, and availability compromise of the affected server is possible, with potential for lateral movement within the hosting environment (GitHub Advisory, Security Online).

Exploitation steps

  1. Reconnaissance: Identify Mattermost server instances (e.g., via Shodan, Censys, or organizational asset inventory) running vulnerable 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) with default settings enabled.
  2. Authenticate: Obtain or register a low-privilege Mattermost user account on the target instance.
  3. Craft malicious archive: Create an archive file (e.g., ZIP) containing a file with a path traversal sequence in its filename, such as ../../var/www/html/shell.php, with a malicious payload (e.g., a web shell) as the file content.
  4. Upload archive: Use the Mattermost file attachment feature to upload the crafted archive to any channel or direct message. The server's archive extractor processes the file for content indexing (ExtractContent = true).
  5. Trigger extraction: The server extracts the archive without sanitizing the filename, writing the payload to the attacker-specified path on the filesystem.
  6. Achieve RCE: Access the written file (e.g., the web shell at the traversed path) via the web server or another execution mechanism to achieve remote code execution on the host (GitHub Advisory, Security Online).

Indicators of compromise

  • Network: Unusual outbound connections from the Mattermost server process to external IPs following file upload events; HTTP requests to unexpected file paths on the web server originating from external sources.
  • File System: Unexpected files written outside the Mattermost data directory (e.g., in /var/www/, /tmp/, or system directories); archive files uploaded by users containing filenames with ../ or ..\ sequences; newly created scripts or executables owned by the Mattermost service account in non-standard locations.
  • Logs: Mattermost application logs showing archive extraction activity for files with path traversal characters in filenames; web server access logs showing requests to newly created files in unexpected directories; OS-level audit logs (e.g., auditd) recording file creation events by the Mattermost process outside its expected data directory.
  • Process: Unexpected child processes spawned by the Mattermost server process (e.g., shells, interpreters, or network tools) (GitHub Advisory).

Mitigation and workarounds

Mattermost has released patched versions: 9.11.16, 10.5.6, 10.6.6, 10.7.3, 10.8.1. Administrators should upgrade to one of these versions immediately. As a temporary workaround if patching is not immediately possible, disable either FileSettings.EnableFileAttachments or FileSettings.ExtractContent in the Mattermost server configuration — disabling either setting prevents exploitation. Additionally, restrict file upload permissions to trusted users and monitor server logs for suspicious archive upload activity (GitHub Advisory, Mattermost Security).

Community reactions

The vulnerability received notable attention from the security community upon disclosure on June 20, 2025, given its critical CVSS score of 9.9. Security researchers and aggregators including SecurityOnline, Black Kite, and the Canadian Centre for Cyber Security (CCCS) published advisories and analysis highlighting the risk (Security Online, CCCS Advisory). Social media posts on Mastodon and Bluesky from security researchers flagged the vulnerability as high-priority for organizations using Mattermost. Black Kite included it in their TPRM (Third-Party Risk Management) Focus Friday analysis, emphasizing supply chain and enterprise risk implications (Black Kite).

Additional resources


SourceThis report was generated using AI

Related Mattermost vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-4981CRITICAL9.9
  • Mattermost logoMattermost
  • cpe:2.3:a:mattermost:mattermost
NoYesJun 20, 2025
CVE-2024-8071HIGH7.2
  • Mattermost logoMattermost
  • github.com/mattermost/mattermost/server/v8
NoYesAug 22, 2024
CVE-2026-24661MEDIUM6.5
  • Mattermost logoMattermost
  • cpe:2.3:a:mattermost:mattermost
NoYesApr 09, 2026
CVE-2026-21388MEDIUM6.5
  • Mattermost logoMattermost
  • cpe:2.3:a:mattermost:mattermost
NoYesApr 09, 2026
CVE-2024-10214LOW3.5
  • Mattermost logoMattermost
  • govulncheck-vulndb
NoYesOct 28, 2024

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management