How to secure MongoDB – because it isn't by default and thousands of DBs are being hacked

Stop right now and make sure you've configured it correctly


The rise in ransomware attacks on MongoDB installations prompted the database maker last week to issue advice on how to avoid being victimized.

As of Sunday, security researcher and Microsoft developer Niall Merrigan identified more than 27,000 MongoDB databases seized by ransomware. By Tuesday afternoon Pacific Time, an online spreadsheet maintained by Merrigan and fellow security researcher Victor Gevers listed 32,643 victims.

The attacks involve hackers who copy data from insecure databases, delete the original, and ask for a ransom of a few hundred dollars worth of Bitcoin to return the stolen data back to the owner.

MongoDB, like other NoSQL databases, has suffered from security shortcomings for years. Trustwave called out MongoDB in 2013. Security researcher John Matherly did so again in 2015.

Where MySQL, PostgreSQL, and other relational databases tend to default to local installation and some form of authorization, MongoDB databases are exposed to the internet by default, and don't require credentials immediately by default.

MongoDB's post explains "how to avoid a malicious attack that ransoms your data," but it does so by directing database users to take responsibility for configuring the software securely.

Veracode CTO Chris Wysopal in a Twitter post argues that software should be secure as soon as it is installed. "Why isn't the MongoDB security checklist the default?" he said. "Software with insecure default configuration is broken."

Infosec bod Gevers, in an interview conducted through Twitter direct messages, said he has criticized MongoDB in the past but insisted that the database owner has to take responsibility for software configuration. It is, he said, "the responsibility of the owner to use it right."

Gevers said he believed the growth in poorly configured MongoDB installations was a reflection of time-to-market pressures. "People are happy to follow a tutorial to install a server, but have no idea what they are doing," he said. He also laid some blame on DevOps automation, which makes it trivial to spin up remote servers without necessarily securing them properly.

The security researcher advises following MongoDB's security recommendations, or at the very least blocking port 27017 on your firewall or configuring MongoDB to listen only to 127.0.0.1 in /etc/mongodb.conf, and then restarting the database.

A spokesperson for New York City-headquartered MongoDB, in an email interview, insisted that MongoDB is not less secure than relational databases like MySQL and PostgresSQL, and pointed to the company's list of security best practices.

"MongoDB has the robust security capabilities that one would expect from a modern database," the spokesperson said. "It is the nature of database software that administrators can switch certain options on and off. This is not specific to MongoDB, and it is important for the way many applications may be developed."

Citing the importance of being open-source software, the spokesperson stressed that the company is committed to the community and its contributions.

"Being open-source also means that anyone can download the product and deploy it however they want," the spokesperson added. "Ultimately, database security comes down to two things: well made software and responsible use. For example, with MongoDB Atlas, our production-ready managed database as a service, access control is enabled by default. Users of MongoDB Cloud Manager or Ops Manager can enable alerts to detect if their deployment is internet exposed." ®


Other stories you might like

  • Experts: AI should be recognized as inventors in patent law
    Plus: Police release deepfake of murdered teen in cold case, and more

    In-brief Governments around the world should pass intellectual property laws that grant rights to AI systems, two academics at the University of New South Wales in Australia argued.

    Alexandra George, and Toby Walsh, professors of law and AI, respectively, believe failing to recognize machines as inventors could have long-lasting impacts on economies and societies. 

    "If courts and governments decide that AI-made inventions cannot be patented, the implications could be huge," they wrote in a comment article published in Nature. "Funders and businesses would be less incentivized to pursue useful research using AI inventors when a return on their investment could be limited. Society could miss out on the development of worthwhile and life-saving inventions."

    Continue reading
  • Declassified and released: More secret files on US govt's emergency doomsday powers
    Nuke incoming? Quick break out the plans for rationing, censorship, property seizures, and more

    More papers describing the orders and messages the US President can issue in the event of apocalyptic crises, such as a devastating nuclear attack, have been declassified and released for all to see.

    These government files are part of a larger collection of records that discuss the nature, reach, and use of secret Presidential Emergency Action Documents: these are executive orders, announcements, and statements to Congress that are all ready to sign and send out as soon as a doomsday scenario occurs. PEADs are supposed to give America's commander-in-chief immediate extraordinary powers to overcome extraordinary events.

    PEADs have never been declassified or revealed before. They remain hush-hush, and their exact details are not publicly known.

    Continue reading
  • Stolen university credentials up for sale by Russian crooks, FBI warns
    Forget dark-web souks, thousands of these are already being traded on public bazaars

    Russian crooks are selling network credentials and virtual private network access for a "multitude" of US universities and colleges on criminal marketplaces, according to the FBI.

    According to a warning issued on Thursday, these stolen credentials sell for thousands of dollars on both dark web and public internet forums, and could lead to subsequent cyberattacks against individual employees or the schools themselves.

    "The exposure of usernames and passwords can lead to brute force credential stuffing computer network attacks, whereby attackers attempt logins across various internet sites or exploit them for subsequent cyber attacks as criminal actors take advantage of users recycling the same credentials across multiple accounts, internet sites, and services," the Feds' alert [PDF] said.

    Continue reading

Biting the hand that feeds IT © 1998–2022