Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12204

Buffer::readUTF8String in bson_validate.cpp should validate utf8

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Stability
    • Security 2020-02-24, Security 2020-03-09, Security 2020-03-23

      Currently it does not. readCString probably should too, but at least UTF8 isn't part of it's name.

      Example failing test:

          TEST(BSONValidateFast, InvalidUTF8) {
              BSONObj x = BSON("invalidUTF8" << "\xFF"); // this byte should never be in well-formed utf8.
              ASSERT_NOT_OK(validateBSON(x.objdata(), x.objsize()));
          }
      

            Assignee:
            spencer.jackson@mongodb.com Spencer Jackson
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: