Mattermost ServerApplication · Mattermost

CVE-2023-5331

MEDIUM · 5.3 CVSS v3.1 Published 2023-10-09
Fix available
A fix is available. Upgrade to 7.8.11 / 8.0.3 or later.
See remediation →
62/100
Remediation priority · Elevated
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Mattermost fails to properly check the creator of an attached file when adding the file to a draft post, potentially exposing unauthorized file information.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · moderate confidence

This is an authorization bypass vulnerability in Mattermost where the application fails to validate that the user attaching a file to a draft post is the legitimate creator of that file. The lack of proper ownership verification allows any user to attach files they don't own to their draft posts, potentially exposing sensitive file metadata or information about files they should not have access to.

MitigationImplement proper authorization checks to verify file ownership before allowing files to be attached to draft posts. Ensure only the original file creator or authorized users can add files to drafts.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Mattermost ServerApplication
Affected:< 7.8.11>= 8.0.0, < 8.0.3>= 8.1.0, < 8.1.2

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify installed Mattermost Server version
    Run 'sudo mattermost version' or check the version displayed in the System Console under About > Mattermost, or inspect the version file in the Mattermost installation directory
    Affected if The installed version falls within < 7.8.11, >= 8.0.0 < 8.0.3, or >= 8.1.0 < 8.1.2
  2. Verify draft posts feature is accessible
    Confirm that users have access to create draft posts - check if the Enable Drafts setting is enabled in System Console under Posts > Drafts, or that users can access the drafts functionality in the Mattermost web or desktop client
    Affected if The drafts feature is enabled and users have the ability to create draft posts with file attachments
  3. Check if file attachments are permitted on draft posts
    Review the System Console settings under Posts > Drafts to confirm Allow Files on Drafts or equivalent file attachment permissions are enabled, or test creating a draft post with a file attachment as a standard user
    Affected if Users can attach files to draft posts in your environment
  4. Review server logs for unauthorized file access attempts
    Examine Mattermost server logs (typically in /var/log/mattermost or via the logging system) for anomalous file attachment events on drafts involving files owned by other users, looking for patterns where file_id references do not match the requesting user's ID
    Affected if Logs show file attachments on drafts referencing files the user did not create

Your environment is affected if you run a vulnerable Mattermost Server version AND users have the ability to create draft posts with file attachments in your deployment.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 7.8.11 / 8.0.3 / 8.1.2 or later
Fixed in 7.8.118.0.38.1.2
Interim mitigation

Implement proper authorization checks to verify file ownership before allowing files to be attached to draft posts. Ensure only the original file creator or authorized users can add files to drafts.

Recommended fix High confidence

7.8.11, 8.0.3, or 8.1.2 (depending on your current major version branch)

  1. Back up your Mattermost Server database and configuration files before upgrading
  2. Determine your current Mattermost version by checking the system console or running `mattermost version`
  3. For Mattermost 7.x versions: upgrade to version 7.8.11
  4. For Mattermost 8.0.x versions: upgrade to version 8.0.3
  5. For Mattermost 8.1.x versions: upgrade to version 8.1.2
  6. After upgrade, verify the server is running the fixed version
  7. Test that users cannot access files they did not create via draft posts

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Mattermost Server Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing4.0 h
  • Review / QA2.0 h
18.0 hours of engineering $3,200
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,120.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2023-5331 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2023-5331 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data