Skip to content
Access control Advisory Intermediate CVE-2019-2386

MongoDB Server session reuse vulnerability

An authentication flaw in MongoDB Server before version 4.0.9 allows a previously established session to remain valid after the associated user is deleted, if the user is later recreated with the same username. An attacker with prior access to that user's session could regain access to the database.

Mitch Wasson Follow

Originally disclosed on Cisco Talos

High 7.1 View original

An exploitable authentication vulnerability exists in MongoDB Server prior to version 4.0.9. Access to a MongoDB database server can be persisted after user deletion by reusing an established session of said user.

Mitch Wasson, on Cisco Talos

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker with a previously established session could regain access to the database after the user is recreated, potentially reading or modifying data.

What the attacker needed

Previous access to a user session; Administrator recreates the same user

The fix

The vulnerability was fixed in MongoDB Server 4.0.9; as a workaround, administrators should avoid recreating users with the same username after deletion.

How it was found

  1. Attacker connects to MongoDB with a valid user account.
  2. Administrator deletes that user.
  3. No activity is attempted on the attacker's session.
  4. Administrator recreates a user with the same username.
  5. Attacker reuses the old session to access the database.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you log into a database, the server gives you a session (like a temporary pass). Normally, if an admin deletes your user account, that pass should stop working. But in this bug, if the admin later creates a new user with the same name, the old pass still works, letting the attacker back in.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.