All vulnerabilities
CRITICALInfraransomware

INFRA-MONGODB-2017

Database · MongoDB · MongoDB (internet-exposed instances)

Summary

Tens of thousands of MongoDB instances were left exposed to the internet with no authentication on the admin account, a known insecure default in older versions. Multiple attacker groups scanned the internet via Shodan, connected anonymously, exfiltrated or deleted the database contents, and left a ransom note demanding Bitcoin. By early January 2017 roughly 10,500 servers, about a quarter of all internet-facing MongoDB databases, were hit, and cumulative waves through 2017 ruined over 45,000 databases. Many victims who paid recovered nothing because competing crews overwrote each other's ransom notes and in many cases never copied the data.

How to avoid it in your code

  • Bind databases to private interfaces only; never listen on 0.0.0.0 or expose DB ports to the internet.
  • Enable authentication and role-based access control by default; never run a datastore with auth disabled.
  • Restrict database ports with firewalls/security groups to known application hosts.
  • Encrypt data at rest and in transit, and keep regular tested backups against extortion/wipe attacks.
  • Continuously scan your external surface (Shodan/Censys) for internet-exposed datastores and alert.

References

Related vulnerabilities

All Infra →