Security Experts:

Configuration Issue Exposes 30,000 MongoDB Instances: Researcher

Nearly 30,000 MongoDB instances are accessible over the Internet without any authorization enabled, an expert has warned.

With more than 10 million downloads, 2,000 customers and 1,000 partners, MongoDB is the most popular NoSQL database system. MongoDB is used by organizations such as eBay, LinkedIn, SAP and Sourceforge.

According to John Matherly, founder of the computer search engine Shodan, roughly 30,000 MongoDB instances containing nearly 600TB of data are exposed on the Internet.

The expert said he was surprised by the results of the Shodan search considering that the “mongodb.conf” configuration file available on GitHub since 2013 specified that MongoDB listens on localhost by default.

The issue was reported in early 2012 by Roman Shtylman (SERVER-4216), but it took MongoDB developers more than two years to actually address it.

“The default install of mongodb [...] does not have a ‘bind_ip 127.0.0.1’ option set in the mongodb.conf,” Shtylman warned in 2012. “This leaves a user’s server vulnerable if they are not aware of this setting. The default should be to lockdown as much as possible and only expose if the user requests it.”

Matherly says MongoDB 2.4.14, a maintenance release from April 28, 2015, is the last version that still listens to 0.0.0.0 by default, which means listening is enabled on all interfaces. The expert believes early versions of MongoDB 2.6 might also lack binding to localhost.

Matherly also noticed that a majority of the publicly accessible MongoDB instances are hosted in the cloud, particularly DigitalOcean, Amazon, Linode and OVH.

“I've actually observed this trend across the board: cloud instances tend to be more vulnerable than the traditional datacenter hosting. My guess is that cloud images don't get updated as often, which translates into people deploying old and insecure versions of software,” the expert said in a blog post.

These poorly configured instances expose a total of 595.2TB of data. The ten most common database names identified as a result of the Shodan search are local, admin, db, test, config, mydb, video, hackedDB, storage, and trash.

“Faceting on the database name reveals widespread installations that might've been misconfigured or otherwise exposed. There are a lot of instances that have some sort of administrative database, so the app that uses MongoDB probably has authentication but the database itself doesn't,” said Matherly.

This isn’t the first time researchers report finding MongoDB databases exposed on the Web. In February, students from the Saarland University in Germany revealed finding nearly 40,000 exposed instances.

The experts noted at the time that many precompiled MongoDB packages are shipped with a default configuration that binds the service to the localhost (bind_ip is set to 127.0.0.1). However, since in many cases the database and the service using the database are running on different machines, developers remove the “bind_ip” flag to allow all network connections to the database.

This allows access from outside the trusted network and if transfer encryption and proper access control are not set up, the database becomes exposed, researchers said.

MongoDB is encouraging users to follow best security practices to ensure their instances are protected against potential attacks. 

“Recently a blog post was published that claimed some users had not properly secured their instances of MongoDB and were therefore at risk. As the article explains, the potential issue is a result of how a user might configure their deployment without security enabled. There is no security issue with MongoDB - extensive security capabilities are included with MongoDB," Kelly Stirman, VP of Strategy at MongoDB, told SecurityWeek

“We encourage all users to follow the guidelines we prescribe for security. Security best practices are summarised here, or customers can contact MongoDB support. This is an important opportunity for everyone to ensure they are following security best practices.”

*Updated with statement from MongoDB

view counter
Eduard Kovacs (@EduardKovacs) is a contributing editor at SecurityWeek. He worked as a high school IT teacher for two years before starting a career in journalism as Softpedia’s security news reporter. Eduard holds a bachelor’s degree in industrial informatics and a master’s degree in computer techniques applied in electrical engineering.