Port 27017/tcp: MongoDB
Category: Databases. Range: registered. Status: iana registered.
What runs here
The default port for mongod (and mongos router) instances, carrying MongoDB's own binary wire protocol used by drivers and the mongosh shell to issue commands and queries. IANA registers this port to MongoDB Inc. specifically for TCP; the UDP variant is reserved/unused.
Why it matters
MongoDB shipped with no authentication enabled by default for many years, and the resulting population of internet-exposed, unauthenticated instances became the target of large, well-documented mass campaigns that connected, dumped or deleted the data, and left a ransom note demanding payment for its return, which attacks that required no credentials or exploit at all, just an open 27017. It remains one of the fastest-triggering "why is this database on the internet" findings in any external exposure review.
Where you see it
Legitimately: application drivers, replica set/sharded cluster member communication, and admin tools (mongosh, Compass). Anomalously/maliciously: an unauthenticated internet-facing instance receiving connections that immediately drop or rename collections and insert a ransom-note document, or successful auth attempts against default/weak credentials on an instance that does have auth enabled.
What to look for
| Signal | What it means |
|---|---|
| Ransom-note collection | A newly created collection or document containing a ransom demand and a contact address, in an otherwise legitimate database, is the hallmark of the mass Mongo-wiping campaigns and should be treated as a confirmed compromise, not just exposure. |
| No-auth bind to 0.0.0.0 | Confirming whether --auth/security.authorization was enabled and whether bindIp was left at its permissive default is the first triage step for any internet-facing MongoDB instance. |
In practice
An unauthenticated MongoDB instance left bound to 0.0.0.0:27017 is discovered by an internet-wide scanner within hours, its collections are dropped, and a single new document demanding payment in cryptocurrency is inserted in their place: the entire attack requiring nothing beyond an unauthenticated TCP connection.