John Matherly, the creator of Shodan, the marvelous search engine for connected devices, revealed that many MongoDB administrators have exposed something like 595.2 terabytes of data by using bad poor configurations, or un-patched versions of the MongoDB.
MongoDB is a popular alternative to SQL, open source, many companies already use it, including “The New York Times”, “Ebay”, and “Foursquare.” John Matherly argues that around 30.000 databases are exposed because administrators are using old versions of MongoDB, and these old versions fail to bind to localhost
“There’s a total of 595.2 TB of data exposed on the internet via publicly accessible MongoDB instances that don’t have any form of authentication,”
The latest version of MongoDB is 3.0.4, but until version 2.4.14 MongoDB was still listening to 0.0.0.0 by default.
This is a known problem since 2012 when Roman Shtylman raised the problem, and at the time Shtylman realized that a critical bug because MongoDB was being shipped without authentication.
Shtylman said “[Affected versions] do not have a ‘bind_ip 127.0.0.1’ option set in the mongodb.conf. 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,”
Shtylman added that earlier versions of 2.6 may have the problem as well.
He came to the conclusion that most of the exposed DB are running in the cloud, hosted in Amazon, Digital Ocean, and in services such the referred ones, “My guess is that cloud images don’t get updated as often, which translates into people deploying old and insecure versions of software.”
It is not the first time that the security industry is concerned by the security of MongoDB, in February 2015 nearly 40,000 entities running MongoDB were found vulnerable to cyber attacks.
Three students from the University of Saarland in Germany, discovered that MongoDB databases running at TCP port 27017 as a service of several thousand of commercial web servers were exposed on the Internet without proper defense measures.
The German Team of experts reported that they were able to to get “read and write access” to the unsecured and vulnerable MongoDB databases without using any special hacking tools.
As usually highlighted, it is essential to proper configure every system exposed on the Internet to avoid to enlarge our surface of attack and advantage our attackers.
About the Author Elsio Pinto
(Security Affairs – MongoDB , Shodan)