MongoDBDatabase / datastore

CVE-2025-6707

MEDIUM · 5.4 CVSS v3.1 Published 2025-06-26
Fix available
A fix is available. Upgrade to 5.0.31 / 6.0.24 or later.
See remediation →
60/100
Remediation priority · Elevated
Remotely reachable 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
Under certain conditions, an authenticated user request may execute with stale privileges following an intentional change by an authorized administrator. This issue affects MongoDB Server v5.0 version prior to 5.0.31, MongoDB Server v6.0 version prior to 6.0.24, MongoDB Server v7.0 version prior to 7.0.21 and MongoDB Server v8.0 version prior to 8.0.5.

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 · high confidence

An authenticated user's in-flight requests may continue executing with outdated privileges after an administrator intentionally modifies or revokes those privileges. This creates a window where actions can be performed with permissions that should no longer be granted, representing a time-of-check to time-of-use (TOCTOU) or privilege caching issue in MongoDB's authorization layer.

MitigationUpgrade MongoDB Server to version 5.0.31 or higher (v5.0), 6.0.24 or higher (v6.0), 7.0.21 or higher (v7.0), or 8.0.5 or higher (v8.0). Plan maintenance windows accordingly and test thoroughly in non-production environments before deploying.

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
MongoDBDatabase / datastore
Affected:>= 5.0.0, < 5.0.31>= 6.0.0, < 6.0.24>= 7.0.0, < 7.0.21>= 8.0.0, < 8.0.5

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
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/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. Determine MongoDB server version
    Run 'db.version()' in the mongo shell or use 'mongod --version' from command line
    Affected if The installed version falls within >= 5.0.0 && < 5.0.31, OR >= 6.0.0 && < 6.0.24, OR >= 7.0.0 && < 7.0.21, OR >= 8.0.0 && < 8.0.5
  2. Verify authentication is enabled
    Check the MongoDB configuration file (mongod.conf) for 'security.authorization' setting or run 'db.adminCommand({getParameter: 1, authenticationMechanisms: 1})'
    Affected if Authentication is set to 'enabled' (value is 'enabled' or 'true')
  3. Identify users with modifiable roles
    Run 'db.system.users.find({}, {user: 1, db: 1, roles: 1})' to list all users and their assigned roles
    Affected if Any users exist with custom or elevated roles that an administrator could modify or revoke during active sessions

You are affected if your MongoDB version is within the affected ranges AND authentication is enabled AND you have users with modifiable roles where in-flight requests could retain outdated privileges after privilege changes.

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 5.0.31 / 6.0.24 / 7.0.21 or later
Fixed in 5.0.316.0.247.0.21
Interim mitigation

Upgrade MongoDB Server to version 5.0.31 or higher (v5.0), 6.0.24 or higher (v6.0), 7.0.21 or higher (v7.0), or 8.0.5 or higher (v8.0). Plan maintenance windows accordingly and test thoroughly in non-production environments before deploying.

Recommended fix High confidence

Minimum: 5.0.31 (for 5.0 branch), 6.0.24 (for 6.0 branch), 7.0.21 (for 7.0 branch), 8.0.5 (for 8.0 branch)

  1. 1. Identify current MongoDB version using: db.version() or mongod --version
  2. 2. Determine the appropriate upgrade target based on current version branch (5.0.x -> 5.0.31, 6.0.x -> 6.0.24, 7.0.x -> 7.0.21, 8.0.x -> 8.0.5)
  3. 3. Create a full backup of all databases before upgrading
  4. 4. Test the upgrade in a non-production environment first
  5. 5. Follow MongoDB's documented upgrade procedure for your deployment type (standalone, replica set, or sharded cluster)
  6. 6. For replica sets and sharded clusters, upgrade secondary members first, then primary
  7. 7. After upgrade, restart all client connections to ensure they re-authenticate with updated privileges
  8. 8. Verify the upgrade was successful and test that privilege changes take effect immediately for new requests
Caveat MongoDB upgrades may include compatibility changes; review release notes for your version branch before upgrading

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

Fix this in MongoDB Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing6.0 h
  • Review / QA3.0 h
21.0 hours of engineering $3,680
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,888.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2025-6707 — 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-2025-6707 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