Cloudanix VulnDB

CVE-2019-2386

High · 7.1

CVSS

7.1

EPSS

1.1%

Published

Aug 6, 2019

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

Deleting a user and later creating a new one with the same name can let someone who was logged in before the deletion keep accessing the system as if they were the new user.

Exploit Available
Exploitation
Remote Authenticated
Attacker needs
Low Privilege
Complexity
High
Impact
Full Compromise
Component
Application
Class
Authorization Bypass
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Improper invalidation of authorization sessions after user deletion allows an active authenticated session to persist and be conflated with a newly created account that reuses the deleted username, resulting in unauthorized access under the new account's identity.

Why it matters to the business

Organizations face risk of unauthorized data access or actions if deleted user accounts are recreated with the same names, potentially leading to privilege misuse, data exposure, or compliance violations in environments with frequent user account turnover.

How an attack unfolds

An attacker obtains valid credentials or an active session for a user account; after the account is deleted by an administrator, the attacker maintains the session; a new account is then created reusing the exact same username, causing the lingering session to grant the attacker the new account's privileges without re-authentication.

How to fix it

Upgrade MongoDB Server to version 4.0.9 or later, 3.6.13 or later, or 3.4.22 or later; restart nodes after any user deletions to invalidate sessions; avoid reusing usernames of previously deleted accounts.

How to confirm the fix worked

Verify running MongoDB versions against the fixed releases; test by deleting a user, creating a new user with the same name, and confirming that prior sessions no longer grant access; review authorization session handling in logs after user modifications.

Typical attack path

  1. Obtain valid credentials or hijack an active session for a target user account
  2. Wait for or trigger deletion of the original user account
  3. Create a new account using the identical username of the deleted account
  4. Reuse the persistent session to perform actions under the new account's authorization context

How to detect it

Review MongoDB audit and system logs for sequences of user deletion events followed closely by creation of an account with the identical name; look for authentication or authorization events occurring under a username after its deletion but before a new creation.

What your security team should do

  • Immediately upgrade all MongoDB instances to the fixed versions listed for each affected release line
  • Implement a policy prohibiting reuse of deleted usernames and enforce it via account provisioning processes
  • Schedule periodic restarts of nodes following bulk user deletions as a temporary control
  • Monitor for any exploit attempts given the public availability of proof-of-concept code

The record

After user deletion in MongoDB Server the improper invalidation of authorization sessions allows an authenticated user's session to persist and become conflated with new accounts, if those accounts reuse the names of deleted ones. This issue affects MongoDB Server v4.0 versions prior to 4.0.9; MongoDB Server v3.6 versions prior to 3.6.13 and MongoDB Server v3.4 versions prior to 3.4.22. Workaround: After deleting one or more users, restart any nodes which may have had active user authorization sessions. Refrain from creating user accounts with the same name as previously deleted accounts.

Affected packages

Ecosystem Package Introduced Fixed
Ubuntu:14.04:LTS mongodb 0 No fix
Ubuntu:16.04:LTS mongodb 0 No fix
Ubuntu:18.04:LTS mongodb 0 1:3.6.3-0ubuntu1.3
Ubuntu:20.04:LTS mongodb 0 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.2
Ubuntu:Pro:14.04:LTS mongodb 0 No fix
Ubuntu:Pro:16.04:LTS mongodb 0 No fix

Related vulnerabilities