[SERVER-15630] Empty net.bindIp listens to all interfaces Created: 13/Oct/14  Updated: 10/Dec/14  Resolved: 14/Oct/14

Status: Closed
Project: Core Server
Component/s: Security, Usability
Affects Version/s: 2.6.4, 2.7.7
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Andreas Nilsson
Resolution: Duplicate Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-15656 Improve bind_ip handling of badly for... Closed
Related
related to SERVER-15656 Improve bind_ip handling of badly for... Closed
is related to SERVER-14927 Bad bind_ip should fail, not listen o... Closed
Operating System: ALL
Participants:

 Description   

Invalid bindIp in the YAML config file results in mongod listening to all interfaces rather then erroring out

$ cat mongod.conf

net:
   bindIp:
   port: 27017

$ mongod --config mongod.conf

2014-10-13T14:05:56.040-0700 [initandlisten] MongoDB starting : pid=11881 port=27017 dbpath=/data/db 64-bit host=toddler.local
2014-10-13T14:05:56.041-0700 [initandlisten] db version v2.6.4
2014-10-13T14:05:56.041-0700 [initandlisten] git version: 3a830be0eb92d772aa855ebb711ac91d658ee910
2014-10-13T14:05:56.041-0700 [initandlisten] build info: Darwin bs-osx108-4 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2014-10-13T14:05:56.041-0700 [initandlisten] allocator: system
2014-10-13T14:05:56.041-0700 [initandlisten] options: { config: "mongod.conf", net: { bindIp: true, port: 27017 } }

$ netstat -na | grep 27017

tcp4       0      0  *.27017                *.*                    LISTEN



 Comments   
Comment by Hannes Magnusson [ 13/Oct/14 ]

Same happens with bindIp: []
ironically enough, bindIp: true is treated as string as fails

Generated at Thu Feb 08 03:38:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.