CVE-2026-5139: Mattermost GitLab Integration Authorization Bypass
Mattermost has a flaw in how it controls access to GitLab integration settings. Any logged-in user can run a slash command (/gitlab connect) to change which GitLab instance the entire Mattermost workspace uses by default. This should only be allowed for administrators. An attacker with any valid Mattermost account could redirect the workspace to a malicious GitLab instance, potentially capturing credentials or injecting compromised code through pull requests and CI/CD pipelines.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 5.4 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L
- Weaknesses (CWE)
- CWE-862
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-22 / 2026-06-23
NVD description (verbatim)
Mattermost versions 11.7.x <= 11.7.0, 11.6.x <= 11.6.2, 11.5.x <= 11.5.5, 10.11.x <= 10.11.17 fail to enforce administrator authorization on the {{setDefaultInstance}} call within the {{/gitlab connect}} command handler, which allows any authenticated user to overwrite the global default GitLab instance configuration via the {{/gitlab connect <instance-name>}} slash command.. Mattermost Advisory ID: MMSA-2026-00644
1 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists in the /gitlab connect command handler across multiple Mattermost versions. The setDefaultInstance function fails to validate that the caller holds administrator role before applying changes to global GitLab configuration. The flaw is an authorization bypass (CWE-862) triggered by any authenticated user. The CVSS 3.1 score of 5.4 reflects network-accessible exploitation, low complexity, and the requirement for prior authentication—but the impact includes integrity loss (ability to rewrite configuration) and limited availability impact if misconfiguration disrupts integrations.
Business impact
An attacker leveraging this vulnerability could silently redirect your Mattermost workspace's GitLab integration to a rogue instance under their control. This creates a channel for credential theft (developers may re-enter credentials), code tampering (intercepting or modifying pull requests), and supply-chain attacks if CI/CD pipelines consume poisoned repositories. The attack leaves minimal audit trail if logs do not track configuration changes, and the blast radius extends to every developer in the workspace. Organizations using Mattermost as a collaboration hub for software development face material risk.
Affected systems
Mattermost Server versions 11.7.0 and earlier in the 11.7.x line, 11.6.2 and earlier in 11.6.x, 11.5.5 and earlier in 11.5.x, and 10.11.17 and earlier in 10.11.x are affected. Organizations running any of these versions with GitLab integration enabled and with multiple authenticated users should prioritize assessment and patching.
Exploitability
Exploitability is straightforward for any user with valid Mattermost credentials. No special tools, elevated privileges, or user interaction required—the attacker simply issues a slash command in any channel or direct message. The barrier to entry is low; the only prerequisite is access to a Mattermost workspace. No known public exploits are tracked in CISA's KEV catalog as of the advisory date, but the simplicity of the attack vector means weaponization risk is moderate to high once awareness spreads.
Remediation
Update Mattermost Server to a patched version that enforces administrator-only authorization on the setDefaultInstance call. Consult the official Mattermost advisory (MMSA-2026-00644) and vendor release notes to confirm which versions contain the fix. Organizations unable to patch immediately should restrict /gitlab connect command usage via role-based access controls or disable GitLab integration until a patch is deployed.
Patch guidance
Check the Mattermost advisory page (MMSA-2026-00644) and your installed version against the affected ranges (11.7.0, 11.6.2, 11.5.5, 10.11.17). Upgrade to the next available minor or patch release that addresses this flaw. Test the upgrade in a non-production environment, particularly validating that GitLab integration still functions for authorized users and that configuration changes now require admin role. Plan patching during a maintenance window to avoid disruption to active Mattermost users.
Detection guidance
Monitor audit logs and Mattermost activity logs for unexpected invocations of the /gitlab connect slash command, especially by users without administrator role. Look for configuration changes to GitLab integration settings that occur outside normal change windows or via slash commands rather than the admin panel. Set up alerts on modifications to the default GitLab instance configuration. If your organization has comprehensive slash-command logging, search historical logs for any /gitlab connect usage by non-admin accounts since the version was deployed.
Why prioritize this
Although the CVSS score is moderate (5.4), the vulnerability's impact justifies urgent attention because: (1) any authenticated user can exploit it with a single command; (2) the outcome is silent configuration tampering that could compromise the supply chain; (3) affected versions span multiple release lines, likely affecting organizations on older maintenance branches; and (4) the threat actor does not need advanced skills or exploit code. This is a textbook case where low technical complexity and high business risk warrant prioritization above the numerical score.
Risk score, explained
CVSS 3.1 assigns 5.4 (MEDIUM) based on: Network-accessible attack vector, low attack complexity, requirement for low privileges (any authenticated user), no user interaction needed, and scope unchanged. The integrity and availability impacts are both Low—an attacker can alter configuration but cannot directly read sensitive data (no confidentiality loss) and impact to availability is indirect (through misconfiguration). However, the real-world risk is elevated by the ease of exploitation and the downstream supply-chain consequences, which standard CVSS does not fully capture.
Frequently asked questions
Can an attacker redirect GitLab integration to a different instance without administrator approval?
Yes. Any authenticated Mattermost user can execute the /gitlab connect command to change the default GitLab instance for the entire workspace. This should require administrator role but currently does not.
What is the attacker's goal in redirecting the GitLab instance?
A rogue GitLab instance allows the attacker to intercept credentials (if developers re-enter them), tamper with repositories, inject malicious code into CI/CD pipelines, or harvest pull-request data. It is a supply-chain attack vector.
How do I know if my Mattermost workspace is affected?
Check your Mattermost version. If it is 11.7.0, 11.6.2 or earlier, 11.5.5 or earlier, or 10.11.17 or earlier, you are affected. Verify in System Console > About Mattermost or via the CLI command `mattermost version`.
What if we do not use GitLab integration?
The vulnerability is specific to the /gitlab connect command handler. If GitLab integration is not installed or enabled, this flaw cannot be exploited. However, patching is still recommended to keep your Mattermost deployment aligned with security best practices.
This analysis is based on information available as of the advisory publish date (June 22, 2026) and the Mattermost security advisory MMSA-2026-00644. Patch availability and specific remediation steps should be verified against the official Mattermost advisory and release notes. SEC.co does not provide legal or compliance advice. Organizations should conduct their own risk assessment in context of their deployment, user base, and integration dependencies. No exploit code or weaponized proof-of-concept is provided or endorsed by this document. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-6689MEDIUMMattermost Permission Bypass in Team Creation
- CVE-2022-42479MEDIUMMissing Authorization in TemplateHouse Soledad – MEDIUM Severity Access Control Bypass
- CVE-2022-45813MEDIUMBeRocket Advanced AJAX Product Filters Missing Authorization Flaw
- CVE-2023-25969MEDIUMMissing Authorization in ThemeHunk Contact Form Plugin
- CVE-2023-32959MEDIUMMetroStore Missing Authorization Vulnerability – Patch Guide
- CVE-2024-24709MEDIUMShareaholic Missing Authorization Vulnerability – Update Required
- CVE-2024-31435MEDIUMMissing Authorization in Inisev Social Media & Share Icons Plugin—Patch Guidance
- CVE-2024-33685MEDIUMMissing Authorization in Jegstudio Startupzy 1.1.1 – MEDIUM Severity Vulnerability