-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.4.5
-
Component/s: Querying
-
Environment:> db.serverBuildInfo()
{
"version" : "2.5.4-pre-",
"gitVersion" : "83e056702108e7693e58886a8364aaa036eb6edd",
"OpenSSLVersion" : "",
"sysInfo" : "Darwin vero 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",
"loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.6",
"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wno-unknown-pragmas -Winvalid-pch -pipe -O3 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6",
"allocator" : "tcmalloc",
"versionArray" : [
2,
5,
4,
-100
],
"javascriptEngine" : "V8",
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}
> db.serverBuildInfo() { "version" : "2.5.4-pre-", "gitVersion" : "83e056702108e7693e58886a8364aaa036eb6edd", "OpenSSLVersion" : "", "sysInfo" : "Darwin vero 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", "loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.6", "compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wno-unknown-pragmas -Winvalid-pch -pipe -O3 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6", "allocator" : "tcmalloc", "versionArray" : [ 2, 5, 4, -100 ], "javascriptEngine" : "V8", "bits" : 64, "debug" : false, "maxBsonObjectSize" : 16777216, "ok" : 1 }
-
ALL
Problem:
The validation for the $geoWithin allows enormous values to be passed into the query without throwing an error.
Reproduce:
2.4.5
db.q.drop() db.q.find( { "loc" : { $geoWithin : { $polygon : [ [ 0.0 , 89.9 ] , [ -25 , 33.3 ] , [ 180.0 , -33.3 ] ] , uniquedocs : false } } } ) db.q.find( { "loc" : { $geoWithin : { $polygon : [ [ 0.0 , 89.9 ] , [ -25 , 33.3 ] , [ 180.0 , -33.3 ] ] , $uniquedocs : false } } } ) db.q.find( { "loc" : { $geoWithin : { $polygon : [ [ 0.0 , 89.9 ] , [ -25 , 33.3 ] , [ 180.0 , -33.3 ] ] , $uniqueDocs : false } } } )
No error pr documents are returned.
2.5.4-Pre
db.q.drop() db.q.find( { "loc" : { $geoWithin : { $polygon : [ [ 0.0 , 89.9 ] , [ -25 , 33.3 ] , [ 180.0 , -33.3 ] ] , uniquedocs : false } } } ) error: { "$err" : "bad query: BadValue bad geo query", "code" : 16810 } db.q.find( { "loc" : { $geoWithin : { $polygon : [ [ 0.0 , 89.9 ] , [ -25 , 33.3 ] , [ 180.0 , -33.3 ] ] , $uniquedocs : false } } } ) error: { "$err" : "bad query: BadValue bad geo query", "code" : 16810 } db.q.find( { "loc" : { $geoWithin : { $polygon : [ [ 0.0 , 89.9 ] , [ -25 , 33.3 ] , [ 180.0 , -33.3 ] ] , $uniqueDocs : false } } } )