-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: EJSON
How are you using Mongo? What version of the server and driver are you using?
Node's EJSON implementation permits null bytes in keys when the same would be incompatible with BSON. This allows EJSON to generate a serialized output that could not be represented in BSON.
BSON.EJSON.stringify({ 'a\x00': 1 }) // '{"a\\u0000":1}' BSON.serialize({ 'a\x00': 1 }) Uncaught BSONError: key a must not contain null bytes
What is the feature/improvement you would like?
Validate for null bytes within keys.