exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

MongoDB 2.0.1 / 2.1.1 / 2.1.4 / 2.1.5 Local Password Disclosure

MongoDB 2.0.1 / 2.1.1 / 2.1.4 / 2.1.5 Local Password Disclosure
Posted Mar 8, 2024
Authored by Emad Al-Mousa

MongoDB versions 2.0.1, 2.1.1, 2.1.4, and 2.1.5 appear to suffer from multiple localized password disclosure issues.

tags | exploit, info disclosure
SHA-256 | ec43188752263df8468c0d1efaa74c0c5834d7a2469f132a2cf3841157e23944

MongoDB 2.0.1 / 2.1.1 / 2.1.4 / 2.1.5 Local Password Disclosure

Change Mirror Download
Title: MongoDB MONGOSH Password Exposure Vulnerability
Product: MongoDB database
Tool: mongosh
Affected Version(s): 2.0.1 , 2.1.1,2.1.4,2.1.5
Tested Version(s): 2.0.1 , 2.1.1,2.1.4,2.1.5
Risk Level: Low
Author of Advisory: Emad Al-Mousa


*****************************************
Vulnerability Details:

Vulnerability in MongoDB database system "mongosh" which is a JavaScript and Node.js REPL environment for interacting with MongoDB deployments in Atlas , locally, or on another remote host. So, its basically a command line utility to run database commands and java scripts against back-end MongoDB database system.

MONGOSH has two vulnerbailites where passwords can be exposed and leaked in which an attacker to the operating system can weaponize for unauthorized access to the MongoDB database system.


*****************************************
Proof of Concept (PoC):

Vulnerability No1. : passwordPrompt() showing password displayed in clear text

per documentation:

https://www.mongodb.com/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt

The password should not be displayed, however I found out that it appears clearly in the prompt !

The password function passwordPrompt() was tested and used in conjunction with db.createUser, db.changeUserPassword, db.auth commands and all of them were allowing clear text password to appear.




admin> use admin
already on db admin
admin> db.createUser({user:"mongo2", pwd: passwordPrompt(), roles:["root"]})
Enter password
mongo
*****{ ok: 1 }
admin>


Vulnerability No2. : Password is exposed in mongosh_repl_history file with db.auth command


Mongosh was tested with both “remove”& “remove-redact” modes

config.set (redactHistory, “remove-redact”)

config.set (‘redactHistory’, “remove”)

In Linux Red Hat Environment the file: $MONGOHOME/.mongodb/mongosh/mongosh_repl_history

Contains the password in clear text for historical commands run for authentication db.auth() and db.createUser , per documentation: https://www.mongodb.com/docs/mongodb-shell/logs/ the logs should omit the credentials but this didn’t happen !

In windows operating system environment the file: C:\Users\windows_profile_user\AppData\Roaming\mongodb\mongosh

Commands running for database creation db.createUser and db.auth() are logging the username, password explicitly as shown below:

cat mongosh_repl_history

use admin

db.createUser({user:"mongo2", pwd: passwordPrompt(), roles:["root"]})


*****************************************
References:
https://databasesecurityninja.wordpress.com/2024/03/07/mongodb-mongosh-password-exposure-vulnerability/
https://www.mongodb.com/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt
https://www.mongodb.com/docs/mongodb-shell/logs/



Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 Files
  • 17
    Jul 17th
    34 Files
  • 18
    Jul 18th
    6 Files
  • 19
    Jul 19th
    34 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    19 Files
  • 23
    Jul 23rd
    17 Files
  • 24
    Jul 24th
    47 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close