MongoDB Dangerous Configuration Checks
MongoDB misconfigurations are responsible for the majority of exposed instances found in the wild. Disabled authorization and wildcard bind addresses together produce fully open databases reachable from the internet. Each configuration item below is an independent finding. Run these after gaining access through service discovery and use results to inform the full attack path.
Authorization Disabled
The most critical misconfiguration. Pull the startup options and check the security configuration:
{ authorization: 'disabled' }
"--noauth"
authorization: disabled or --noauth in argv confirms authentication is off. Any client connecting to this instance has full access to all databases and collections.
Wildcard Bind Address
MongoDB bound to 0.0.0.0 or * accepts connections from any IP address. Combined with disabled auth this means any host on the internet can connect:
{ bindIp: '*', port: 27017 }
bindIp: '*' or 0.0.0.0 confirms the instance listens on all interfaces. A correctly configured instance should bind only to 127.0.0.1 or a specific internal interface. The --bind_ip_all startup flag produces the same result.
TLS Not Enforced
Without TLS, all data including credentials transmitted during authentication is plaintext on the wire:
No tls key in the net configuration output confirms TLS is not configured. A correctly hardened instance should have tls.mode: requireTLS. Confirm by attempting a plain connection — if it succeeds, TLS is not enforced:
6.0.5 plaintext accepted
JavaScript Execution Enabled
The server-side JavaScript engine enables the $where operator, which executes arbitrary JavaScript in query context. This is required for operator injection attacks using $where. Check whether it is active:
{ javascriptEnabled: true, ok: 1 }
javascriptEnabled: true confirms $where queries will execute. This is also visible in the build info as javascriptEngine: mozjs. In MongoDB 4.4 and later, JavaScript execution is disabled by default with --noscripting — finding it enabled is a misconfiguration finding.
HTTP Interface and REST API
Older MongoDB versions (pre-3.6) exposed an HTTP diagnostic interface on port 28017. Check whether it is accessible:
Configuration Summary Check
Run all checks in a single non-interactive pass for documentation and reporting:
Version: 6.0.5 BindIP: * Auth: disabled TLS: not configured JavaScript: true
References
-
MongoDB — Security Checklistwww.mongodb.com/docs/manual/administration/security-checklist (opens in new tab)
Official security hardening checklist covering auth, TLS, and network exposure
-
MongoDB — Configuration Optionswww.mongodb.com/docs/manual/reference/configuration-options (opens in new tab)
Full reference for mongod configuration file options
Was this helpful?
Your feedback helps improve this page.